Advertisement
NiteShad0w

Untitled

Apr 14th, 2022
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.17 KB | None | 0 0
  1. class SeekSlider(QSlider):
  2.     light_stylesheet = f"""
  3.  
  4.    QSlider::handle {{
  5.        height: 2px;
  6.        background: {LIGHT_AUDIO_CONTROLLER_SEEK_SLIDER_HANDLE_BACKGROUND.name()};
  7.    }}
  8.  
  9.    QSlider::add-page {{
  10.        background: {LIGHT_AUDIO_CONTROLLER_SEEK_SLIDER_BACKGROUND.name()};
  11.    }}
  12.  
  13.    QSlider::sub-page {{
  14.        background: {LIGHT_AUDIO_CONTROLLER_SEEK_SLIDER_PASSED_BACKGROUND.name()};
  15.    }}
  16.    """
  17.  
  18.     dark_stylesheet = f"""
  19.  
  20.    QSlider::handle {{
  21.        height: 2px;
  22.        width: 2px;
  23.        background: {DARK_AUDIO_CONTROLLER_SEEK_SLIDER_HANDLE_BACKGROUND.name()};
  24.    }}
  25.  
  26.    QSlider::add-page {{
  27.        background: {DARK_AUDIO_CONTROLLER_SEEK_SLIDER_BACKGROUND.name()};
  28.    }}
  29.  
  30.    QSlider::sub-page {{
  31.        background: {DARK_AUDIO_CONTROLLER_SEEK_SLIDER_PASSED_BACKGROUND.name()};
  32.    }}
  33.    """
  34.  
  35.     def __init__(self, *args):
  36.         super().__init__(*args)
  37.  
  38.         self.setStyle(Style())
  39.  
  40.  
  41.     def set_dark_mode_enabled(self, dark_mode_enabled: bool) -> None:
  42.         if dark_mode_enabled:
  43.             self.setStyleSheet(self.dark_stylesheet)
  44.         else:
  45.             self.setStyleSheet(self.light_stylesheet)
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement