Commit 36ec4ea0 authored by Devin Lin's avatar Devin Lin 🎨
Browse files

Make Menu highlight consistent with desktop style (add padding)

parent 2514ff8e
Pipeline #201282 passed with stage
in 1 minute and 21 seconds
......@@ -11,8 +11,9 @@ Kirigami.ShadowedRectangle {
id: root
property int currentIndex: -1
property int count: 0
readonly property real topRadius: root.currentIndex == 0 ? Impl.Units.smallRadius : 0
readonly property real bottomRadius: root.currentIndex == Math.max(root.count-1, 0) ? Impl.Units.smallRadius : 0
property bool alwaysCurveCorners: false
readonly property real topRadius: (alwaysCurveCorners || root.currentIndex == 0) ? Impl.Units.smallRadius : 0
readonly property real bottomRadius: (alwaysCurveCorners || root.currentIndex == Math.max(root.count-1, 0)) ? Impl.Units.smallRadius : 0
Kirigami.Theme.colorSet: Kirigami.Theme.Selection
Kirigami.Theme.inherit: false
......
......@@ -170,6 +170,7 @@ T.ComboBox {
x: (control.width - width)/2
implicitWidth: contentWidth + leftPadding + rightPadding
width: Math.max(control.width, implicitWidth)
padding: Kirigami.Units.smallSpacing
delegate: null
......@@ -188,6 +189,7 @@ T.ComboBox {
highlight: Impl.ListViewHighlight {
currentIndex: control.highlightedIndex
count: control.count
alwaysCurveCorners: true
}
interactive: Window.window ? contentHeight + control.topPadding + control.bottomPadding > Window.window.height : false
clip: interactive // Only needed when the ListView can be dragged/flicked
......
......@@ -28,7 +28,7 @@ T.Menu {
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding)
padding: Kirigami.Units.smallSpacing
margins: 0
overlap: background && background.hasOwnProperty("border") ? background.border.width : 0
......@@ -45,6 +45,7 @@ T.Menu {
highlight: Impl.ListViewHighlight {
currentIndex: control.currentIndex
count: control.count
alwaysCurveCorners: true
}
// For some reason, `keyNavigationEnabled: true` isn't needed and
// using it causes separators and disabled items to be highlighted
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment