Skip to content

Commit

Permalink
Bug fixes for #11
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexhuszagh committed Jul 17, 2021
1 parent 735d648 commit d620f22
Show file tree
Hide file tree
Showing 12 changed files with 4,095 additions and 3,985 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ Here is a sample theme, with the color descriptions annotated. Please note that
"slider:foreground": "#3daee9",
// Background color for the handle of a QSlider.
"slider:handle:background": "#1d2023",
// Color for a disabled menubar/menu item.
"menu:disabled": "#76797c",
// Color for a checked/hovered QCheckBox or QRadioButton.
"checkbox:light": "#58d3ff",
// Color for a disabled or unchecked/unhovered QCheckBox or QRadioButton.
Expand Down
7,950 changes: 3,977 additions & 3,973 deletions breeze_resources.py

Large diffs are not rendered by default.

27 changes: 23 additions & 4 deletions dark/stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ QWidget:disabled
background-color: #31363b;
}

QWidget:disabled:hover
{
background-color: #31363b;
}

QCheckBox
{
spacing: 0.23em;
Expand Down Expand Up @@ -269,6 +274,11 @@ QMenuBar::item:selected
background: transparent;
}

QMenuBar::item:disabled
{
color: #76797c;
}

QMenuBar::item:pressed
{
background-color: #3daee9;
Expand Down Expand Up @@ -302,10 +312,14 @@ QMenu::item:selected
background-color: #3daee9;
}

QMenu::item:hover
QMenu::item:selected:disabled
{
color: #eff0f1;
background-color: #3daee9;
background-color: #31363b;
}

QMenu::item:disabled
{
color: #76797c;
}

QMenu::indicator
Expand Down Expand Up @@ -362,6 +376,11 @@ QMenu::right-arrow
height: 0.8em;
}

QMenu::right-arrow:disabled
{
border-image: url(:/dark/right_arrow_disabled.svg);
}

QAbstractItemView
{
alternate-background-color: #31363b;
Expand All @@ -370,7 +389,7 @@ QAbstractItemView
border-radius: 0.09em;
}

QMenuBar:focus
QMenuBar::item:focus:!disabled
{
border: 0.04em solid #3daee9;
}
Expand Down
27 changes: 23 additions & 4 deletions light/stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ QWidget:disabled
background-color: #eff0f1;
}

QWidget:disabled:hover
{
background-color: #eff0f1;
}

QCheckBox
{
spacing: 0.23em;
Expand Down Expand Up @@ -269,6 +274,11 @@ QMenuBar::item:selected
background: transparent;
}

QMenuBar::item:disabled
{
color: #bab9b8;
}

QMenuBar::item:pressed
{
background-color: rgba(51, 164, 223, 0.5);
Expand Down Expand Up @@ -302,10 +312,14 @@ QMenu::item:selected
background-color: rgba(51, 164, 223, 0.5);
}

QMenu::item:hover
QMenu::item:selected:disabled
{
color: #31363b;
background-color: rgba(51, 164, 223, 0.5);
background-color: #eff0f1;
}

QMenu::item:disabled
{
color: #bab9b8;
}

QMenu::indicator
Expand Down Expand Up @@ -362,6 +376,11 @@ QMenu::right-arrow
height: 0.8em;
}

QMenu::right-arrow:disabled
{
border-image: url(:/light/right_arrow_disabled.svg);
}

QAbstractItemView
{
alternate-background-color: #eff0f1;
Expand All @@ -370,7 +389,7 @@ QAbstractItemView
border-radius: 0.09em;
}

QMenuBar:focus
QMenuBar::item:focus:!disabled
{
border: 0.04em solid rgba(51, 164, 223, 0.5);
}
Expand Down
27 changes: 23 additions & 4 deletions template/stylesheet.qss.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ QWidget:disabled
background-color: ^background^;
}

QWidget:disabled:hover
{
background-color: ^background^;
}

QCheckBox
{
spacing: 0.23em;
Expand Down Expand Up @@ -269,6 +274,11 @@ QMenuBar::item:selected
background: transparent;
}

QMenuBar::item:disabled
{
color: ^menu:disabled^;
}

QMenuBar::item:pressed
{
background-color: ^highlight^;
Expand Down Expand Up @@ -302,10 +312,14 @@ QMenu::item:selected
background-color: ^highlight^;
}

QMenu::item:hover
QMenu::item:selected:disabled
{
color: ^foreground^;
background-color: ^highlight^;
background-color: ^background^;
}

QMenu::item:disabled
{
color: ^menu:disabled^;
}

QMenu::indicator
Expand Down Expand Up @@ -362,6 +376,11 @@ QMenu::right-arrow
height: 0.8em;
}

