diff options
author | Hartmnt <hartmunt@protonmail.com> | 2022-08-03 14:07:39 +0300 |
---|---|---|
committer | Hartmnt <hartmunt@protonmail.com> | 2022-08-03 14:07:39 +0300 |
commit | a93a405f26cbc395d9fff895040ea6084813ab4c (patch) | |
tree | bad2b5e9f6e7ac316153a82dc6b555776bc24a95 /themes | |
parent | 2ca3edce8af4be62dd2373bafeb491aa533e671e (diff) |
FIX(theme): Adapt Qt behavior change regarding padding in QMenu
Qt >= 5.12.6 has changed the behavior of the padding value in style sheets
for QMenus. Previously the padding was counted from the start of the QMenu::item,
ignoring any decorations. The new behavior starts counting the padding after any
decoration item.
Without this change, Mumble compiled against Qt versions >= 5.12.6 will have
effectively double the padding on all QMenus containing icons or check-marks.
However, there are multiple issues with padding in QMenus pending on the Qt side
so this change may regress later on.
Fixes #5462
Diffstat (limited to 'themes')
-rw-r--r-- | themes/Default/Dark.qss | 24 | ||||
-rw-r--r-- | themes/Default/Lite.qss | 24 | ||||
-rw-r--r-- | themes/Default/source/Imports/Base Theme.scss | 24 |
3 files changed, 39 insertions, 33 deletions
diff --git a/themes/Default/Dark.qss b/themes/Default/Dark.qss index 1fe6e61bf..a3d7c9d4c 100644 --- a/themes/Default/Dark.qss +++ b/themes/Default/Dark.qss @@ -197,11 +197,16 @@ QMenu { QMenu::item { border: 1px solid transparent; color: #d8d8d8; - padding: 5px 16px; - padding-left: 25px; + padding: 5px; + padding-right: 16px; + padding-left: 8px; border-radius: 2px; } +QMenu::icon { + left: 4px; +} + QMenu::item:selected { background: #3e4f5e; border: 1px solid #3e4f5e; @@ -217,12 +222,6 @@ QMenu::separator { height: 1px; } -QMenu::indicator { - padding-top: 2px; - height: 25px; - width: 25px; -} - QPushButton { background-color: #444; border: 1px solid #444; @@ -708,8 +707,11 @@ QTreeView::indicator { } QMenu::indicator { + padding-top: 2px; width: 12px; + height: 12px; left: 6px; + margin-right: 8px; } QCheckBox::indicator:checked, @@ -1052,15 +1054,15 @@ TalkingUI > * { background-color: #191919; } -TalkingUI [selected=false] { +TalkingUI [selected="false"] { background-color: #191919; } -TalkingUI [selected=false]:hover { +TalkingUI [selected="false"]:hover { background-color: #333; } -TalkingUI [selected=true] { +TalkingUI [selected="true"] { background-color: #3e4f5e; border: 1px solid #3e4f5e; } diff --git a/themes/Default/Lite.qss b/themes/Default/Lite.qss index 6d3518cea..79a5fc857 100644 --- a/themes/Default/Lite.qss +++ b/themes/Default/Lite.qss @@ -197,11 +197,16 @@ QMenu { QMenu::item { border: 1px solid transparent; color: #111; - padding: 5px 16px; - padding-left: 25px; + padding: 5px; + padding-right: 16px; + padding-left: 8px; border-radius: 2px; } +QMenu::icon { + left: 4px; +} + QMenu::item:selected { background: #dcedf5; border: 1px solid #97b5c6; @@ -217,12 +222,6 @@ QMenu::separator { height: 1px; } -QMenu::indicator { - padding-top: 2px; - height: 25px; - width: 25px; -} - QPushButton { background-color: #FFF; border: 1px solid #C4C4C4; @@ -708,8 +707,11 @@ QTreeView::indicator { } QMenu::indicator { + padding-top: 2px; width: 12px; + height: 12px; left: 6px; + margin-right: 8px; } QCheckBox::indicator:checked, @@ -1052,15 +1054,15 @@ TalkingUI > * { background-color: #FFF; } -TalkingUI [selected=false] { +TalkingUI [selected="false"] { background-color: #FFF; } -TalkingUI [selected=false]:hover { +TalkingUI [selected="false"]:hover { background-color: #eee; } -TalkingUI [selected=true] { +TalkingUI [selected="true"] { background-color: #dcedf5; border: 1px solid #97b5c6; } diff --git a/themes/Default/source/Imports/Base Theme.scss b/themes/Default/source/Imports/Base Theme.scss index 7cdf069d8..2a42182a1 100644 --- a/themes/Default/source/Imports/Base Theme.scss +++ b/themes/Default/source/Imports/Base Theme.scss @@ -217,11 +217,17 @@ QMenu::item { border:1px solid transparent; color:$sub-text; - padding:$base-padding + 1 $base-padding * 4; - padding-left:25px; + padding:$base-padding + 1; + padding-right:$base-padding * 4; + padding-left:$base-padding * 2; border-radius:$base-border-radius; } +QMenu::icon +{ + left:$base-padding; +} + QMenu::item:selected { background:$menuitem-hover; @@ -240,13 +246,6 @@ QMenu::separator height:1px; } -QMenu::indicator -{ - padding-top: 2px; - height:25px; - width:25px; -} - QPushButton { background-color:$button-bg; @@ -809,8 +808,11 @@ QTreeView::indicator, QMenu::indicator { - width: 12px; - left: 6px; + padding-top:2px; + width:12px; + height:12px; + left:6px; + margin-right:8px; } QCheckBox::indicator:checked, |