[vlc-commits] macosx: Fix VLCStatusBarIcon using wrong colors

Marvin Scholz git at videolan.org
Fri Jun 24 11:36:01 CEST 2016


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sun Jun 19 12:30:33 2016 +0200| [b9a4b30fb188173c7535c4a367eee3f7c9afe4d0] | committer: Marvin Scholz

macosx: Fix VLCStatusBarIcon using wrong colors

This improves label readability in Dark mode and accessibility option
like the high contrast setting by using the default disable/enabled
color.
For some reason, disabled text on menu items still renders slightly
better if the background of the menu is a dark area compared to text
on our custom view in menu items, but using a non-standard text color
has too many downsides compared to this little corner-case readability
problem.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b9a4b30fb188173c7535c4a367eee3f7c9afe4d0
---

 .../Resources/English.lproj/VLCStatusBarIconMainMenu.xib   |   12 ++++++------
 modules/gui/macosx/VLCStatusBarIcon.m                      |    9 +++------
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib b/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib
index 77ff9fe..b2cf2c5 100755
--- a/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib
+++ b/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
     <dependencies>
         <deployment identifier="macosx"/>
         <development version="7000" identifier="xcode"/>
@@ -88,7 +88,7 @@
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="by Ylvis" usesSingleLineMode="YES" id="TWt-2V-iGT">
                         <font key="font" metaFont="system"/>
-                        <color key="textColor" red="0.34105039267015702" green="0.34105039267015702" blue="0.34105039267015702" alpha="1" colorSpace="calibratedRGB"/>
+                        <color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" red="0.021842277486911033" green="0.021842277486911033" blue="0.021842277486911033" alpha="1" colorSpace="calibratedRGB"/>
                     </textFieldCell>
                 </textField>
@@ -97,7 +97,7 @@
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="on “The Fox”" usesSingleLineMode="YES" id="IKI-Pl-Iji">
                         <font key="font" metaFont="system"/>
-                        <color key="textColor" red="0.34105039269999998" green="0.34105039269999998" blue="0.34105039269999998" alpha="1" colorSpace="calibratedRGB"/>
+                        <color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" red="0.021842277489999999" green="0.021842277489999999" blue="0.021842277489999999" alpha="1" colorSpace="calibratedRGB"/>
                     </textFieldCell>
                 </textField>
@@ -168,7 +168,7 @@
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="right" title="00:00" usesSingleLineMode="YES" id="CLT-p2-bxf">
                         <font key="font" metaFont="system"/>
-                        <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
@@ -177,7 +177,7 @@
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="center" title="/" usesSingleLineMode="YES" id="y3P-oA-eTa">
                         <font key="font" metaFont="system"/>
-                        <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
@@ -186,7 +186,7 @@
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" title="00:00" usesSingleLineMode="YES" id="vF8-Z8-vhW">
                         <font key="font" metaFont="system"/>
-                        <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
diff --git a/modules/gui/macosx/VLCStatusBarIcon.m b/modules/gui/macosx/VLCStatusBarIcon.m
index b3c19c9..948ef69 100644
--- a/modules/gui/macosx/VLCStatusBarIcon.m
+++ b/modules/gui/macosx/VLCStatusBarIcon.m
@@ -373,12 +373,9 @@
 
 - (void)setProgressTimeEnabled:(BOOL)enabled
 {
-    NSColor *color;
-    color = (!enabled) ? [NSColor secondaryLabelColor] : [NSColor blackColor];
-    // Set color to the labels
-    [progressField setTextColor:color];
-    [separatorField setTextColor:color];
-    [totalField setTextColor:color];
+    [progressField setEnabled:enabled];
+    [separatorField setEnabled:enabled];
+    [totalField setEnabled:enabled];
 }
 
 



More information about the vlc-commits mailing list