From 7489a4bcbe7d5487176d37c7d616d7f2eec94c25 Mon Sep 17 00:00:00 2001 From: zhuzihcu Date: Wed, 19 Apr 2023 18:04:14 +0800 Subject: [PATCH] update --- example/T_TableView.qml | 15 +++++++-------- src/FluTheme.cpp | 11 +---------- src/controls/FluExpander.qml | 2 +- src/controls/FluNavigationView.qml | 16 ++++++++-------- src/controls/FluProgressRing.qml | 16 +++------------- src/controls/FluToggleSwitch.qml | 8 ++++---- 6 files changed, 24 insertions(+), 44 deletions(-) diff --git a/example/T_TableView.qml b/example/T_TableView.qml index b719f93..a4c29ed 100644 --- a/example/T_TableView.qml +++ b/example/T_TableView.qml @@ -110,7 +110,6 @@ FluScrollablePage{ id:table_view Layout.fillWidth: true Layout.topMargin: 20 - width:parent.width pageCurrent:1 pageCount:10 itemCount: 1000 @@ -141,15 +140,15 @@ FluScrollablePage{ width:100 } ]; - table_view.columns = columns + table_view.columns = columns const dataSource = [ - { - name: "孙悟空”, - age: 500, - address:"钟灵毓秀的花果山,如神仙仙境的水帘洞", + { + name: "孙悟空”, + age: 500, + address:"钟灵毓秀的花果山,如神仙仙境的水帘洞", nickname:"齐天大圣" - } - ]; + } + ]; table_view.dataSource = columns } }' diff --git a/src/FluTheme.cpp b/src/FluTheme.cpp index e1f08dd..d3d7bf1 100644 --- a/src/FluTheme.cpp +++ b/src/FluTheme.cpp @@ -19,15 +19,6 @@ FluTheme::FluTheme(QObject *parent) { primaryColor(FluColors::getInstance()->Blue()); textSize(13); - nativeText(true); + nativeText(false); frameless(true); - std::function isDark = [](){ - QPalette palette = (qobject_cast(QCoreApplication::instance()))->palette(); - QColor color = palette.color(QPalette::Window).rgb(); - return !(color.red() * 0.2126 + color.green() * 0.7152 + color.blue() * 0.0722 > 255 / 2); - }; - dark(isDark()); - connect(qobject_cast(QCoreApplication::instance()), &QGuiApplication::paletteChanged, this, [=] (const QPalette &) { - dark(isDark()); - }); } diff --git a/src/controls/FluExpander.qml b/src/controls/FluExpander.qml index f8350cb..3cf16dc 100644 --- a/src/controls/FluExpander.qml +++ b/src/controls/FluExpander.qml @@ -86,7 +86,7 @@ Item { Behavior on height { NumberAnimation{ duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: expand ? [ 0, 0, 0, 1 ] : [ 1, 0, 0, 0 ] } } diff --git a/src/controls/FluNavigationView.qml b/src/controls/FluNavigationView.qml index ca9d1e6..7cf23a1 100644 --- a/src/controls/FluNavigationView.qml +++ b/src/controls/FluNavigationView.qml @@ -121,7 +121,7 @@ Item { Behavior on height { NumberAnimation{ duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 0, 0, 0, 1 ] } } @@ -140,7 +140,7 @@ Item { Behavior on height { NumberAnimation{ duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 0, 0, 0, 1 ] } } @@ -318,7 +318,7 @@ Item { Behavior on height { NumberAnimation{ duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 0, 0, 0, 1 ] } } @@ -511,7 +511,7 @@ Item { Behavior on Layout.preferredWidth{ NumberAnimation{ duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 0, 0, 0, 1 ] } } @@ -557,7 +557,7 @@ Item { from: 0 to: nav_swipe.height duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 1, 0, 0, 0 ] } } @@ -567,7 +567,7 @@ Item { from: nav_swipe.height; to: 0 duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 0, 0, 0, 1 ] } } @@ -596,7 +596,7 @@ Item { Behavior on width{ NumberAnimation{ duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 0, 0, 0, 1 ] } } @@ -604,7 +604,7 @@ Item { id:anim_layout_list_x NumberAnimation{ duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 0, 0, 0, 1 ] } } diff --git a/src/controls/FluProgressRing.qml b/src/controls/FluProgressRing.qml index f1d3c80..5b7bfdd 100644 --- a/src/controls/FluProgressRing.qml +++ b/src/controls/FluProgressRing.qml @@ -39,7 +39,9 @@ Rectangle { id:behavior enabled: false NumberAnimation{ - duration: 1000 + duration: 999 + easing.type: Easing.BezierSpline + easing.bezierCurve: [0.55,0.55,0,1] onRunningChanged: { if(!running){ behavior.enabled = false @@ -68,18 +70,6 @@ Rectangle { ctx.arc(width/2, height/2, radius2 ,-0.5 * Math.PI,-0.5 * Math.PI + progress * 2 * Math.PI); ctx.stroke(); ctx.closePath(); - // var start_x = width/2 + Math.cos(-0.5 * Math.PI) * radius2; - // var start_y = height/2 + Math.sin(-0.5 * Math.PI) * radius2; - // ctx.beginPath(); - // ctx.arc(start_x, start_y, 3, 0, 2*Math.PI); - // ctx.fill(); - // ctx.closePath(); - // var end_x = width/2 + Math.cos(-0.5 * Math.PI + progress * 2 * Math.PI) * radius2; - // var end_y = height/2 + Math.sin(-0.5 * Math.PI + progress * 2 * Math.PI) * radius2; - // ctx.beginPath(); - // ctx.arc(end_x, end_y, 3, 0, 2*Math.PI); - // ctx.fill(); - // ctx.closePath(); ctx.restore(); } } diff --git a/src/controls/FluToggleSwitch.qml b/src/controls/FluToggleSwitch.qml index b429b5d..9ab67bc 100644 --- a/src/controls/FluToggleSwitch.qml +++ b/src/controls/FluToggleSwitch.qml @@ -72,28 +72,28 @@ FluControl { Behavior on anchors.leftMargin { NumberAnimation { duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 1, 0, 0, 0 ] } } Behavior on anchors.rightMargin { NumberAnimation { duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 1, 0, 0, 0 ] } } Behavior on width { NumberAnimation { duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 1, 0, 0, 0 ] } } Behavior on scale { NumberAnimation { duration: 167 - easing.type: Easing.Bezier + easing.type: Easing.BezierSpline easing.bezierCurve: [ 1, 0, 0, 0 ] } }