Revision: 28181
          http://sourceforge.net/p/bibdesk/svn/28181
Author:   hofman
Date:     2023-03-10 16:57:48 +0000 (Fri, 10 Mar 2023)
Log Message:
-----------
Use selection material for count bubble with reduced transparency, oterwise the 
bubbles become very light

Modified Paths:
--------------
    trunk/bibdesk/BDSKGroupBubbleView.m

Modified: trunk/bibdesk/BDSKGroupBubbleView.m
===================================================================
--- trunk/bibdesk/BDSKGroupBubbleView.m 2023-03-04 18:52:22 UTC (rev 28180)
+++ trunk/bibdesk/BDSKGroupBubbleView.m 2023-03-10 16:57:48 UTC (rev 28181)
@@ -54,7 +54,10 @@
     if (self) {
         if (RUNNING_AFTER(10_15)) {
             bgView = [[NSVisualEffectView alloc] initWithFrame:[self bounds]];
-            [bgView setMaterial:BDSKHasHighContrastAppearance(NSApp) ? 4 : 7];
+            if ([[NSWorkspace sharedWorkspace] 
accessibilityDisplayShouldIncreaseContrast] || [[NSWorkspace sharedWorkspace] 
accessibilityDisplayShouldReduceTransparency])
+                [bgView setMaterial:4];
+            else
+                [bgView setMaterial:7];
             [bgView setAutoresizingMask:NSViewWidthSizable | 
NSViewHeightSizable];
             [self addSubview:bgView];
         }
@@ -67,7 +70,10 @@
     if (self) {
         if (RUNNING_AFTER(10_15)) {
             bgView = [[NSVisualEffectView alloc] initWithFrame:[self bounds]];
-            [bgView setMaterial:BDSKHasHighContrastAppearance(NSApp) ? 4 : 7];
+            if ([[NSWorkspace sharedWorkspace] 
accessibilityDisplayShouldIncreaseContrast] || [[NSWorkspace sharedWorkspace] 
accessibilityDisplayShouldReduceTransparency])
+                [bgView setMaterial:4];
+            else
+                [bgView setMaterial:7];
             [bgView setAutoresizingMask:NSViewWidthSizable | 
NSViewHeightSizable];
             [self addSubview:bgView];
         }
@@ -82,7 +88,13 @@
 }
 
 - (void)updateMaterial {
-    [bgView setMaterial:BDSKHasHighContrastAppearance(NSApp) && 
[(NSTableRowView *)[[self superview] superview] isSelected] == NO ? 4 : 7];
+    if ([[NSWorkspace sharedWorkspace] 
accessibilityDisplayShouldIncreaseContrast])
+        [bgView setMaterial:[(NSTableRowView *)[[self superview] superview] 
isSelected] ? 7 : 4];
+    else if ([[NSWorkspace sharedWorkspace] 
accessibilityDisplayShouldReduceTransparency])
+        [bgView setMaterial:[[self cell] backgroundStyle] == 
NSBackgroundStyleDark ? 7 : 4];
+    else
+        [bgView setMaterial:7];
+
 }
 
 - (void)viewDidChangeEffectiveAppearance {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to