"""
This module defines the `ModelStylesheet` class, which is responsible for managing stylesheets for GUI components
based on the theme mode.
"""
[docs]
class ModelStylesheet:
"""
A class responsible for managing stylesheets for GUI components based on the theme mode.
Attributes:
_model: The model instance associated with the stylesheet.
_theme (str): The theme mode of the model, which determines the stylesheets to be used.
Methods:
__init__: Initializes the `ModelStylesheet` instance with a model instance and theme mode.
stylesheet_button_additional: Generates a stylesheet for additional QPushButton customization based on the provided state.
_stylesheet_pushbutton_light: Generates a light-themed stylesheet for QPushButton.
"""
[docs]
def __init__(self, model):
self._model = model
self._theme = model.theme_mode
[docs]
def label_stylesheet(self):
"""
Generate a Qt stylesheet for QLabel widgets based on the current theme.
Return a string representing the stylesheet to use for QLabel widgets in the current theme. The style is
different for "light" and "dark" themes. The returned string can be set as the style sheet of a QLabel widget
to apply the theme.
Return:
str: A string representing the Qt stylesheet to use for QLabel widgets in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info("ModelStylesheet: label_stylesheet(), "
f"Change label stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_label_light() if self._theme == "light" else self._stylesheet_label_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.label_stylesheet(): Error: {str(e)}")
[docs]
def label_title_stylesheet(self):
"""
Generate a Qt stylesheet for QLabel widgets based on the current theme.
Return a string representing the stylesheet to use for QLabel widgets in the current theme. The style is
different for "light" and "dark" themes. The returned string can be set as the style sheet of a QLabel widget
to apply the theme.
Return:
str: A string representing the Qt stylesheet to use for QLabel widgets in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info("ModelStylesheet: label_title_stylesheet(), "
f"Change label title stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_label_title_light() \
if self._theme == "light" else self._stylesheet_label_title_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.label_title_stylesheet(): Error: {str(e)}")
[docs]
def transparent_label_stylesheet(self):
"""
Generate a Qt stylesheet for QLabel widgets based on the current theme.
Return a string representing the stylesheet to use for QLabel widgets in the current theme. The style is
different for "light" and "dark" themes. The returned string can be set as the style sheet of a QLabel widget
to apply the theme.
Return:
str: A string representing the Qt stylesheet to use for QLabel widgets in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: label_title_stylesheet(), "
f"Change label title stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_transparent_label_light() \
if self._theme == "light" else self._stylesheet_transparent_label_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.transparent_label_stylesheet(): Error: {str(e)}")
[docs]
def frame_main_stylesheet(self):
"""
Generate a Qt stylesheet for QLabel widgets based on the current theme.
Return a string representing the stylesheet to use for QLabel widgets in the current theme. The style is
different for "light" and "dark" themes. The returned string can be set as the style sheet of a QLabel widget
to apply the theme.
Return:
str: A string representing the Qt stylesheet to use for QLabel widgets in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: frame_main_stylesheet(), "
f"Change frame main stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_frame_main_light() \
if self._theme == "light" else self._stylesheet_frame_main_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.frame_main_stylesheet(): Error: {str(e)}")
[docs]
def font_12_stylesheet(self):
"""
Generate a Qt stylesheet for QFont with 12pt size based on the current theme.
Return:
str: A string representing the Qt stylesheet to use for QFont with 12pt size in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: font_12_stylesheet(), "
f"Change font stylesheet to 12 size and in {self._theme} mode")
return self._stylesheet_font_12_light() if self._theme == "light" else self._stylesheet_font_12_dark()
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.font_12_stylesheet(): Error: {str(e)}")
[docs]
def font_14_stylesheet(self):
"""
Generate a Qt stylesheet for QFont with 14pt size based on the current theme.
Return:
str: A string representing the Qt stylesheet to use for QFont with 14pt size in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: font_14_stylesheet(), "
f"Change font stylesheet to 14 size and in {self._theme} mode")
return self._stylesheet_font_14_light() if self._theme == "light" else self._stylesheet_font_14_dark()
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.font_14_stylesheet(): Error: {str(e)}")
[docs]
def frame_object_stylesheet(self):
"""
Generate a Qt stylesheet for QLabel widgets based on the current theme.
Return a string representing the stylesheet to use for QLabel widgets in the current theme. The style is
different for "light" and "dark" themes. The returned string can be set as the style sheet of a QLabel widget
to apply the theme.
Return:
str: A string representing the Qt stylesheet to use for QLabel widgets in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: frame_object_stylesheet(), "
f"Change frame object stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_frame_object_light() \
if self._theme == "light" else self._stylesheet_frame_object_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.frame_object_stylesheet(): Error: {str(e)}")
[docs]
def frame_transparent_stylesheet(self):
"""
Generate a Qt stylesheet for a transparent frame based on the current theme.
Return:
str: A string representing the Qt stylesheet to use for a transparent frame in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: frame_transparent_stylesheet(), "
f"Change frame transparent stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_frame_transparent_light() \
if self._theme == "light" else self._stylesheet_frame_transparent_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.frame_transparent_stylesheet(): Error: {str(e)}")
[docs]
def line_stylesheet(self):
"""
Generate a Qt stylesheet for a line widget based on the current theme.
Return:
str: A string representing the Qt stylesheet to use for a line widget in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: line_stylesheet(), "
f"Change line stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_line_light() \
if self._theme == "light" else self._stylesheet_line_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.line_stylesheet(): Error: {str(e)}")
[docs]
def combobox_stylesheet(self):
"""
Return the Qt stylesheet for a QComboBox widget, based on the current theme.
Arg:
self: The object that this method belongs to.
Return:
A string containing the Qt stylesheet for the QComboBox widget, based on the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: combobox_stylesheet(), "
f"Change combo box stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_combobox_light() \
if self._theme == "light" else self._stylesheet_combobox_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.combobox_stylesheet(): Error: {str(e)}")
[docs]
def slider_stylesheet(self):
"""
Generate a Qt stylesheet for a slider widget based on the current theme.
Return:
str: A string representing the Qt stylesheet to use for a slider widget in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: slider_stylesheet(), "
f"Change slider stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_slider_light() \
if self._theme == "light" else self._stylesheet_slider_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.slider_stylesheet(): Error: {str(e)}")
[docs]
def checkbox_stylesheet(self):
"""
Generate a Qt stylesheet for a checkbox widget based on the current theme.
Return:
str: A string representing the Qt stylesheet to use for a checkbox widget in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: checkbox_stylesheet(), "
f"Change check box stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_checkbox_light() \
if self._theme == "light" else self._stylesheet_checkbox_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.checkbox_stylesheet(): Error: {str(e)}")
[docs]
def spinbox_stylesheet(self):
"""
Generate a Qt stylesheet for a spin box widget based on the current theme.
Return:
str: A string representing the Qt stylesheet to use for a spin box widget in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: spinbox_stylesheet(), "
f"Change spin box stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_spinbox_light() \
if self._theme == "light" else self._stylesheet_spinbox_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.spinbox_stylesheet(): Error: {str(e)}")
[docs]
def double_spinbox_stylesheet(self):
"""
Generate a Qt stylesheet for a double spin box widget based on the current theme.
Return:
str: A string representing the Qt stylesheet to use for a double spin box widget in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: double_spinbox_stylesheet(), "
f"Change double spin box stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_double_spinbox_light() \
if self._theme == "light" else self._stylesheet_double_spinbox_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.double_spinbox_stylesheet(): Error: {str(e)}")
[docs]
def line_edit_stylesheet(self):
"""
Generate a Qt stylesheet for a line edit widget based on the current theme.
Return:
str: A string representing the Qt stylesheet to use for a line edit widget in the current theme.
"""
try:
if self._model.debug_mode:
self._model.activity_logger.info(f"ModelStylesheet: double_spinbox_stylesheet(), "
f"Change line edit stylesheet to {self._theme} mode")
stylesheet = self._stylesheet_line_edit_light() \
if self._theme == "light" else self._stylesheet_line_edit_dark()
return stylesheet
except Exception as e:
self._model.activity_logger.error(f"ModelStylesheet.line_edit_stylesheet(): Error: {str(e)}")
# diubah
@classmethod
def _stylesheet_pushbutton_dark(cls):
stylesheet = """
QPushButton {
color: RGB (15, 74, 108);
border-radius: 3px;
padding-left:8px;
padding-right:8px;
background-color: #5F676E;
border: 2px solid rgb(52, 59, 72);}
QPushButton:hover {
color: rgb(0,0,0);
background-color: rgb(200, 200, 200);
border: 1px solid rgb(255, 255, 255);}
QPushButton:pressed {
background-color: rgb(35, 40, 49);
border: 2px solid rgb(43, 50, 61);
color: rgb(255,255,255);}
QPushButton:checked {
background-color: rgb(35, 40, 49);
border: 2px solid rgb(43, 50, 61);
color: rgb(255,255,255);}
"""
return stylesheet
@classmethod
def _stylesheet_button_pp_video_light(cls):
stylesheet = """
QPushButton {
color: rgb(0,0,0);
border-radius: 3px;
padding-left:8px;
padding-right:8px;
background-color: rgb(235,243,255);}
QPushButton:hover {
background-color: rgb(255, 255, 255);
border: 2px solid rgb(52, 59, 72);}
QPushButton:pressed {
background-color: rgb(35, 40, 49);
border: 2px solid rgb(43, 50, 61);
color: rgb(255,255,255);}
"""
return stylesheet
@classmethod
def _stylesheet_button_pp_video_dark(cls):
stylesheet = """
QPushButton {
color: rgb(221,221,221);
border-radius: 3px;
padding-left:8px;
padding-right:8px;
background-color: #5F676E;
border: 2px solid rgb(52, 59, 72);}
QPushButton:hover {
color: rgb(0,0,0);
background-color: rgb(200, 200, 200);
border: 1px solid rgb(255, 255, 255);}
QPushButton:pressed {
background-color: rgb(35, 40, 49);
border: 2px solid rgb(43, 50, 61);
color: rgb(255,255,255);}
"""
return stylesheet
@classmethod
def _stylesheet_label_light(cls):
stylesheet = """
QLabel {
background-color: rgb(200,205,205);
border-radius:3px;}
"""
return stylesheet
@classmethod
def _stylesheet_label_dark(cls):
stylesheet = """
QLabel {
background-color: #17202b;
border-radius:3px;}
"""
return stylesheet
@classmethod
def _stylesheet_label_title_light(cls):
stylesheet = """
QLabel {
font-size: 16pt;
background-color: rgb(200,205,205);
border-radius:3px;
font-family: Courier;
}
"""
return stylesheet
@classmethod
def _stylesheet_label_title_dark(cls):
stylesheet = """
QLabel {
font-size: 16pt;
background-color: #17202b;
border-radius:3px;
font-family: Courier;
}
"""
return stylesheet
@classmethod
def _stylesheet_transparent_label_light(cls):
stylesheet = """
QLabel {
background-color: transparent;
}
"""
return stylesheet
@classmethod
def _stylesheet_transparent_label_dark(cls):
stylesheet = """
QLabel {
background-color: transparent;
}
"""
return stylesheet
@classmethod
def _stylesheet_frame_main_light(cls):
stylesheet = """
QFrame {
color: rgb(0, 0, 0);
font: 10pt "Segoe UI";
background-color: rgba(15, 74, 108, 0.25);
border:none;}
"""
return stylesheet
@classmethod
def _stylesheet_frame_main_dark(cls):
stylesheet = """
QFrame {
color: rgb(255, 255, 255);
font: 10pt "Segoe UI";
background-color: rgb(221, 221, 221);
border:none;}
"""
return stylesheet
@classmethod
def _stylesheet_font_12_light(cls):
stylesheet = """
color: rgb(0, 0, 0);
font: 12pt "Segoe UI";
"""
return stylesheet
@classmethod
def _stylesheet_font_12_dark(cls):
stylesheet = """
color: rgb(0, 0, 0);
font: 12pt "Segoe UI";
"""
return stylesheet
@classmethod
def _stylesheet_font_14_light(cls):
stylesheet = """
color: rgb(0, 0, 0);
font: 14pt "Segoe UI";
"""
return stylesheet
@classmethod
def _stylesheet_font_14_dark(cls):
stylesheet = """
color: rgb(221, 221, 221);
font: 14pt "Segoe UI";
"""
return stylesheet
@classmethod
def _stylesheet_frame_object_light(cls):
stylesheet = """
QFrame {
color: rgb(0, 0, 0);
background-color: rgb(220, 221, 225);
border:none;}
"""
return stylesheet
@classmethod
def _stylesheet_frame_object_dark(cls):
stylesheet = """
QFrame{
background-color: rgb(57, 65, 80);
border:none;}
"""
return stylesheet
@classmethod
def _stylesheet_frame_transparent_light(cls):
stylesheet = """
QFrame {
background-color: rgb(220, 221, 225);
color: rgb(0, 0, 0);
border:none;}
"""
return stylesheet
# diubah
@classmethod
def _stylesheet_frame_transparent_dark(cls):
stylesheet = """
QFrame {
background-color: #5F676E;
border:none;}
"""
return stylesheet
@classmethod
def _stylesheet_line_light(cls):
stylesheet = """
QFrame {
border: 2px solid rgb(255, 255, 255);
width: 1px;}
"""
return stylesheet
@classmethod
def _stylesheet_line_dark(cls):
stylesheet = """
QFrame {
border: 2px solid rgb(44, 49, 58);
width: 1px;}
"""
return stylesheet
@classmethod
def _stylesheet_combobox_light(cls):
stylesheet = """
QComboBox{
color: rgb(0, 0, 0);
background-color: rgb(238, 238, 236);
border-radius: 3px;
border: 2px solid rgb(200, 200, 200);
padding: 5px;
padding-left: 10px;}
QComboBox:hover{
border: 2px solid rgb(52, 59, 72);}
QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 25px;
border-left-width: 3px;
border-left-color: rgb(200, 200, 200);
border-left-style: solid;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
background-image: url(icons:chevron-down.svg);
background-position: center;
background-repeat: no-repeat;}
QComboBox QAbstractItemView {
color: rgb(0, 0, 0);
background-color: rgb(255, 255, 255);
padding:5px;
selection-background-color: rgb(39, 44, 54);}
"""
return stylesheet
@classmethod
def _stylesheet_combobox_dark(cls):
stylesheet = """
QComboBox{
background-color: rgb(27, 29, 35);
border-radius: 5px;
border: 2px solid rgb(52, 59, 72);
padding: 5px;
padding-left: 10px;}
QComboBox:hover{
border: 2px solid rgb(82, 94, 88);}
QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 25px;
border-left-width: 3px;
border-left-color: rgba(39, 44, 54, 150);
border-left-style: solid;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
background-image: url(icons:light/cil-arrow-bottom.svg);
background-position: center;
background-repeat: no-repeat;}
QComboBox QAbstractItemView {
color: rgb(255, 121, 198);
background-color: rgb(33, 37, 43);
padding: 10px;
selection-background-color: rgb(39, 44, 54);}
"""
return stylesheet
@classmethod
def _stylesheet_scroll_area_light(cls):
stylesheet = """
QScrollArea {
background-color: rgb(220, 221, 225);}
QScrollBar:horizontal {
border: 1px solid rgb(180, 180, 180);
background: rgb(180, 180, 180);
height: 12px;
margin: 0px 12px 0 12px;
border-radius: 0px;}
QScrollBar::handle:horizontal {
background: rgb(220, 221, 225);
min-width: 25px;
border-radius: 0px}
QScrollBar::add-line:horizontal {
border: none;
background: rgb(130, 135, 140);
width: 13px;
background-image: url(icons:chevron-right-12.svg);
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
subcontrol-position: right;
subcontrol-origin: margin;}
QScrollBar::sub-line:horizontal {
border: none;
background: rgb(130, 135, 140);
width: 13px;
background-image: url(icons:chevron-left-12.svg);
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
subcontrol-position: left;
subcontrol-origin: margin;}
QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal{
background: none;}
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal{
background: none;}
QScrollBar:vertical {
border: 1px solid rgb(180, 180, 180);
background: rgb(180, 180, 180);
width: 12px;
margin: 12px 0px 12px 0px;
border-radius: 0px;}
QScrollBar::handle:vertical {
background: rgb(220, 221, 225);
min-height: 25px;
border-radius: 0px}
QScrollBar::add-line:vertical {
border: none;
background: rgb(130, 135, 140);
height: 12px;
background-image: url(icons:chevron-down-12.svg);
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
subcontrol-position: bottom;
subcontrol-origin: margin;}
QScrollBar::sub-line:vertical {
border: none;
background: rgb(130, 135, 140);
height: 12px;
background-image: url(icons:chevron-up-12.svg);
border-top-left-radius: 0px;
border-top-right-radius: 0px;
subcontrol-position: top;
subcontrol-origin: margin;}
QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {
background: none;}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
background: none;}
"""
return stylesheet
@classmethod
def _stylesheet_scroll_area_dark(cls):
stylesheet = """
QScrollArea {
background-color: rgb(57, 65, 80);}
QScrollBar:horizontal {
border: 1px solid rgb(80, 80, 80);
background: rgb(80, 80, 80);
height: 12px;
margin: 0px 12px 0px 12px;
border-radius: 0px;}
QScrollBar::handle:horizontal {
background: #17202b;;
min-width: 25px;
border-radius: 0px}
QScrollBar::add-line:horizontal {
border: none;
background: rgb(55, 63, 77);
width: 12px;
background-image: url(icons:light/chevron-right-12.svg);
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
subcontrol-position: right;
subcontrol-origin: margin;}
QScrollBar::sub-line:horizontal {
border: none;
background: rgb(55, 63, 77);
width: 12px;
background-image: url(icons:light/chevron-left-12.svg);
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
subcontrol-position: left;
subcontrol-origin: margin;}
QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal
{background: none;}
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal
{background: none;}
QScrollBar:vertical {
border: 1px solid rgb(80, 80, 80);
background: rgb(80, 80, 80);
width: 12px;
margin: 12px 0px 12px 0;
border-radius: 0px;}
QScrollBar::handle:vertical {
background: #17202b;
min-height: 25px;
border-radius: 0px}
QScrollBar::add-line:vertical {
border: none;
background: rgb(55, 63, 77);
height: 12px;
background-image: url(icons:light/cil-arrow-bottom-12.svg);
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
subcontrol-position: bottom;
subcontrol-origin: margin;}
QScrollBar::sub-line:vertical {
border: none;
background: rgb(55, 63, 77);
height: 12px;
background-image: url(icons:light/cil-arrow-top-12.svg);
border-top-left-radius: 0px;
border-top-right-radius: 0px;
subcontrol-position: top;
subcontrol-origin: margin;}
QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {
background: none;}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
background: none;}
"""
return stylesheet
@classmethod
def _stylesheet_radio_button_light(cls):
stylesheet = """
QRadioButton {
color: rgb(0, 0, 0);}
QRadioButton::indicator {
color: rgb(0, 0, 0);
border: 2px solid rgb(52, 59, 72);
width: 12px;
height: 12px;
border-radius: 8px;
background-color: white;}
QRadioButton::indicator:hover {
border: 2px solid rgb(58, 66, 81);}
QRadioButton::indicator:checked {
background: 2px solid rgb(52, 59, 72);
border: 2px solid rgb(52, 59, 72);
background-image: url(icons:light/cil-check-alt-12.svg);}
"""
return stylesheet
@classmethod
def _stylesheet_radio_button_dark(cls):
stylesheet = """
QRadioButton {
color: rgb(255, 255, 255);}
QRadioButton::indicator {
border: 2px solid rgb(52, 59, 72);
width: 12px;
height: 12px;
border-radius: 8px;
background-color: white;}
QRadioButton::indicator:hover {
border: 2px solid rgb(58, 66, 81);}
QRadioButton::indicator:checked {
background: 2px solid rgb(52, 59, 72);
border: 2px solid rgb(52, 59, 72);
background-image: url(icons:light/cil-check-alt-12.svg);}
"""
return stylesheet
@classmethod
def _stylesheet_slider_light(cls):
stylesheet = """
QSlider::groove:horizontal {
height: 10px;
margin: 0px;
background-color: rgb(52, 59, 72);}
QSlider::groove:horizontal:hover {
background-color: rgb(55, 62, 76);}
QSlider::handle:horizontal {
background-color: rgb(189, 147, 249);
border: none;
height: 10px;
width: 15px;
margin: 0px;}
QSlider::handle:horizontal:hover {
background-color: rgb(195, 155, 255);}
QSlider::handle:horizontal:pressed {
background-color: rgb(255, 121, 198);}
"""
return stylesheet
@classmethod
def _stylesheet_slider_dark(cls):
stylesheet = """
QSlider::groove:horizontal {
border-radius: 0px;
height: 10px;
margin: 0px;
background-color: rgb(52, 59, 72);}
QSlider::groove:horizontal:hover {
background-color: rgb(55, 62, 76);}
QSlider::handle:horizontal {
background-color: rgb(189, 147, 249);
border: none;
height: 10px;
width: 15px;
margin: 0px;
border-radius: 0px;}
QSlider::handle:horizontal:hover {
background-color: rgb(195, 155, 255);}
QSlider::handle:horizontal:pressed {
background-color: rgb(255, 121, 198);}
"""
return stylesheet
@classmethod
def _stylesheet_checkbox_light(cls):
stylesheet = """
QCheckBox {
color: rgb(0, 0, 0);
font: 10pt "Segoe UI";}
QCheckBox::indicator {
border: 2px solid rgb(52, 59, 72);
width: 10px;
height: 10px;
border-radius: 5px;
background: white;}
QCheckBox::indicator:hover {
border: 2px solid rgb(58, 66, 81);}
QCheckBox::indicator:checked {
background: 2px solid white;
border: 2px solid rgb(52, 59, 72);
background-image: url(icons:light/check-12.svg) contain;}
"""
return stylesheet
@classmethod
def _stylesheet_checkbox_dark(cls):
stylesheet = """
QCheckBox {
color: rgb(255, 255, 255);
font: 10pt "Segoe UI";}
QCheckBox::indicator {
border: 2px solid rgb(255, 255, 255);
width: 10px;
height: 10px;
border-radius: 5px;
background: rgb(180, 180, 180);}
QCheckBox::indicator:hover {
border: 2px solid rgb(180, 180, 180);
background: rgb(255, 255, 255);}
QCheckBox::indicator:checked {
background: 2px solid white;
border: 2px solid rgb(255, 255, 255);
background-image: url(icons:check-12.svg);}
"""
return stylesheet
@classmethod
def _stylesheet_spinbox_light(cls):
stylesheet = """
QSpinBox{
color: rgb(0, 0, 0);
border-radius: 3px;
border: 2px solid rgb(200, 200, 200);
padding: 2px;
padding-left:5px;
font: 9pt "Segoe UI";}
QSpinBox::hover{
border: 2px solid rgb(52, 59, 72);}
QSpinBox::up-button {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 12px;
height: 10px;
background-image: url(icons:chevron-up-12.svg);
border-left-width: 1px;
border-left-color: rgb(200,200,200);
border-left-style: solid;}
QSpinBox::down-button {
subcontrol-origin: padding;
subcontrol-position: bottom right;
width: 12px;
height: 10px;
background-image: url(icons:chevron-down-12.svg);
border-left-width: 1px;
border-left-color: rgb(200,200,200);
border-left-style: solid;}
"""
return stylesheet
@classmethod
def _stylesheet_spinbox_dark(cls):
stylesheet = """
QSpinBox{
color: rgb(255, 255, 255);
background-color: rgb(27, 29, 35);
border-radius: 3px;
border: 2px solid rgb(52, 59, 72);
padding: 2px;
padding-left:7px;
font: 8pt "Segoe UI";}
QSpinBox::hover{
border: 2px solid rgb(82, 94, 88);}
QSpinBox::up-button {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 13px;
height: 10px;
background-image: url(icons:light/cil-arrow-top-12.svg);
border-left-width: 1px;
border-left-color: rgb(52, 59, 72);
border-left-style: solid;}
QSpinBox::down-button {
subcontrol-origin: padding;
subcontrol-position: bottom right;
width: 13px;
height: 10px;
background-image: url(icons:light/cil-arrow-bottom-12.svg);
border-left-width: 1px;
border-left-color: rgb(52, 59, 72);
border-left-style: solid;}
"""
return stylesheet
@classmethod
def _stylesheet_double_spinbox_light(cls):
stylesheet = """
QDoubleSpinBox{
color: rgb(0, 0, 0);
border-radius: 3px;
border: 2px solid rgb(200, 200, 200);
padding: 2px;
padding-left:2px;
font: 8pt "Segoe UI";}
QDoubleSpinBox::hover{
border: 2px solid rgb(52, 59, 72);}
QDoubleSpinBox::up-button {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 12px;
height: 10px;
background-image: url(icons:chevron-up-12.svg);
border-left-width: 1px;
border-left-color: rgb(200,200,200);
border-left-style: solid;}
QDoubleSpinBox::down-button {
subcontrol-origin: padding;
subcontrol-position: bottom right;
width: 12px;
height: 10px;
background-image: url(icons:chevron-down-12.svg);
border-left-width: 1px;
border-left-color: rgb(200,200,200);
border-left-style: solid;}
"""
return stylesheet
@classmethod
def _stylesheet_double_spinbox_dark(cls):
stylesheet = """
QDoubleSpinBox{
color: rgb(255, 255, 255);
background-color: rgb(27, 29, 35);
border-radius: 3px;
border: 2px solid rgb(52, 59, 72);
padding: 2px;
padding-left:2px;
font: 8pt "Segoe UI";}
QDoubleSpinBox::hover{
border: 2px solid rgb(82, 94, 88);}
QDoubleSpinBox::up-button {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 13px;
height: 10px;
background-image: url(icons:light/cil-arrow-top-12.svg);
border-left-width: 1px;
border-left-color: rgb(52, 59, 72);
border-left-style: solid;}
QDoubleSpinBox::down-button {
subcontrol-origin: padding;
subcontrol-position: bottom right;
width: 13px;
height: 10px;
background-image: url(icons:light/cil-arrow-bottom-12.svg);
border-left-width: 1px;
border-left-color: rgb(52, 59, 72);
border-left-style: solid;}
"""
return stylesheet
@classmethod
def _stylesheet_line_edit_light(cls):
stylesheet = """
QLineEdit {
background-color: rgb(255, 255, 255);
border-radius: 2px;
border : 1px solid rgb(20, 25, 20);
color: rgb(30, 30, 30);}
QLineEdit::hover{
border: 1px solid rgb(82, 94, 88);}
"""
return stylesheet
@classmethod
def _stylesheet_line_edit_dark(cls):
stylesheet = """
QLineEdit {
background-color: #17202b;
border-radius: 2px;
border : 1px solid #394150;
color: rgb(255, 255, 255);}
QLineEdit::hover{
border: 1px solid rgb(82, 94, 88);}
"""
return stylesheet