Skip to content

Commit

Permalink
add normal qstyle (better for sizes)
Browse files Browse the repository at this point in the history
  • Loading branch information
Furtif committed Mar 5, 2024
1 parent 9d3be38 commit a2f6130
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
6 changes: 6 additions & 0 deletions qstyle.qss → dtt4all_data/qstyle-d.qss
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ QRadioButton::indicator:checked {
background-color: #ffaa00; /* Background color when checked */
}

/* Styles for QCheckBox */
QCheckBox::indicator {
width: 15px; /* Width */
height: 15px; /* Height */
}

/* Styles for hovered QRadioButton and QCheckBox indicators */
QRadioButton::indicator:hover,
QCheckBox::indicator:hover {
Expand Down
29 changes: 29 additions & 0 deletions dtt4all_data/qstyle.qss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* Specific styles for QComboBox */
QComboBox {
width: 370px;
}

/* Styles for toolbar handles */
QToolBar::handle {
background: url("dtt4all_data/icons/handle.png"); /* Handle icon */
}

/* Styles for progress bars */
QProgressBar {
border: 2px solid gray; /* Border */
border-radius: 5px; /* Rounded border */
text-align: center; /* Text alignment */
}

/* Styles for progress bar chunks */
QProgressBar::chunk {
background-color: green; /* Chunk color */
width: 5px; /* Width */
margin: 0.5px; /* Margin */
}

/* Styles for QCheckBox */
QCheckBox::indicator {
width: 15px; /* Width */
height: 15px; /* Height */
}
12 changes: 10 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,13 +1157,15 @@ def donate(self):

def set_dark_style(onoff):
if (onoff):
stylefile = core.QFile("qstyle.qss")
stylefile = core.QFile("dtt4all_data/qstyle-d.qss")
stylefile.open(core.QFile.ReadOnly)
options.dark_mode = True
StyleSheet = bytes(stylefile.readAll()).decode()
else:
StyleSheet = ""
stylefile = core.QFile("dtt4all_data/qstyle.qss")
stylefile.open(core.QFile.ReadOnly)
options.dark_mode = False
StyleSheet = bytes(stylefile.readAll()).decode()

app.setStyleSheet(StyleSheet)

Expand Down Expand Up @@ -1564,6 +1566,12 @@ def demoMode(self):
options.simultation_mode = True
app = widgets.QApplication(sys.argv)

stylefile = core.QFile("dtt4all_data/qstyle.qss")
stylefile.open(core.QFile.ReadOnly)
options.dark_mode = False
StyleSheet = bytes(stylefile.readAll()).decode()
app.setStyleSheet(StyleSheet)

fsize = 9
fname = "Segoe UI"

Expand Down

0 comments on commit a2f6130

Please sign in to comment.