Skip to content

Commit

Permalink
Merge pull request #12216 from ronso0/menu-icon-position-fix
Browse files Browse the repository at this point in the history
Skins / Qt6: menu icon position fix
  • Loading branch information
daschuer authored Jun 2, 2024
2 parents e46c498 + ada952c commit 2c66ea3
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 13 deletions.
3 changes: 1 addition & 2 deletions res/skins/Deere/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2299,8 +2299,6 @@ WSearchRelatedTracksMenu #SearchSelectedAction::indicator {
background-color: transparent;
}

QLineEdit QMenu::icon:selected,
QPlainTextEdit QMenu::icon:selected,
WLibrarySidebar QMenu::indicator:selected,
WTrackTableViewHeader QMenu QCheckBox::indicator:selected,
WTrackMenu QMenu QCheckBox::indicator:selected {
Expand All @@ -2310,6 +2308,7 @@ WTrackMenu QMenu QCheckBox::indicator:selected {
#MainMenu::item:disabled,
#MainMenu QMenu::item:disabled,
WLibrarySidebar QMenu::item:disabled,
WLibraryTextBrowser QMenu::item:disabled,
WTrackMenu::item:disabled,
WTrackMenu QMenu::item:disabled,
WTrackMenu QMenu QCheckBox:disabled,
Expand Down
3 changes: 2 additions & 1 deletion res/skins/LateNight/style_classic.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,6 @@ WEffectSelector,
/* ::indicator:!checked won't work. use 'unchecked' */
#MainMenu QMenu::indicator:unchecked:selected,
WLibrarySidebar QMenu::item:selected,
WTrackTableViewHeader QMenu::item:selected,
WTrackTableViewHeader QMenu QCheckBox:selected,
WTrackTableViewHeader QMenu QCheckBox:focus,
WTrackTableViewHeader QMenu QCheckBox:hover,
Expand All @@ -2576,6 +2575,7 @@ WTrackMenu QMenu::item:selected,
WTrackMenu QMenu QCheckBox:selected,
WTrackMenu QMenu QCheckBox:focus,
WTrackMenu QMenu QCheckBox:hover,
WLibraryTextBrowser QMenu::item:selected,
QLineEdit QMenu::item:selected,
QPlainTextEdit QMenu::item:selected,
WCoverArtMenu::item:selected,
Expand Down Expand Up @@ -2630,6 +2630,7 @@ WLibrarySidebar QMenu::item:disabled,
WTrackMenu::item:disabled,
WTrackMenu QMenu::item:disabled,
WTrackMenu QMenu QCheckBox:disabled,
WLibraryTextBrowser QMenu::item:disabled,
QLineEdit QMenu::item:disabled,
QPlainTextEdit QMenu::item:disabled {
color: #494949;
Expand Down
3 changes: 2 additions & 1 deletion res/skins/LateNight/style_palemoon.qss
Original file line number Diff line number Diff line change
Expand Up @@ -3036,10 +3036,10 @@ WSearchLineEdit::item {
/* ::indicator:!checked won't work. use 'unchecked' */
#MainMenu QMenu::indicator:unchecked:selected,
WLibrarySidebar QMenu::item:selected,
WTrackTableViewHeader QMenu::item:selected,
WTrackTableViewHeader QMenu QCheckBox:selected,
WTrackTableViewHeader QMenu QCheckBox:focus,
WTrackTableViewHeader QMenu QCheckBox:hover,
WLibraryTextBrowser QMenu::item:selected,
WTrackMenu::item:selected,
WTrackMenu QMenu::item:selected,
WTrackMenu QMenu QCheckBox:selected,
Expand Down Expand Up @@ -3099,6 +3099,7 @@ WSearchLineEdit::item:selected,
#MainMenu::item:disabled,
#MainMenu QMenu::item:disabled,
WLibrarySidebar QMenu::item:disabled,
WLibraryTextBrowser QMenu::item:disabled,
WTrackMenu::item:disabled,
WTrackMenu QMenu::item:disabled,
WTrackMenu QMenu QCheckBox:disabled,
Expand Down
1 change: 1 addition & 0 deletions res/skins/Shade/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ WEffectSelector QAbstractScrollArea,
#MainMenu::item:disabled,
#MainMenu QMenu::item:disabled,
WLibrarySidebar QMenu::item:disabled,
WLibraryTextBrowser QMenu::item:disabled,
WTrackMenu::item:disabled,
WTrackMenu QMenu::item:disabled,
WTrackMenu QMenu QCheckBox:disabled,
Expand Down
1 change: 1 addition & 0 deletions res/skins/Shade/style_dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ WEffectSelector::indicator:unchecked:selected,
#MainMenu::item:disabled,
#MainMenu QMenu::item:disabled,
WLibrarySidebar QMenu::item:disabled,
WLibraryTextBrowser QMenu::item:disabled,
WTrackMenu::item:disabled,
WTrackMenu QMenu::item:disabled,
WTrackMenu QMenu QCheckBox:disabled,
Expand Down
2 changes: 1 addition & 1 deletion res/skins/Shade/style_summer_sunset.qss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ WLibrarySidebar QMenu::indicator:unchecked:selected,
WTrackTableViewHeader QMenu QCheckBox:selected,
WTrackTableViewHeader QMenu QCheckBox:focus,
WTrackTableViewHeader QMenu QCheckBox:hover,
QTextBrowser QMenu::item:selected,
WLibraryTextBrowser QMenu::item:selected,
WTrackMenu::item:selected,
WTrackMenu QMenu::item:selected,
WTrackMenu QMenu QCheckBox:selected,
Expand Down
2 changes: 2 additions & 0 deletions res/skins/Tango/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2378,6 +2378,7 @@ WLibrarySidebar QMenu::item:selected,
WTrackTableViewHeader QMenu QCheckBox:selected,
WTrackTableViewHeader QMenu QCheckBox:focus,
WTrackTableViewHeader QMenu QCheckBox:hover,
WLibraryTextBrowser QMenu::item:selected,
WTrackMenu::item:selected,
WTrackMenu QMenu::item:selected,
WTrackMenu QMenu QCheckBox:selected,
Expand Down Expand Up @@ -2414,6 +2415,7 @@ WSearchLineEdit::item:selected,
#MainMenu::item:disabled,
#MainMenu QMenu::item:disabled,
WLibrarySidebar QMenu::item:disabled,
WLibraryTextBrowser QMenu::item:disabled,
WTrackMenu::item:disabled,
WTrackMenu QMenu::item:disabled,
WTrackMenu QMenu QCheckBox:disabled,
Expand Down
29 changes: 21 additions & 8 deletions res/skins/default.qss
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ WEffectChainPresetButton QMenu::separator {


/* All menus that have at least one item with a checkbox*/
WLibrarySidebar QMenu::item,
WTrackTableViewHeader QMenu::item,
#CratesMenu::item,
WEffectChainPresetButton QMenu::item {
/* padding-right reserves space for the submenu expand arrow
Expand All @@ -140,26 +138,41 @@ WEffectChainPresetButton QMenu::item {

/* Icons in those menus (copy, paste, cut, delete) */
QLineEdit QMenu::icon,
WLibraryTextBrowser QMenu::icon,
/* - checkbox in Crate name context menu
"[ ] Auto DJ Track Source" */
WLibrarySidebar QMenu::indicator {
WLibraryTextBrowser QMenu::icon {
/* Qt 5.12.8: negative margin-right increases the overall item width but has no effect
on the indicator itself.
positive margin-right pushes icon to the right...
Qt 5.15.2: needs negative margin-right in order to eliminate the item's
padding-left (necessary to avoid text/icon overlap); */
padding-left (necessary to avoid text/icon overlap);
Qt 6 : use style of #MainMenu QMenu::indicator from default-menu-styles-linux.qss
Though, this breaks WTrackTableViewHeader QMenu::indicator and
WLibrarySidebar QMenu::indicator which obviously require the Qt5 style ¯\_(ツ)_/¯ */
margin: 0em -0.1em 0em -1.3em;
padding: 0em 0em 0em 2em;
}

/* Column checkboxes in the table header menu */
WTrackTableViewHeader QMenu::indicator {
margin: 0 -1em 0 0.25em;
}

/* items in Crate sub menu */
/* Column checkboxes in the table header menu */
WTrackTableViewHeader QMenu QCheckBox,
/* items in Crate sub menu and Search related Tracks menu */
WTrackMenu QMenu QCheckBox,
WEffectChainPresetButton QMenu QCheckBox {
padding: 0.17em 0.6em 0.17em 0.25em;
}

/* Sidebar with checkbox in Crate name context menu (actually a checkable QAction)
"[ ] Auto DJ Track Source" */
WLibrarySidebar QMenu::item {
padding: 0.17em 0.6em 0.17em 0.5em;
}
WLibrarySidebar QMenu::indicator {
margin: 0em -0.1em 0em 0.3em;
}

WLibrarySidebar QMenu::indicator,
WTrackTableViewHeader QMenu QCheckBox::indicator,
WTrackMenu QMenu QCheckBox::indicator,
Expand Down

0 comments on commit 2c66ea3

Please sign in to comment.