Update left half of space weather with colored labels. Also apply minor modifications

This commit is contained in:
alessandro90
2019-04-01 22:53:54 +02:00
parent f04aec4926
commit 5b95d19d7c
9 changed files with 854 additions and 393 deletions

View File

@@ -11,13 +11,15 @@ class SwitchableLabel(QLabel):
self.switch_off_color = off
def switch_on(self):
self.setStyleSheet(f"background-color: {self.switch_on_color}")
self.setStyleSheet(f"""background-color: {self.switch_on_color};
color:#000000;""")
def switch_off(self):
self.setStyleSheet(f"background-color: {self.switch_off_color}")
self.setStyleSheet(f"""background-color: {self.switch_off_color};
color:#000000;""")
class SwitchableLabelIterable(object):
class SwitchableLabelsIterable(object):
def __init__(self, *labels):
self.labels = labels
@@ -25,9 +27,9 @@ class SwitchableLabelIterable(object):
for lab in self.labels:
yield lab
def switch_on(label):
def switch_on(self, label):
for lab in self.labels:
if lab == label:
if lab is label:
lab.switch_on()
else:
lab.switch_off()