From 7b5a71c6249dc52fd385f51c0dcbf2a1aec22e3e Mon Sep 17 00:00:00 2001 From: zqq-dora Date: Mon, 28 Sep 2026 13:35:29 +0800 Subject: [PATCH] fix: adjust menu item height, separator spacing and dark mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Reduce menu item height from 30px to 26px for compact layout 2. Add menu item padding property (3px) to constrain content height 3. Reduce menu top/bottom padding from 8px to 6px 4. Set separator top/bottom padding to 3px for proper spacing 5. Add normalDark color for separator to fix invisible separator in dark mode 6. Disable highlight for disabled menu items in MenuItem.qml 7. Update SPDX copyright year in MenuItem.qml Log: Fix menu styling and dark mode rendering issues Influence: 1. Verify menu item height is 26px and content fits within bounds 2. Verify separator appears with 3px padding above and below 3. Verify separator is visible in dark mode 4. Verify disabled menu items show no hover highlight effect 5. Verify menu top/bottom edge padding is 6px fix: 调整菜单项高度、分割线间距及深色模式样式 1. 菜单项高度从30px调整为26px,使布局更紧凑 2. 添加菜单项padding属性(3px),限制内容高度不超出26px 3. 菜单上下边距从8px调整为6px 4. 分割线上下间距设置为3px,保证合理的间距 5. 添加分割线深色模式颜色,修复深色模式下分割线不可见的问题 6. MenuItem.qml中禁用项不再显示hover高亮效果 7. 更新MenuItem.qml的SPDX版权年份 Log: 修复菜单样式及深色模式渲染问题 Influence: 1. 验证菜单项高度为26px,内容不超出边界 2. 验证分割线上下间距为3px 3. 验证深色模式下分割线可见 4. 验证禁用菜单项不显示hover高亮效果 5. 验证菜单上下边距为6px --- qt6/src/qml/FlowStyle.qml | 10 ++++++---- qt6/src/qml/MenuItem.qml | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/qt6/src/qml/FlowStyle.qml b/qt6/src/qml/FlowStyle.qml index 7c089f110..c09180d98 100644 --- a/qt6/src/qml/FlowStyle.qml +++ b/qt6/src/qml/FlowStyle.qml @@ -693,30 +693,32 @@ QtObject { property QtObject menu: QtObject { property int padding: 6 - property int topPadding: 8 + property int topPadding: 6 property int radius: D.DTK.platformTheme.windowRadius < 0 ? 12 : D.DTK.platformTheme.windowRadius property int margins: 10 property int overlap: 1 property QtObject item: QtObject { property int width: 180 - property int height: 30 + property int height: 26 property size iconSize: Qt.size(14, 14) property int count: 0 property int contentPadding: 30 property int indicatorMargin: 10 property int radius: 6 + property int padding: 3 } property QtObject separator: QtObject { - property int lineTopPadding : 0 - property int lineBottomPadding : 0 + property int lineTopPadding : 3 + property int lineBottomPadding : 3 property int lineHeight : 2 property int topPadding: 11 property int bottomPadding: 2 property D.Palette lineColor: D.Palette { normal: Qt.rgba(0, 0, 0, 0.1) + normalDark: Qt.rgba(1, 1, 1, 0.1) } } diff --git a/qt6/src/qml/MenuItem.qml b/qt6/src/qml/MenuItem.qml index ea6d6e8a3..5ec6e1654 100644 --- a/qt6/src/qml/MenuItem.qml +++ b/qt6/src/qml/MenuItem.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -14,10 +14,10 @@ T.MenuItem { implicitWidth: DS.Style.control.implicitWidth(control) implicitHeight: DS.Style.control.implicitHeight(control) baselineOffset: contentItem.y + contentItem.baselineOffset - padding: DS.Style.control.padding + padding: DS.Style.menu.item.padding spacing: DS.Style.control.spacing opacity: D.ColorSelector.controlState === D.DTK.DisabledState ? 0.4 : 1 - highlighted: hovered || (subMenu && subMenu.visible) + highlighted: enabled && (hovered || (subMenu && subMenu.visible)) icon { height: DS.Style.menu.item.iconSize.height width: DS.Style.menu.item.iconSize.height