Skip to content

Commit be2f529

Browse files
committed
use system colors for cli-tool in prefs pane
- the hard-coded colors weren't legible in dark mode
1 parent 186dca8 commit be2f529

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎app/Resources/en.lproj/PlotDevicePreferences.xib‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BN2-f7-Mcx">
5454
<rect key="frame" x="26" y="40" width="50" height="14"/>
5555
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
56-
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Syntax:" id="bOX-yZ-t90">
56+
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Theme:" id="bOX-yZ-t90">
5757
<font key="font" metaFont="smallSystem"/>
5858
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
5959
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
@@ -155,16 +155,16 @@
155155
</textFieldCell>
156156
</textField>
157157
<textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sQe-Q3-waN">
158-
<rect key="frame" x="16" y="10" width="168" height="14"/>
158+
<rect key="frame" x="16" y="10" width="216" height="14"/>
159159
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
160160
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="run scripts from the terminal" id="fee-4z-kHa">
161161
<font key="font" metaFont="smallSystem"/>
162-
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
162+
<color key="textColor" name="placeholderTextColor" catalog="System" colorSpace="catalog"/>
163163
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
164164
</textFieldCell>
165165
</textField>
166166
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bar-jt-drT">
167-
<rect key="frame" x="229" y="1" width="86" height="28"/>
167+
<rect key="frame" x="232" y="1" width="86" height="28"/>
168168
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
169169
<buttonCell key="cell" type="push" title="Install" bezelStyle="rounded" alignment="center" controlSize="small" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="WY6-mn-T7K">
170170
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -194,7 +194,7 @@
194194
</buttonCell>
195195
</button>
196196
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LeO-L8-lya">
197-
<rect key="frame" x="15" y="6" width="116" height="20"/>
197+
<rect key="frame" x="15" y="8" width="116" height="20"/>
198198
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
199199
<buttonCell key="cell" type="check" title="Check once a day" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="bwO-bu-Tq1">
200200
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -211,7 +211,7 @@
211211
<outlet property="delegate" destination="-2" id="106"/>
212212
<outlet property="initialFirstResponder" destination="UxM-tv-d5u" id="K1E-Ud-fTz"/>
213213
</connections>
214-
<point key="canvasLocation" x="140" y="144"/>
214+
<point key="canvasLocation" x="139.5" y="144"/>
215215
</window>
216216
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="zey-1s-azI" customClass="NSPanel">
217217
<windowStyleMask key="styleMask" utility="YES"/>
@@ -285,6 +285,7 @@ Gw
285285
</customView>
286286
</subviews>
287287
</view>
288+
<point key="canvasLocation" x="24" y="-123"/>
288289
</window>
289290
</objects>
290291
</document>

‎plotdevice/gui/preferences.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ def defaultDefaults():
2929
"plotdevice:font-size":11,
3030
}
3131
NSUserDefaults.standardUserDefaults().registerDefaults_(defaultDefaults())
32-
ERR_COL = NSColor.colorWithRed_green_blue_alpha_(167/255.0, 41/255.0, 34/255.0, 1.0)
33-
OK_COL = NSColor.colorWithRed_green_blue_alpha_(60/255.0, 60/255.0, 60/255.0, 1.0)
3432
THEMES = None # to be filled in as needed
3533

3634
def _hex_to_nscolor(hexclr):
@@ -216,7 +214,7 @@ def checkTool(self):
216214
self.toolAction.setTitle_(action.title())
217215
self.toolPath.setSelectable_(found is not None)
218216
self.toolPath.setStringValue_(found.decode('utf8') if found else '')
219-
self.toolPath.setTextColor_(OK_COL if valid else ERR_COL)
217+
self.toolPath.setTextColor_(NSColor.labelColor() if valid else NSColor.systemRedColor())
220218
self.toolBoilerplate.setHidden_(found is not None)
221219
self.toolPath.setHidden_(found is None)
222220

0 commit comments

Comments
 (0)