Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions qt6/src/qml/ComboBox.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2020 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

Expand Down Expand Up @@ -28,6 +28,8 @@ T.ComboBox {
padding: DS.Style.comboBox.padding
leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
topPadding: control.flat ? 0 : padding
bottomPadding: control.flat ? 0 : padding

delegate: MenuItem {
implicitWidth: Math.max(DS.Style.control.implicitWidth(control), popup.implicitWidth - DS.Style.popup.margin * 2)
Expand Down Expand Up @@ -129,10 +131,9 @@ T.ComboBox {
background: Item {
implicitWidth: control.flat ? control.implicitContentWidth + control.leftPadding + control.rightPadding
: DS.Style.comboBox.width
implicitHeight: DS.Style.comboBox.height
implicitHeight: control.flat ? 30 : DS.Style.comboBox.height
Loader {
anchors.fill: parent
active: !control.flat
sourceComponent: control.editable ? editableComponent : floatingComponent
property alias comboBox: control
Component {
Expand All @@ -149,6 +150,9 @@ T.ComboBox {
id: floatingComponent
P.ButtonPanel {
button: comboBox
color1: control.flat ? DS.Style.comboBox.flatBackground : DS.Style.button.background1
outsideBorderColor: control.flat ? null : DS.Style.button.outsideBorder
visible: !control.flat || control.D.ColorSelector.controlState === D.DTK.PressedState || control.D.ColorSelector.controlState === D.DTK.HoveredState
}
}
}
Expand Down
23 changes: 22 additions & 1 deletion qt6/src/qml/FlowStyle.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

Expand Down Expand Up @@ -429,6 +429,27 @@ QtObject {
normal: Qt.rgba(0, 0, 0, 0.05)
}
}

property D.Palette flatBackground: D.Palette {
normal {
common: Qt.rgba(0, 0, 0, 0.1)
}
normalDark {
common: Qt.rgba(1, 1, 1, 0.1)
}
hovered {
common: Qt.rgba(0, 0, 0, 0.1)
}
hoveredDark {
common: (Qt.rgba(0.08, 0.08, 0.08, 0.2))
}
pressed {
common: Qt.rgba(0, 0, 0, 0.2)
}
pressedDark {
common: Qt.rgba(0, 0, 0, 0.15)
}
}
}

// Edit
Expand Down