Skip to content

Commit 4c5df52

Browse files
committed
fix: adapt color scheme to work in dark mode (close #92)
1 parent 94525d0 commit 4c5df52

File tree

11 files changed

+23
-19
lines changed

11 files changed

+23
-19
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2.6.8
2+
- fix: adapt color scheme to work in dark mode (#92)
13
2.6.7
24
- fix: correctly handle missing features on data export (#80)
35
- ref: cleanup (default arguments and PyQt5 object references)

shapeout2/gui/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535

3636
# global plotting configuration parameters
37-
pg.setConfigOption("background", "w")
37+
pg.setConfigOption("background", None)
3838
pg.setConfigOption("foreground", "k")
3939
pg.setConfigOption("antialias", True)
4040
pg.setConfigOption("imageAxisOrder", "row-major")

shapeout2/gui/matrix/dm_dataset.ui

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<x>0</x>
1111
<y>0</y>
1212
<width>94</width>
13-
<height>110</height>
13+
<height>111</height>
1414
</rect>
1515
</property>
1616
<property name="sizePolicy">
@@ -26,7 +26,7 @@
2626
<bool>false</bool>
2727
</property>
2828
<property name="styleSheet">
29-
<string notr="true">background-color:#C3C9FF</string>
29+
<string notr="true">background-color:#C3C9FF; color:black</string>
3030
</property>
3131
<layout class="QVBoxLayout" name="verticalLayout">
3232
<property name="spacing">
@@ -233,7 +233,7 @@
233233
<item>
234234
<widget class="QCheckBox" name="checkBox">
235235
<property name="sizePolicy">
236-
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
236+
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
237237
<horstretch>0</horstretch>
238238
<verstretch>0</verstretch>
239239
</sizepolicy>

shapeout2/gui/matrix/dm_element.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def update_content(self, quickview=False):
103103
else:
104104
tooltip += "\nShift+Click for Quick View"
105105

106-
self.setStyleSheet("background-color:{}".format(color))
107-
self.label.setStyleSheet("background-color:{}".format(color))
108106
self.label.setText(label)
109107
self.setToolTip(tooltip)
110108
self.label.setToolTip(tooltip)
109+
self.setStyleSheet(
110+
"background-color:{};color:black".format(color))

shapeout2/gui/matrix/dm_element.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<bool>false</bool>
4444
</property>
4545
<property name="styleSheet">
46-
<string notr="true">background-color:#EFEFEF</string>
46+
<string notr="true">background-color:#EFEFEF; color:black</string>
4747
</property>
4848
<layout class="QVBoxLayout" name="verticalLayout">
4949
<property name="spacing">

shapeout2/gui/matrix/dm_filter.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<bool>false</bool>
3838
</property>
3939
<property name="styleSheet">
40-
<string notr="true">background-color:#E7E186</string>
40+
<string notr="true">background-color:#E7E186; color:black</string>
4141
</property>
4242
<layout class="QVBoxLayout" name="verticalLayout">
4343
<property name="spacing">
@@ -169,7 +169,7 @@
169169
<item alignment="Qt::AlignVCenter">
170170
<widget class="QCheckBox" name="checkBox">
171171
<property name="sizePolicy">
172-
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
172+
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
173173
<horstretch>0</horstretch>
174174
<verstretch>0</verstretch>
175175
</sizepolicy>

shapeout2/gui/matrix/pm_element.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def update_content(self, quickview=False):
3232
label = "inactive\n(unused)"
3333
tooltip = "Click to activate"
3434

35-
self.setStyleSheet("background-color:{}".format(color))
36-
self.label.setStyleSheet("background-color:{}".format(color))
3735
self.label.setText(label)
3836
self.setToolTip(tooltip)
3937
self.label.setToolTip(tooltip)
38+
self.setStyleSheet(
39+
"background-color:{};color:black".format(color))

shapeout2/gui/matrix/pm_plot.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<bool>false</bool>
3838
</property>
3939
<property name="styleSheet">
40-
<string notr="true">background-color:#86B5E7</string>
40+
<string notr="true">background-color:#86B5E7; color:black</string>
4141
</property>
4242
<layout class="QVBoxLayout" name="verticalLayout">
4343
<property name="spacing">

shapeout2/gui/pipeline_plot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def update_content(self):
109109
# clear widget
110110
self.plot_layout.clear()
111111

112+
# set background to white
113+
self.plot_layout.setBackground("w")
114+
112115
if not slot_states:
113116
return
114117

@@ -238,6 +241,8 @@ def __init__(self, *args, **kwargs):
238241
self.axes_to_front()
239242
# Keep track of all elements (for redraw)
240243
self._plot_elements = []
244+
# Set background to white (for plot export)
245+
self.vb.setBackgroundColor("w")
241246

242247
def perform_export(self, file):
243248
"""Performs export in new layout with axes labels set
@@ -347,6 +352,7 @@ def redraw(self, dslist, slot_states, plot_state):
347352
add_label(text="{} events".format(len(sct[0].data)),
348353
anchor_parent=self.axes["right"]["item"],
349354
font_size_diff=-1,
355+
color="black",
350356
text_halign="right",
351357
text_valign="top",
352358
dx=2,
@@ -358,6 +364,7 @@ def redraw(self, dslist, slot_states, plot_state):
358364
# only a contour plot
359365
self.setTitle("") # fake title
360366
add_label(text="Contours",
367+
color="black",
361368
anchor_parent=self.titleLabel.item,
362369
text_halign="center",
363370
text_valign="top",

shapeout2/gui/quick_view/qv_main.ui

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
<height>300</height>
3838
</size>
3939
</property>
40-
<property name="styleSheet">
41-
<string notr="true">background-color:#FFFFFF</string>
42-
</property>
4340
</widget>
4441
</item>
4542
<item>
@@ -567,7 +564,7 @@
567564
</size>
568565
</property>
569566
<property name="styleSheet">
570-
<string notr="true"/>
567+
<string notr="true">background-color:transparent</string>
571568
</property>
572569
</widget>
573570
</item>

0 commit comments

Comments
 (0)