Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions panels/notification/plugin/NotifyAction.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -141,12 +141,35 @@ Control {
Layout.maximumWidth: 200
Layout.alignment: Qt.AlignHCenter
sourceComponent: ComboBox {
id: comboBox
padding: 0
rightPadding: 4
property var expandActions: actions.slice(1)
textRole: "text"
implicitHeight: 30
implicitWidth: 160
model: expandActions
activeFocusOnTab: false

TextMetrics {
id: textMetrics
font: comboBox.font
text: comboBox.displayText
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TextMetrics 可以设置最大显示宽度吧,

}

implicitWidth: Math.min(200, textMetrics.width + comboBox.padding + comboBox.rightPadding + 28)

indicator: DciIcon {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtk的样式不适用这里的么?我看bug单子上说样式不一样,主要是背景吧,这里是主要修指示器?

x: comboBox.width - width - comboBox.rightPadding
Comment on lines +161 to +162
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Indicator positioning may not respect layout mirroring / RTL setups.

The manual x calculation (comboBox.width - width - comboBox.rightPadding) assumes a left‑to‑right layout and will misplace the indicator in RTL/mirrored setups. Prefer anchoring to right (or left, per design) with anchors.rightMargin so positioning automatically adapts to layout direction and stays maintainable.

y: comboBox.topPadding + (comboBox.availableHeight - height) / 2
sourceSize.width: DS.Style.comboBox.iconSize
sourceSize.height: DS.Style.comboBox.iconSize
palette: DTK.makeIconPalette(comboBox.palette)
name: "arrow_ordinary_down"
mode: comboBox.D.ColorSelector.controlState
theme: comboBox.D.ColorSelector.controlTheme
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comboBox.D.ColorSelector.controlTheme
这里不需要“D.”,这里没有这个别名,

fallbackToQIcon: false
}

Keys.onBacktabPressed: function(event) {
// Go back to first action button
if (firstActionBtn.enabled) {
Expand All @@ -164,6 +187,7 @@ Control {
}
delegate: NotifyActionButton {
required property int index
padding: 0
width: parent.width
actionData: expandActions[index]
activeFocusOnTab: false
Expand Down