From 1ecc1bd569953143ad82442b07b9429064afd90f Mon Sep 17 00:00:00 2001 From: zhuzichu Date: Fri, 14 Jul 2023 18:18:46 +0800 Subject: [PATCH] update --- src/FluTextStyle.cpp | 2 +- .../FluentUI/Controls/FluContentDialog.qml | 26 ++++++++++++-- src/imports/FluentUI/Controls/FluDivider.qml | 2 +- .../FluentUI/Controls/FluNavigationView.qml | 34 ++++++++++++------- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/src/FluTextStyle.cpp b/src/FluTextStyle.cpp index 887f0b11..4c6a153f 100644 --- a/src/FluTextStyle.cpp +++ b/src/FluTextStyle.cpp @@ -12,7 +12,7 @@ FluTextStyle::FluTextStyle(QObject *parent) Body(body); QFont bodyStrong; - bodyStrong.setPixelSize(14); + bodyStrong.setPixelSize(13); bodyStrong.setBold(true); BodyStrong(bodyStrong); diff --git a/src/imports/FluentUI/Controls/FluContentDialog.qml b/src/imports/FluentUI/Controls/FluContentDialog.qml index 384bdb6d..46b50694 100644 --- a/src/imports/FluentUI/Controls/FluContentDialog.qml +++ b/src/imports/FluentUI/Controls/FluContentDialog.qml @@ -11,6 +11,7 @@ FluPopup { property string neutralText: "Neutral" property string negativeText: "Negative" property string positiveText: "Positive" + property int delayTime: 100 signal neutralClicked signal negativeClicked signal positiveClicked @@ -88,7 +89,8 @@ FluPopup { text: neutralText onClicked: { popup.close() - neutralClicked() + timer_delay.targetFlags = FluContentDialog.NeutralButton + timer_delay.restart() } } FluButton{ @@ -99,7 +101,8 @@ FluPopup { text: negativeText onClicked: { popup.close() - negativeClicked() + timer_delay.targetFlags = FluContentDialog.NegativeButton + timer_delay.restart() } } FluFilledButton{ @@ -110,10 +113,27 @@ FluPopup { text: positiveText onClicked: { popup.close() - positiveClicked() + timer_delay.targetFlags = FluContentDialog.PositiveButton + timer_delay.restart() } } } } } + Timer{ + property int targetFlags + id:timer_delay + interval: popup.delayTime + onTriggered: { + if(targetFlags === FluContentDialog.NegativeButton){ + negativeClicked() + } + if(targetFlags === FluContentDialog.NeutralButton){ + neutralClicked() + } + if(targetFlags === FluContentDialog.PositiveButton){ + positiveClicked() + } + } + } } diff --git a/src/imports/FluentUI/Controls/FluDivider.qml b/src/imports/FluentUI/Controls/FluDivider.qml index 9e0991f3..949eefd2 100644 --- a/src/imports/FluentUI/Controls/FluDivider.qml +++ b/src/imports/FluentUI/Controls/FluDivider.qml @@ -3,5 +3,5 @@ import QtQuick.Window import FluentUI Rectangle { - color: FluTheme.dark ? Qt.rgba(60/255,60/255,60/255,1) : Qt.rgba(210/255,210/255,210/255,1) + color: FluTheme.dark ? Qt.rgba(80/255,80/255,80/255,1) : Qt.rgba(210/255,210/255,210/255,1) } diff --git a/src/imports/FluentUI/Controls/FluNavigationView.qml b/src/imports/FluentUI/Controls/FluNavigationView.qml index 1c98a0ae..4482c483 100644 --- a/src/imports/FluentUI/Controls/FluNavigationView.qml +++ b/src/imports/FluentUI/Controls/FluNavigationView.qml @@ -24,13 +24,15 @@ Item { property Component autoSuggestBox property Component actionItem property int topPadding: 0 + property int navWidth: 300 property int pageMode: FluNavigationView.Stack signal logoClicked id:control QtObject{ id:d + property bool animDisabled:false property var stackItems: [] - property int displayMode: FluNavigationView.Open + property int displayMode: control.displayMode property bool enableNavigationPanel: false property bool isCompact: d.displayMode === FluNavigationView.Compact property bool isMinimal: d.displayMode === FluNavigationView.Minimal @@ -88,6 +90,14 @@ Item { return FluNavigationView.Open } }) + timer_anim_delay.restart() + } + Timer{ + id:timer_anim_delay + interval: 200 + onTriggered: { + d.animDisabled = true + } } Connections{ target: d @@ -128,7 +138,7 @@ Item { return 30 } Behavior on height { - enabled: FluTheme.enableAnimation + enabled: FluTheme.enableAnimation && d.animDisabled NumberAnimation{ duration: 83 } @@ -233,7 +243,7 @@ Item { return true } Behavior on rotation { - enabled: FluTheme.enableAnimation + enabled: FluTheme.enableAnimation && d.animDisabled NumberAnimation{ duration: 167 easing.type: Easing.OutCubic @@ -320,7 +330,7 @@ Item { id:com_panel_item Item{ Behavior on height { - enabled: FluTheme.enableAnimation + enabled: FluTheme.enableAnimation && d.animDisabled NumberAnimation{ duration: 83 } @@ -560,13 +570,13 @@ Item { visible: opacity opacity: d.isMinimal Behavior on opacity{ - enabled: FluTheme.enableAnimation + enabled: FluTheme.enableAnimation && d.animDisabled NumberAnimation{ duration: 83 } } Behavior on Layout.preferredWidth { - enabled: FluTheme.enableAnimation + enabled: FluTheme.enableAnimation && d.animDisabled NumberAnimation{ duration: 167 easing.type: Easing.OutCubic @@ -661,11 +671,11 @@ Item { if(d.isCompact){ return 50 } - return 300 + return control.navWidth } } Behavior on anchors.leftMargin { - enabled: FluTheme.enableAnimation + enabled: FluTheme.enableAnimation && d.animDisabled NumberAnimation{ duration: 167 easing.type: Easing.OutCubic @@ -688,7 +698,7 @@ Item { if(d.isCompactAndNotPanel){ return 50 } - return 300 + return control.navWidth } anchors{ top: parent.top @@ -704,14 +714,14 @@ Item { } x: visible ? 0 : -width Behavior on width { - enabled: FluTheme.enableAnimation + enabled: FluTheme.enableAnimation && d.animDisabled NumberAnimation{ duration: 167 easing.type: Easing.OutCubic } } Behavior on x { - enabled: FluTheme.enableAnimation + enabled: FluTheme.enableAnimation && d.animDisabled NumberAnimation{ duration: 167 easing.type: Easing.OutCubic @@ -793,7 +803,7 @@ Item { anchors.fill: parent model:d.handleItems() boundsBehavior: ListView.StopAtBounds - highlightMoveDuration: FluTheme.enableAnimation ? 167 : 0 + highlightMoveDuration: FluTheme.enableAnimation && d.animDisabled ? 167 : 0 highlight: Item{ clip: true Rectangle{