From 4f8e7fc83a650cd6f19c722e997ea5367db347f1 Mon Sep 17 00:00:00 2001 From: Yutao Meng Date: Fri, 25 Oct 2024 13:50:51 +0800 Subject: [PATCH] fix: Adjust menu styles Bug: https://pms.uniontech.com/bug-view-276581.html https://pms.uniontech.com/bug-view-279723.html Log: Adjust menu styles --- qt6/src/qml/FloatingPanel.qml | 10 ---------- qt6/src/qml/FlowStyle.qml | 12 ++++++------ qt6/src/qml/Menu.qml | 12 ++++++------ qt6/src/qml/MenuItem.qml | 2 +- 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/qt6/src/qml/FloatingPanel.qml b/qt6/src/qml/FloatingPanel.qml index bca43028..04a99c8f 100644 --- a/qt6/src/qml/FloatingPanel.qml +++ b/qt6/src/qml/FloatingPanel.qml @@ -87,15 +87,5 @@ Control { borderWidth: DS.Style.control.borderWidth } } - - Loader { - anchors.fill: backgroundRect - active: control.outsideBorderColor - sourceComponent: OutsideBoxBorder { - radius: backgroundRect.radius - color: control.D.ColorSelector.outsideBorderColor - borderWidth: DS.Style.control.borderWidth - } - } } } diff --git a/qt6/src/qml/FlowStyle.qml b/qt6/src/qml/FlowStyle.qml index 3d6ebb93..fa681c0e 100644 --- a/qt6/src/qml/FlowStyle.qml +++ b/qt6/src/qml/FlowStyle.qml @@ -648,8 +648,8 @@ QtObject { } property QtObject separator: QtObject { - property int lineTopPadding : 6 - property int lineBottomPadding : 4 + property int lineTopPadding : 0 + property int lineBottomPadding : 0 property int lineHeight : 2 property int topPadding: 11 property int bottomPadding: 2 @@ -660,8 +660,8 @@ QtObject { } property D.Palette background: D.Palette { - normal: behindWindowBlur.lightColor - normalDark: behindWindowBlur.darkColor + normal: Qt.rgba(235 / 255., 235 / 255., 235 / 255., 0.6) + normalDark: ("#80000000") } property D.Palette backgroundNoBlur: D.Palette { @@ -686,7 +686,7 @@ QtObject { property D.Palette itemText: D.Palette { normal: ("black") - normalDark: Qt.rgba(1, 1, 1, 0.6) + normalDark: ("white") } property D.Palette separatorText: D.Palette { @@ -814,7 +814,7 @@ QtObject { property D.Palette insideBorder: D.Palette { normal: Qt.rgba(0, 0, 0, 0.05) - normalDark: Qt.rgba(1, 1, 1, 0.05) + normalDark: Qt.rgba(1, 1, 1, 0.1) } } diff --git a/qt6/src/qml/Menu.qml b/qt6/src/qml/Menu.qml index ad3946e4..b2ebf04e 100644 --- a/qt6/src/qml/Menu.qml +++ b/qt6/src/qml/Menu.qml @@ -30,7 +30,7 @@ T.Menu { readonly property bool active: parent && parent.Window.active implicitHeight: DS.Style.control.implicitHeight(control) - implicitWidth: DS.Style.control.implicitWidth(control) + implicitWidth: DS.Style.control.implicitWidth(control) - 10 margins: DS.Style.menu.margins overlap: DS.Style.menu.overlap padding: DS.Style.menu.padding @@ -42,7 +42,7 @@ T.Menu { } contentItem: Control { - topPadding: 6 // TODO how to clip radius + topPadding: 15 // TODO how to clip radius bottomPadding: topPadding leftPadding: 0 rightPadding: leftPadding @@ -87,9 +87,9 @@ T.Menu { id: highlightRect anchors.left: parent ? parent.left : undefined anchors.right: parent ? parent.right : undefined - anchors.leftMargin: 6 - anchors.rightMargin: 6 - scale: D.DTK.hasAnimation ? 0.9 : 1.0 + anchors.leftMargin: 0 + anchors.rightMargin: 0 + scale: 0.9 property D.Palette backgroundColor: DS.Style.highlightPanel.background property D.Palette submenuOpenedItemHighlightColor: DS.Style.menu.submenuOpenedItemHighlight property D.Palette itemHighlightShadowColor: DS.Style.menu.itemHighlightShadow @@ -101,7 +101,7 @@ T.Menu { return D.ColorSelector.backgroundColor } } - radius: 6 + radius: 1 Component.onCompleted: { scale = 1.0 } diff --git a/qt6/src/qml/MenuItem.qml b/qt6/src/qml/MenuItem.qml index 61fffa75..efd8ce9d 100644 --- a/qt6/src/qml/MenuItem.qml +++ b/qt6/src/qml/MenuItem.qml @@ -35,7 +35,7 @@ T.MenuItem { readonly property real indicatorPadding: control.useIndicatorPadding && control.indicator ? control.indicator.width + control.spacing : 0 leftPadding: (!control.mirrored ? indicatorPadding : arrowPadding) + DS.Style.menu.item.contentPadding - rightPadding: (control.mirrored ? indicatorPadding : arrowPadding) + DS.Style.menu.item.contentPadding + rightPadding: 0 spacing: control.spacing mirrored: control.mirrored display: control.display