QMenu::right-arrow:disabled
{
border-image: url(:/^style^/right_arrow_disabled.svg);
}

QAbstractItemView
{
alternate-background-color: ^background^;
Expand All @@ -370,7 +389,7 @@ QAbstractItemView
border-radius: 0.09em;
}

QMenuBar:focus
QMenuBar::item:focus:!disabled
{
border: 0.04em solid ^highlight^;
}
Expand Down
41 changes: 41 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,47 @@ def test_multiple_buttons(widget, *_):

return child

def test_disabled_menu(widget, window, font, width, *_):
child = QtWidgets.QMenuBar(window)
child.setGeometry(QtCore.QRect(0, 0, width, int(1.5 * font.pointSize())))
menu = QtWidgets.QMenu('Main Menu', child)
menu.addAction(QtWidgets.QAction('&Action 1', window))
menu.addAction(QtWidgets.QAction('&Action 2', window))
submenu = QtWidgets.QMenu('Sub Menu', menu)
submenu.addAction(QtWidgets.QAction('&Action 3', window))
action1 = QtWidgets.QAction('&Action 4', window)
action1.setCheckable(True)
action1.setEnabled(False)
submenu.addAction(action1)
menu.addAction(submenu.menuAction())
action2 = QtWidgets.QAction('&Action 5', window)
action2.setCheckable(True)
action2.setChecked(True)
menu.addSeparator()
menu.addAction(action2)
action3 = QtWidgets.QAction('&Action 6', window)
action3.setCheckable(True)
menu.addAction(action3)
icon = QtGui.QIcon(':/dark/close.svg')
menu.addAction(QtWidgets.QAction(icon, '&Action 7', window))
menu.addAction(QtWidgets.QAction(icon, '&Action 8', window))
menu.actions()[2].setEnabled(False)
submenu.addAction(QtWidgets.QAction(icon, '&Action 9', window))
child.addAction(menu.menuAction())
window.setMenuBar(child)

return child

def test_disabled_menubar(widget, window, font, width, *_):
child = QtWidgets.QMenuBar(window)
child.setGeometry(QtCore.QRect(0, 0, width, int(1.5 * font.pointSize())))
menu = QtWidgets.QMenu('Main Menu', child)
child.addAction(menu.menuAction())
window.setMenuBar(child)
menu.setEnabled(False)

return child

def test(args, qtargv, test_widget):
'''Test a single widget.'''

Expand Down
1 change: 1 addition & 0 deletions theme/dark-green.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"tree": "#afafaf",
"slider:foreground": "#33b833",
"slider:handle:background": "#1d2023",
"menu:disabled": "#76797c",
"checkbox:light": "#40e640",
"checkbox:disabled": "#c8c9ca",
"scrollbar:hover": "#33b833",
Expand Down
1 change: 1 addition & 0 deletions theme/dark-purple.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"tree": "#afafaf",
"slider:foreground": "#a74bb8",
"slider:handle:background": "#1d2023",
"menu:disabled": "#76797c",
"checkbox:light": "#ca3fe6",
"checkbox:disabled": "#c8c9ca",
"scrollbar:hover": "#a74bb8",
Expand Down
1 change: 1 addition & 0 deletions theme/dark.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"tree": "#afafaf",
"slider:foreground": "#3daee9",
"slider:handle:background": "#1d2023",
"menu:disabled": "#76797c",
"checkbox:light": "#58d3ff",
"checkbox:disabled": "#c8c9ca",
"scrollbar:hover": "#3daee9",
Expand Down
1 change: 1 addition & 0 deletions theme/light-green.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"tree": "#4b4b4b",
"slider:foreground": "#32df33",
"slider:handle:background": "#eff0f1",
"menu:disabled": "#bab9b8",
"checkbox:light": "#272b2f",
"checkbox:disabled": "#6a6e71",
"scrollbar:hover": "rgba(50, 223, 50, 0.8)",
Expand Down
1 change: 1 addition & 0 deletions theme/light-purple.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"tree": "#4b4b4b",
"slider:foreground": "#c233df",
"slider:handle:background": "#eff0f1",
"menu:disabled": "#bab9b8",
"checkbox:light": "#272b2f",
"checkbox:disabled": "#6a6e71",
"scrollbar:hover": "rgba(194, 51, 223, 0.8)",
Expand Down
1 change: 1 addition & 0 deletions theme/light.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"tree": "#4b4b4b",
"slider:foreground": "#3daef3",
"slider:handle:background": "#eff0f1",
"menu:disabled": "#bab9b8",
"checkbox:light": "#272b2f",
"checkbox:disabled": "#6a6e71",
"scrollbar:hover": "rgba(51, 164, 223, 0.8)",
Expand Down

0 comments on commit d620f22

Please sign in to comment.