Skip to content

Commit

Permalink
Fix widget init dynamic theme color
Browse files Browse the repository at this point in the history
Signed-off-by: Loren Eteval <[email protected]>
  • Loading branch information
LorenEteval committed Sep 1, 2023
1 parent 6950607 commit 141a225
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Furious/Widget/Widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ def __init__(self, *actions, **kwargs):

self.addAction(action)

self.setStyleSheet(self.getStyleSheet(Color.LIGHT_BLUE))
if APP().tray is not None and APP().tray.ConnectAction.isConnected():
self.setStyleSheet(self.getStyleSheet(Color.LIGHT_RED_))
else:
self.setStyleSheet(self.getStyleSheet(Color.LIGHT_BLUE))

@staticmethod
def getStyleSheet(color):
Expand Down Expand Up @@ -167,7 +170,10 @@ class MenuBar(SupportConnectedCallback, QMenuBar):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

self.setSelectionColor(Color.LIGHT_BLUE)
if APP().tray is not None and APP().tray.ConnectAction.isConnected():
self.setSelectionColor(Color.LIGHT_RED_)
else:
self.setSelectionColor(Color.LIGHT_BLUE)

def setSelectionColor(self, color):
self.setStyleSheet(
Expand Down

0 comments on commit 141a225

Please sign in to comment.