This commit is contained in:
zhuzichu 2023-07-14 18:18:46 +08:00 committed by Mentalflow
parent 3fc2e95dc2
commit 97be72a6b2
Signed by untrusted user: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
4 changed files with 47 additions and 17 deletions

View File

@ -21,7 +21,7 @@ FluTextStyle::FluTextStyle(QObject *parent)
Body(body);
QFont bodyStrong;
bodyStrong.setPixelSize(14);
bodyStrong.setPixelSize(13);
bodyStrong.setBold(true);
BodyStrong(bodyStrong);

View File

@ -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()
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()
}
}
}
}
}
}

View File

@ -3,5 +3,5 @@ import QtQuick.Window 2.15
import FluentUI 1.0
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)
}

View File

@ -23,13 +23,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
@ -87,6 +89,14 @@ Item {
return FluNavigationView.Open
}
})
timer_anim_delay.restart()
}
Timer{
id:timer_anim_delay
interval: 200
onTriggered: {
d.animDisabled = true
}
}
Connections{
target: d
@ -127,7 +137,7 @@ Item {
return 30
}
Behavior on height {
enabled: FluTheme.enableAnimation
enabled: FluTheme.enableAnimation && d.animDisabled
NumberAnimation{
duration: 83
}
@ -232,7 +242,7 @@ Item {
return true
}
Behavior on rotation {
enabled: FluTheme.enableAnimation
enabled: FluTheme.enableAnimation && d.animDisabled
NumberAnimation{
duration: 167
easing.type: Easing.OutCubic
@ -319,7 +329,7 @@ Item {
id:com_panel_item
Item{
Behavior on height {
enabled: FluTheme.enableAnimation
enabled: FluTheme.enableAnimation && d.animDisabled
NumberAnimation{
duration: 83
}
@ -559,13 +569,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
@ -665,11 +675,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
@ -692,7 +702,7 @@ Item {
if(d.isCompactAndNotPanel){
return 50
}
return 300
return control.navWidth
}
anchors{
top: parent.top
@ -708,14 +718,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
@ -797,7 +807,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{