mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-30 15:06:52 +08:00
update
This commit is contained in:
parent
0810572e27
commit
1ecc1bd569
@ -12,7 +12,7 @@ FluTextStyle::FluTextStyle(QObject *parent)
|
|||||||
Body(body);
|
Body(body);
|
||||||
|
|
||||||
QFont bodyStrong;
|
QFont bodyStrong;
|
||||||
bodyStrong.setPixelSize(14);
|
bodyStrong.setPixelSize(13);
|
||||||
bodyStrong.setBold(true);
|
bodyStrong.setBold(true);
|
||||||
BodyStrong(bodyStrong);
|
BodyStrong(bodyStrong);
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ FluPopup {
|
|||||||
property string neutralText: "Neutral"
|
property string neutralText: "Neutral"
|
||||||
property string negativeText: "Negative"
|
property string negativeText: "Negative"
|
||||||
property string positiveText: "Positive"
|
property string positiveText: "Positive"
|
||||||
|
property int delayTime: 100
|
||||||
signal neutralClicked
|
signal neutralClicked
|
||||||
signal negativeClicked
|
signal negativeClicked
|
||||||
signal positiveClicked
|
signal positiveClicked
|
||||||
@ -88,7 +89,8 @@ FluPopup {
|
|||||||
text: neutralText
|
text: neutralText
|
||||||
onClicked: {
|
onClicked: {
|
||||||
popup.close()
|
popup.close()
|
||||||
neutralClicked()
|
timer_delay.targetFlags = FluContentDialog.NeutralButton
|
||||||
|
timer_delay.restart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluButton{
|
FluButton{
|
||||||
@ -99,7 +101,8 @@ FluPopup {
|
|||||||
text: negativeText
|
text: negativeText
|
||||||
onClicked: {
|
onClicked: {
|
||||||
popup.close()
|
popup.close()
|
||||||
negativeClicked()
|
timer_delay.targetFlags = FluContentDialog.NegativeButton
|
||||||
|
timer_delay.restart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluFilledButton{
|
FluFilledButton{
|
||||||
@ -110,10 +113,27 @@ FluPopup {
|
|||||||
text: positiveText
|
text: positiveText
|
||||||
onClicked: {
|
onClicked: {
|
||||||
popup.close()
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,5 @@ import QtQuick.Window
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
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)
|
||||||
}
|
}
|
||||||
|
@ -24,13 +24,15 @@ Item {
|
|||||||
property Component autoSuggestBox
|
property Component autoSuggestBox
|
||||||
property Component actionItem
|
property Component actionItem
|
||||||
property int topPadding: 0
|
property int topPadding: 0
|
||||||
|
property int navWidth: 300
|
||||||
property int pageMode: FluNavigationView.Stack
|
property int pageMode: FluNavigationView.Stack
|
||||||
signal logoClicked
|
signal logoClicked
|
||||||
id:control
|
id:control
|
||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
|
property bool animDisabled:false
|
||||||
property var stackItems: []
|
property var stackItems: []
|
||||||
property int displayMode: FluNavigationView.Open
|
property int displayMode: control.displayMode
|
||||||
property bool enableNavigationPanel: false
|
property bool enableNavigationPanel: false
|
||||||
property bool isCompact: d.displayMode === FluNavigationView.Compact
|
property bool isCompact: d.displayMode === FluNavigationView.Compact
|
||||||
property bool isMinimal: d.displayMode === FluNavigationView.Minimal
|
property bool isMinimal: d.displayMode === FluNavigationView.Minimal
|
||||||
@ -88,6 +90,14 @@ Item {
|
|||||||
return FluNavigationView.Open
|
return FluNavigationView.Open
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
timer_anim_delay.restart()
|
||||||
|
}
|
||||||
|
Timer{
|
||||||
|
id:timer_anim_delay
|
||||||
|
interval: 200
|
||||||
|
onTriggered: {
|
||||||
|
d.animDisabled = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Connections{
|
Connections{
|
||||||
target: d
|
target: d
|
||||||
@ -128,7 +138,7 @@ Item {
|
|||||||
return 30
|
return 30
|
||||||
}
|
}
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
enabled: FluTheme.enableAnimation
|
enabled: FluTheme.enableAnimation && d.animDisabled
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 83
|
duration: 83
|
||||||
}
|
}
|
||||||
@ -233,7 +243,7 @@ Item {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
Behavior on rotation {
|
Behavior on rotation {
|
||||||
enabled: FluTheme.enableAnimation
|
enabled: FluTheme.enableAnimation && d.animDisabled
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 167
|
duration: 167
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
@ -320,7 +330,7 @@ Item {
|
|||||||
id:com_panel_item
|
id:com_panel_item
|
||||||
Item{
|
Item{
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
enabled: FluTheme.enableAnimation
|
enabled: FluTheme.enableAnimation && d.animDisabled
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 83
|
duration: 83
|
||||||
}
|
}
|
||||||
@ -560,13 +570,13 @@ Item {
|
|||||||
visible: opacity
|
visible: opacity
|
||||||
opacity: d.isMinimal
|
opacity: d.isMinimal
|
||||||
Behavior on opacity{
|
Behavior on opacity{
|
||||||
enabled: FluTheme.enableAnimation
|
enabled: FluTheme.enableAnimation && d.animDisabled
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 83
|
duration: 83
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on Layout.preferredWidth {
|
Behavior on Layout.preferredWidth {
|
||||||
enabled: FluTheme.enableAnimation
|
enabled: FluTheme.enableAnimation && d.animDisabled
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 167
|
duration: 167
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
@ -661,11 +671,11 @@ Item {
|
|||||||
if(d.isCompact){
|
if(d.isCompact){
|
||||||
return 50
|
return 50
|
||||||
}
|
}
|
||||||
return 300
|
return control.navWidth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on anchors.leftMargin {
|
Behavior on anchors.leftMargin {
|
||||||
enabled: FluTheme.enableAnimation
|
enabled: FluTheme.enableAnimation && d.animDisabled
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 167
|
duration: 167
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
@ -688,7 +698,7 @@ Item {
|
|||||||
if(d.isCompactAndNotPanel){
|
if(d.isCompactAndNotPanel){
|
||||||
return 50
|
return 50
|
||||||
}
|
}
|
||||||
return 300
|
return control.navWidth
|
||||||
}
|
}
|
||||||
anchors{
|
anchors{
|
||||||
top: parent.top
|
top: parent.top
|
||||||
@ -704,14 +714,14 @@ Item {
|
|||||||
}
|
}
|
||||||
x: visible ? 0 : -width
|
x: visible ? 0 : -width
|
||||||
Behavior on width {
|
Behavior on width {
|
||||||
enabled: FluTheme.enableAnimation
|
enabled: FluTheme.enableAnimation && d.animDisabled
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 167
|
duration: 167
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on x {
|
Behavior on x {
|
||||||
enabled: FluTheme.enableAnimation
|
enabled: FluTheme.enableAnimation && d.animDisabled
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 167
|
duration: 167
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
@ -793,7 +803,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
model:d.handleItems()
|
model:d.handleItems()
|
||||||
boundsBehavior: ListView.StopAtBounds
|
boundsBehavior: ListView.StopAtBounds
|
||||||
highlightMoveDuration: FluTheme.enableAnimation ? 167 : 0
|
highlightMoveDuration: FluTheme.enableAnimation && d.animDisabled ? 167 : 0
|
||||||
highlight: Item{
|
highlight: Item{
|
||||||
clip: true
|
clip: true
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
Loading…
Reference in New Issue
Block a user