From 7a1776407f72eb2fda567ab3e8a53b5687208da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Sat, 23 Sep 2023 15:55:29 +0800 Subject: [PATCH] update --- example/qml-Qt6/page/T_ComboBox.qml | 1 - example/qml/page/T_ComboBox.qml | 1 - .../imports/FluentUI/Controls/FluComboBox.qml | 3 ++- .../FluentUI/Controls/FluItemDelegate.qml | 22 +++++++++---------- .../imports/FluentUI/Controls/FluComboBox.qml | 3 ++- .../FluentUI/Controls/FluItemDelegate.qml | 22 +++++++++---------- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/example/qml-Qt6/page/T_ComboBox.qml b/example/qml-Qt6/page/T_ComboBox.qml index 15fba70b..d8b1f448 100644 --- a/example/qml-Qt6/page/T_ComboBox.qml +++ b/example/qml-Qt6/page/T_ComboBox.qml @@ -46,7 +46,6 @@ FluScrollablePage{ } FluComboBox { editable: true - font:FluTextStyle.BodyStrong model: ListModel { id: model_2 ListElement { text: "Banana" } diff --git a/example/qml/page/T_ComboBox.qml b/example/qml/page/T_ComboBox.qml index cec95740..80ad7fcd 100644 --- a/example/qml/page/T_ComboBox.qml +++ b/example/qml/page/T_ComboBox.qml @@ -47,7 +47,6 @@ FluScrollablePage{ } FluComboBox { editable: true - font:FluTextStyle.BodyStrong model: ListModel { id: model_2 ListElement { text: "Banana" } diff --git a/src/Qt5/imports/FluentUI/Controls/FluComboBox.qml b/src/Qt5/imports/FluentUI/Controls/FluComboBox.qml index 55a76f97..c7c3dc72 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluComboBox.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluComboBox.qml @@ -4,7 +4,7 @@ import QtQuick.Window 2.15 import FluentUI 1.0 import QtQuick.Templates 2.15 as T -ComboBox { +T.ComboBox { id: control signal commit(string text) property bool disabled: false @@ -72,6 +72,7 @@ ComboBox { Keys.onReturnPressed:(event)=> handleCommit(event) function handleCommit(event){ control.commit(control.editText) + accepted() } } diff --git a/src/Qt5/imports/FluentUI/Controls/FluItemDelegate.qml b/src/Qt5/imports/FluentUI/Controls/FluItemDelegate.qml index a852c591..bb2c4a36 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluItemDelegate.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluItemDelegate.qml @@ -4,28 +4,28 @@ import FluentUI 1.0 T.ItemDelegate { id: control - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding, implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 12 - spacing: 8 - - icon.width: 24 - icon.height: 24 + padding: 0 + verticalPadding: 8 + horizontalPadding: 10 icon.color: control.palette.text - - contentItem: FluText { + contentItem:FluText { text: control.text font: control.font + color:{ + if(control.down){ + return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120 + } + return FluTheme.dark ? FluColors.White : FluColors.Grey220 + } } - background: Rectangle { implicitWidth: 100 - implicitHeight: 40 + implicitHeight: 30 color:{ if(FluTheme.dark){ return Qt.rgba(1,1,1,0.05) diff --git a/src/Qt6/imports/FluentUI/Controls/FluComboBox.qml b/src/Qt6/imports/FluentUI/Controls/FluComboBox.qml index e8430d02..12b970e6 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluComboBox.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluComboBox.qml @@ -4,7 +4,7 @@ import QtQuick.Controls.Basic import FluentUI import QtQuick.Templates as T -ComboBox { +T.ComboBox { id: control signal commit(string text) property bool disabled: false @@ -72,6 +72,7 @@ ComboBox { Keys.onReturnPressed:(event)=> handleCommit(event) function handleCommit(event){ control.commit(control.editText) + accepted() } } diff --git a/src/Qt6/imports/FluentUI/Controls/FluItemDelegate.qml b/src/Qt6/imports/FluentUI/Controls/FluItemDelegate.qml index 7536d2df..265bc3cc 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluItemDelegate.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluItemDelegate.qml @@ -5,28 +5,28 @@ import FluentUI T.ItemDelegate { id: control - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding, implicitIndicatorHeight + topPadding + bottomPadding) - - padding: 12 - spacing: 8 - - icon.width: 24 - icon.height: 24 + padding: 0 + verticalPadding: 8 + horizontalPadding: 10 icon.color: control.palette.text - - contentItem: FluText { + contentItem:FluText { text: control.text font: control.font + color:{ + if(control.down){ + return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120 + } + return FluTheme.dark ? FluColors.White : FluColors.Grey220 + } } - background: Rectangle { implicitWidth: 100 - implicitHeight: 40 + implicitHeight: 30 color:{ if(FluTheme.dark){ return Qt.rgba(1,1,1,0.05)