diff --git a/THIRD_PARTY_COPYRIGHT.txt b/THIRD_PARTY_COPYRIGHT.txt index e7b2da58..75557839 100644 --- a/THIRD_PARTY_COPYRIGHT.txt +++ b/THIRD_PARTY_COPYRIGHT.txt @@ -281,6 +281,31 @@ furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +************************************************************************************ +qml-colorpicker + +MIT License + +Copyright (c) 2022 Ruslan Shestopalyuk + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/example/qml-Qt6/page/T_Http.qml b/example/qml-Qt6/page/T_Http.qml index 3402cbf5..6e7b2b1c 100644 --- a/example/qml-Qt6/page/T_Http.qml +++ b/example/qml-Qt6/page/T_Http.qml @@ -11,6 +11,7 @@ FluContentPage{ title:"Http" property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http" + property bool isDownCompleted: false FluHttp{ id:http @@ -171,6 +172,10 @@ FluContentPage{ } onSuccess: (result)=>{ + if(!isDownCompleted){ + tour.open() + isDownCompleted = true + } showSuccess(result) } onDownloadProgress: @@ -281,6 +286,13 @@ FluContentPage{ } } + FluTour{ + id:tour + steps:[ + {title:"友情提示",description: "下载已完成,左击这里可以打开文件所在路径,右击可以弹出菜单删除文件!",target:()=>btn_breakpoint_download} + ] + } + HttpCallable{ id:callable_upload onStart: { diff --git a/example/qml/page/T_Http.qml b/example/qml/page/T_Http.qml index 31430c7b..c2b0fc00 100644 --- a/example/qml/page/T_Http.qml +++ b/example/qml/page/T_Http.qml @@ -12,6 +12,7 @@ FluContentPage{ title:"Http" property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http" + property bool isDownCompleted: false FluHttp{ id:http @@ -172,6 +173,10 @@ FluContentPage{ } onSuccess: (result)=>{ + if(!isDownCompleted){ + tour.open() + isDownCompleted = true + } showSuccess(result) } onDownloadProgress: @@ -282,6 +287,13 @@ FluContentPage{ } } + FluTour{ + id:tour + steps:[ + {title:"友情提示",description: "下载已完成,左击这里可以打开文件所在路径,右击可以弹出菜单删除文件!",target:()=>btn_breakpoint_download} + ] + } + HttpCallable{ id:callable_upload onStart: { diff --git a/src/FluCaptcha.cpp b/src/FluCaptcha.cpp index a728323e..9910802a 100644 --- a/src/FluCaptcha.cpp +++ b/src/FluCaptcha.cpp @@ -8,7 +8,10 @@ FluCaptcha::FluCaptcha(QQuickItem *parent) : QQuickPaintedItem(parent) { - font(QFont("楷体",25,QFont::Bold,true)); + QFont fontStype; + fontStype.setPixelSize(28); + fontStype.setBold(true); + font(fontStype); setWidth(180); setHeight(80); refresh(); diff --git a/src/Qt5/imports/FluentUI/Controls/FluChart.qml b/src/Qt5/imports/FluentUI/Controls/FluChart.qml index 7d15aa0b..5fb0a410 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluChart.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluChart.qml @@ -10,7 +10,7 @@ Canvas { property var chartOptions property double chartAnimationProgress: 0.1 property int animationEasingType: Easing.InOutExpo - property double animationDuration: 500 + property double animationDuration: 0 property var memorizedContext property var memorizedData property var memorizedOptions @@ -22,6 +22,7 @@ Canvas { jsChart.update(); chartAnimator.restart(); } + opacity: MouseArea { id: event anchors.fill: control diff --git a/src/Qt5/imports/FluentUI/Controls/FluScrollBar.qml b/src/Qt5/imports/FluentUI/Controls/FluScrollBar.qml index 92766a32..292a8232 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluScrollBar.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluScrollBar.qml @@ -13,18 +13,115 @@ T.ScrollBar { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - padding: 2 visible: control.policy !== T.ScrollBar.AlwaysOff minimumSize: Math.max(orientation === Qt.Horizontal ? height / width : width / height,0.3) + QtObject{ + id:d + property int minLine : 2 + property int maxLine : 6 + } + verticalPadding : vertical ? 15 : 2 + horizontalPadding : horizontal ? 15 : 2 + background: Rectangle{ + id:back_rect + radius: 5 + color:FluTheme.dark ? Qt.rgba(44/255,44/255,44/255,1) : Qt.rgba(255/255,255/255,255/255,1) + opacity:{ + if(vertical){ + return d.maxLine === Number(rect_bar.width) + } + return d.maxLine === Number(rect_bar.height) + } + Behavior on opacity { + NumberAnimation{ + duration: 167 + } + } + } + FluIconButton{ + width: 10 + height: 10 + iconSize: 6 + verticalPadding: 0 + horizontalPadding: 0 + visible: control.horizontal + opacity: back_rect.opacity + anchors{ + left: parent.left + leftMargin: 4 + verticalCenter: parent.verticalCenter + } + iconColor: control.color + iconSource: FluentIcons.CaretLeftSolid8 + onClicked: { + control.decrease() + } + } + FluIconButton{ + width: 10 + height: 10 + iconSize: 6 + verticalPadding: 0 + horizontalPadding: 0 + iconColor: control.color + opacity: back_rect.opacity + anchors{ + right: parent.right + rightMargin: 4 + verticalCenter: parent.verticalCenter + } + visible: control.horizontal + iconSource: FluentIcons.CaretRightSolid8 + onClicked: { + control.increase() + } + } + FluIconButton{ + width: 10 + height: 10 + iconSize: 6 + verticalPadding: 0 + horizontalPadding: 0 + iconColor: control.color + opacity: back_rect.opacity + anchors{ + top: parent.top + topMargin: 4 + horizontalCenter: parent.horizontalCenter + } + visible: control.vertical + iconSource: FluentIcons.CaretUpSolid8 + onClicked: { + control.decrease() + } + } + FluIconButton{ + width: 10 + height: 10 + iconSize: 6 + verticalPadding: 0 + horizontalPadding: 0 + iconColor: control.color + opacity: back_rect.opacity + anchors{ + bottom: parent.bottom + bottomMargin: 4 + horizontalCenter: parent.horizontalCenter + } + visible: control.vertical + iconSource: FluentIcons.CaretDownSolid8 + onClicked: { + control.increase() + } + } contentItem: Item { property bool collapsed: (control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)) - implicitWidth: control.interactive ? 6 : 2 - implicitHeight: control.interactive ? 6 : 2 - + implicitWidth: control.interactive ? d.maxLine : d.minLine + implicitHeight: control.interactive ? d.maxLine : d.minLine Rectangle{ id:rect_bar - width: vertical ? 2 : parent.width - height: horizontal ? 2 : parent.height + width: vertical ? d.minLine : parent.width + height: horizontal ? d.minLine : parent.height color:{ if(control.pressed){ return control.pressedColor @@ -44,8 +141,8 @@ T.ScrollBar { when: contentItem.collapsed PropertyChanges { target: rect_bar - width: vertical ? 6 : parent.width - height: horizontal ? 6 : parent.height + width: vertical ? d.maxLine : parent.width + height: horizontal ? d.maxLine : parent.height } } ,State{ @@ -53,8 +150,8 @@ T.ScrollBar { when: !contentItem.collapsed PropertyChanges { target: rect_bar - width: vertical ? 2 : parent.width - height: horizontal ? 2 : parent.height + width: vertical ? d.minLine : parent.width + height: horizontal ? d.minLine : parent.height } } ] @@ -73,11 +170,14 @@ T.ScrollBar { } ,Transition { to: "show" - NumberAnimation { - target: rect_bar - properties: vertical ? "width" : "height" - duration: 167 - easing.type: Easing.OutCubic + SequentialAnimation { + PauseAnimation { duration: 450 } + NumberAnimation { + target: rect_bar + properties: vertical ? "width" : "height" + duration: 167 + easing.type: Easing.OutCubic + } } } ] diff --git a/src/Qt5/imports/FluentUI/Controls/FluTextBoxMenu.qml b/src/Qt5/imports/FluentUI/Controls/FluTextBoxMenu.qml index 54fa9902..eb5d5a48 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTextBoxMenu.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTextBoxMenu.qml @@ -31,7 +31,7 @@ FluMenu{ text:cutText focus: false padding: 0 - height: visible ? 34 : 0 + height: visible ? 36 : 0 visible: inputItem.selectedText !== "" && !inputItem.readOnly onClicked: { inputItem.cut() @@ -43,7 +43,7 @@ FluMenu{ text:copyText focus: false padding: 0 - height: visible ? 34 : 0 + height: visible ? 36 : 0 visible: inputItem.selectedText !== "" onClicked: { inputItem.copy() @@ -55,8 +55,7 @@ FluMenu{ text:pasteText focus: false padding: 0 - height: visible ? 34 : 0 - visible: inputItem.canPaste + height: visible ? 36 : 0 onClicked: { inputItem.paste() menu.close() @@ -67,7 +66,7 @@ FluMenu{ text:selectAllText focus: false padding: 0 - height: visible ? 34 : 0 + height: visible ? 36 : 0 visible: inputItem.text !== "" onClicked: { inputItem.selectAll() diff --git a/src/Qt6/imports/FluentUI/Controls/FluChart.qml b/src/Qt6/imports/FluentUI/Controls/FluChart.qml index 785f00ba..7dbae7fb 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluChart.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluChart.qml @@ -10,7 +10,7 @@ Canvas { property var chartOptions property double chartAnimationProgress: 0.1 property int animationEasingType: Easing.InOutExpo - property double animationDuration: 500 + property double animationDuration: 0 property var memorizedContext property var memorizedData property var memorizedOptions diff --git a/src/Qt6/imports/FluentUI/Controls/FluScrollBar.qml b/src/Qt6/imports/FluentUI/Controls/FluScrollBar.qml index 1c088693..1dc079d3 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluScrollBar.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluScrollBar.qml @@ -14,18 +14,115 @@ T.ScrollBar { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - padding: 2 visible: control.policy !== T.ScrollBar.AlwaysOff minimumSize: Math.max(orientation === Qt.Horizontal ? height / width : width / height,0.3) + QtObject{ + id:d + property int minLine : 2 + property int maxLine : 6 + } + verticalPadding : vertical ? 15 : 2 + horizontalPadding : horizontal ? 15 : 2 + background: Rectangle{ + id:back_rect + radius: 5 + color:FluTheme.dark ? Qt.rgba(44/255,44/255,44/255,1) : Qt.rgba(255/255,255/255,255/255,1) + opacity:{ + if(vertical){ + return d.maxLine === Number(rect_bar.width) + } + return d.maxLine === Number(rect_bar.height) + } + Behavior on opacity { + NumberAnimation{ + duration: 167 + } + } + } + FluIconButton{ + width: 10 + height: 10 + iconSize: 6 + verticalPadding: 0 + horizontalPadding: 0 + visible: control.horizontal + opacity: back_rect.opacity + anchors{ + left: parent.left + leftMargin: 4 + verticalCenter: parent.verticalCenter + } + iconColor: control.color + iconSource: FluentIcons.CaretLeftSolid8 + onClicked: { + control.decrease() + } + } + FluIconButton{ + width: 10 + height: 10 + iconSize: 6 + verticalPadding: 0 + horizontalPadding: 0 + iconColor: control.color + opacity: back_rect.opacity + anchors{ + right: parent.right + rightMargin: 4 + verticalCenter: parent.verticalCenter + } + visible: control.horizontal + iconSource: FluentIcons.CaretRightSolid8 + onClicked: { + control.increase() + } + } + FluIconButton{ + width: 10 + height: 10 + iconSize: 6 + verticalPadding: 0 + horizontalPadding: 0 + iconColor: control.color + opacity: back_rect.opacity + anchors{ + top: parent.top + topMargin: 4 + horizontalCenter: parent.horizontalCenter + } + visible: control.vertical + iconSource: FluentIcons.CaretUpSolid8 + onClicked: { + control.decrease() + } + } + FluIconButton{ + width: 10 + height: 10 + iconSize: 6 + verticalPadding: 0 + horizontalPadding: 0 + iconColor: control.color + opacity: back_rect.opacity + anchors{ + bottom: parent.bottom + bottomMargin: 4 + horizontalCenter: parent.horizontalCenter + } + visible: control.vertical + iconSource: FluentIcons.CaretDownSolid8 + onClicked: { + control.increase() + } + } contentItem: Item { property bool collapsed: (control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)) - implicitWidth: control.interactive ? 6 : 2 - implicitHeight: control.interactive ? 6 : 2 - + implicitWidth: control.interactive ? d.maxLine : d.minLine + implicitHeight: control.interactive ? d.maxLine : d.minLine Rectangle{ id:rect_bar - width: vertical ? 2 : parent.width - height: horizontal ? 2 : parent.height + width: vertical ? d.minLine : parent.width + height: horizontal ? d.minLine : parent.height color:{ if(control.pressed){ return control.pressedColor @@ -45,8 +142,8 @@ T.ScrollBar { when: contentItem.collapsed PropertyChanges { target: rect_bar - width: vertical ? 6 : parent.width - height: horizontal ? 6 : parent.height + width: vertical ? d.maxLine : parent.width + height: horizontal ? d.maxLine : parent.height } } ,State{ @@ -54,8 +151,8 @@ T.ScrollBar { when: !contentItem.collapsed PropertyChanges { target: rect_bar - width: vertical ? 2 : parent.width - height: horizontal ? 2 : parent.height + width: vertical ? d.minLine : parent.width + height: horizontal ? d.minLine : parent.height } } ] @@ -74,11 +171,14 @@ T.ScrollBar { } ,Transition { to: "show" - NumberAnimation { - target: rect_bar - properties: vertical ? "width" : "height" - duration: 167 - easing.type: Easing.OutCubic + SequentialAnimation { + PauseAnimation { duration: 450 } + NumberAnimation { + target: rect_bar + properties: vertical ? "width" : "height" + duration: 167 + easing.type: Easing.OutCubic + } } } ] diff --git a/src/Qt6/imports/FluentUI/Controls/FluTextBoxMenu.qml b/src/Qt6/imports/FluentUI/Controls/FluTextBoxMenu.qml index 1e94b8b3..3277f258 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTextBoxMenu.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTextBoxMenu.qml @@ -31,7 +31,7 @@ FluMenu{ text:cutText focus: false padding: 0 - height: visible ? 34 : 0 + height: visible ? 36 : 0 visible: inputItem.selectedText !== "" && !inputItem.readOnly onClicked: { inputItem.cut() @@ -43,7 +43,7 @@ FluMenu{ text:copyText focus: false padding: 0 - height: visible ? 34 : 0 + height: visible ? 36 : 0 visible: inputItem.selectedText !== "" onClicked: { inputItem.copy() @@ -55,8 +55,7 @@ FluMenu{ text:pasteText focus: false padding: 0 - height: visible ? 34 : 0 - visible: inputItem.canPaste + height: visible ? 36 : 0 onClicked: { inputItem.paste() menu.close() @@ -67,7 +66,7 @@ FluMenu{ text:selectAllText focus: false padding: 0 - height: visible ? 34 : 0 + height: visible ? 36 : 0 visible: inputItem.text !== "" onClicked: { inputItem.selectAll()