1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
From bc0ca29bd47ce45b30c66bd8743b6a48e20123d2 Mon Sep 17 00:00:00 2001
From: Nate Graham <nate@kde.org>
Date: Thu, 23 Dec 2021 12:11:28 -0700
Subject: [PATCH] Use metrics from Breeze for menu items
We can't read them dynamically right now, unfortunately. So the values
are hardcoded.
BUG: 447289
FIXED-IN: 5.91
---
org.kde.desktop/Menu.qml | 3 +++
org.kde.desktop/MenuItem.qml | 6 +++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/org.kde.desktop/Menu.qml b/org.kde.desktop/Menu.qml
index adaf644..205c0b7 100644
--- a/org.kde.desktop/Menu.qml
+++ b/org.kde.desktop/Menu.qml
@@ -37,6 +37,9 @@ T.Menu {
}
return maxWidth;
}
+
+ spacing: 0 // Hardcoded to the Breeze theme value
+
interactive: ApplicationWindow.window ? contentHeight > ApplicationWindow.window.height : false
clip: true
currentIndex: control.currentIndex || 0
diff --git a/org.kde.desktop/MenuItem.qml b/org.kde.desktop/MenuItem.qml
index d8a7cf0..f0c95e5 100644
--- a/org.kde.desktop/MenuItem.qml
+++ b/org.kde.desktop/MenuItem.qml
@@ -25,7 +25,7 @@ T.MenuItem {
Layout.fillWidth: true
padding: Kirigami.Units.smallSpacing
- verticalPadding: Math.floor(Kirigami.Units.smallSpacing * 1.5)
+ verticalPadding: 4 // Hardcoded to the Breeze theme value
hoverEnabled: !Kirigami.Settings.isMobile
Kirigami.MnemonicData.enabled: controlRoot.enabled && controlRoot.visible
@@ -53,7 +53,7 @@ T.MenuItem {
visible: (controlRoot.ListView.view && controlRoot.ListView.view.hasIcons) || (controlRoot.icon != undefined && (controlRoot.icon.name.length > 0 || controlRoot.icon.source.length > 0))
source: controlRoot.icon ? (controlRoot.icon.name || controlRoot.icon.source) : ""
color: controlRoot.icon ? controlRoot.icon.color : "transparent"
- Layout.preferredHeight: Math.max(Kirigami.Units.iconSizes.roundedIconSize(label.height), Kirigami.Units.iconSizes.small)
+ Layout.preferredHeight: Kirigami.Units.iconSizes.small
Layout.preferredWidth: Layout.preferredHeight
}
Label {
@@ -94,7 +94,7 @@ T.MenuItem {
x: controlRoot.mirrored ? controlRoot.padding : controlRoot.width - width - controlRoot.padding
y: controlRoot.topPadding + (controlRoot.availableHeight - height) / 2
source: controlRoot.mirrored ? "go-next-symbolic-rtl" : "go-next-symbolic"
- width: Math.max(Kirigami.Units.iconSizes.roundedIconSize(label.height), Kirigami.Units.iconSizes.small)
+ width: Kirigami.Units.iconSizes.small
height: width
visible: controlRoot.subMenu
}
--
GitLab
|