Skip to content

Commit

Permalink
Fix progress bar defocus on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Dec 22, 2024
1 parent 025d831 commit 8726bb7
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/onthespot/gui/mainui.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,23 @@ def open_theme_dialog(self):
luminance = (0.299 * r + 0.587 * g + 0.114 * b)

if luminance < 128:
# Dark color, set light font
stylesheet = f'background-color: {color.name()}; color: white;'
# Dark color, set light font and progress bar
stylesheet = f'''
background-color: {color.name()};
color: white;
QProgressBar::chunk {{
background: #2596BE;
}}
'''
else:
# Light color, set dark font
stylesheet = f'background-color: {color.name()}; color: black;'
# Light color, set dark font and progress bar
stylesheet = f'''
background-color: {color.name()};
color: black;
QProgressBar::chunk {{
background: #81D4FA;
}}
'''
config.set_('theme', stylesheet)
config.update()
self.centralwidget.setStyleSheet(stylesheet)
Expand Down

0 comments on commit 8726bb7

Please sign in to comment.