This commit is contained in:
zhuzichu 2023-09-08 17:39:10 +08:00
parent e1292966c1
commit 752fe8cfba
10 changed files with 294 additions and 43 deletions

View File

@ -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 The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. 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 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

View File

@ -11,6 +11,7 @@ FluContentPage{
title:"Http" title:"Http"
property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http" property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http"
property bool isDownCompleted: false
FluHttp{ FluHttp{
id:http id:http
@ -171,6 +172,10 @@ FluContentPage{
} }
onSuccess: onSuccess:
(result)=>{ (result)=>{
if(!isDownCompleted){
tour.open()
isDownCompleted = true
}
showSuccess(result) showSuccess(result)
} }
onDownloadProgress: onDownloadProgress:
@ -281,6 +286,13 @@ FluContentPage{
} }
} }
FluTour{
id:tour
steps:[
{title:"友情提示",description: "下载已完成,左击这里可以打开文件所在路径,右击可以弹出菜单删除文件!",target:()=>btn_breakpoint_download}
]
}
HttpCallable{ HttpCallable{
id:callable_upload id:callable_upload
onStart: { onStart: {

View File

@ -12,6 +12,7 @@ FluContentPage{
title:"Http" title:"Http"
property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http" property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http"
property bool isDownCompleted: false
FluHttp{ FluHttp{
id:http id:http
@ -172,6 +173,10 @@ FluContentPage{
} }
onSuccess: onSuccess:
(result)=>{ (result)=>{
if(!isDownCompleted){
tour.open()
isDownCompleted = true
}
showSuccess(result) showSuccess(result)
} }
onDownloadProgress: onDownloadProgress:
@ -282,6 +287,13 @@ FluContentPage{
} }
} }
FluTour{
id:tour
steps:[
{title:"友情提示",description: "下载已完成,左击这里可以打开文件所在路径,右击可以弹出菜单删除文件!",target:()=>btn_breakpoint_download}
]
}
HttpCallable{ HttpCallable{
id:callable_upload id:callable_upload
onStart: { onStart: {

View File

@ -8,7 +8,10 @@
FluCaptcha::FluCaptcha(QQuickItem *parent) FluCaptcha::FluCaptcha(QQuickItem *parent)
: QQuickPaintedItem(parent) : QQuickPaintedItem(parent)
{ {
font(QFont("楷体",25,QFont::Bold,true)); QFont fontStype;
fontStype.setPixelSize(28);
fontStype.setBold(true);
font(fontStype);
setWidth(180); setWidth(180);
setHeight(80); setHeight(80);
refresh(); refresh();

View File

@ -10,7 +10,7 @@ Canvas {
property var chartOptions property var chartOptions
property double chartAnimationProgress: 0.1 property double chartAnimationProgress: 0.1
property int animationEasingType: Easing.InOutExpo property int animationEasingType: Easing.InOutExpo
property double animationDuration: 500 property double animationDuration: 0
property var memorizedContext property var memorizedContext
property var memorizedData property var memorizedData
property var memorizedOptions property var memorizedOptions
@ -22,6 +22,7 @@ Canvas {
jsChart.update(); jsChart.update();
chartAnimator.restart(); chartAnimator.restart();
} }
opacity:
MouseArea { MouseArea {
id: event id: event
anchors.fill: control anchors.fill: control

View File

@ -13,18 +13,115 @@ T.ScrollBar {
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding) implicitContentHeight + topPadding + bottomPadding)
padding: 2
visible: control.policy !== T.ScrollBar.AlwaysOff visible: control.policy !== T.ScrollBar.AlwaysOff
minimumSize: Math.max(orientation === Qt.Horizontal ? height / width : width / height,0.3) 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 { contentItem: Item {
property bool collapsed: (control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)) property bool collapsed: (control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0))
implicitWidth: control.interactive ? 6 : 2 implicitWidth: control.interactive ? d.maxLine : d.minLine
implicitHeight: control.interactive ? 6 : 2 implicitHeight: control.interactive ? d.maxLine : d.minLine
Rectangle{ Rectangle{
id:rect_bar id:rect_bar
width: vertical ? 2 : parent.width width: vertical ? d.minLine : parent.width
height: horizontal ? 2 : parent.height height: horizontal ? d.minLine : parent.height
color:{ color:{
if(control.pressed){ if(control.pressed){
return control.pressedColor return control.pressedColor
@ -44,8 +141,8 @@ T.ScrollBar {
when: contentItem.collapsed when: contentItem.collapsed
PropertyChanges { PropertyChanges {
target: rect_bar target: rect_bar
width: vertical ? 6 : parent.width width: vertical ? d.maxLine : parent.width
height: horizontal ? 6 : parent.height height: horizontal ? d.maxLine : parent.height
} }
} }
,State{ ,State{
@ -53,8 +150,8 @@ T.ScrollBar {
when: !contentItem.collapsed when: !contentItem.collapsed
PropertyChanges { PropertyChanges {
target: rect_bar target: rect_bar
width: vertical ? 2 : parent.width width: vertical ? d.minLine : parent.width
height: horizontal ? 2 : parent.height height: horizontal ? d.minLine : parent.height
} }
} }
] ]
@ -73,11 +170,14 @@ T.ScrollBar {
} }
,Transition { ,Transition {
to: "show" to: "show"
NumberAnimation { SequentialAnimation {
target: rect_bar PauseAnimation { duration: 450 }
properties: vertical ? "width" : "height" NumberAnimation {
duration: 167 target: rect_bar
easing.type: Easing.OutCubic properties: vertical ? "width" : "height"
duration: 167
easing.type: Easing.OutCubic
}
} }
} }
] ]

View File

@ -31,7 +31,7 @@ FluMenu{
text:cutText text:cutText
focus: false focus: false
padding: 0 padding: 0
height: visible ? 34 : 0 height: visible ? 36 : 0
visible: inputItem.selectedText !== "" && !inputItem.readOnly visible: inputItem.selectedText !== "" && !inputItem.readOnly
onClicked: { onClicked: {
inputItem.cut() inputItem.cut()
@ -43,7 +43,7 @@ FluMenu{
text:copyText text:copyText
focus: false focus: false
padding: 0 padding: 0
height: visible ? 34 : 0 height: visible ? 36 : 0
visible: inputItem.selectedText !== "" visible: inputItem.selectedText !== ""
onClicked: { onClicked: {
inputItem.copy() inputItem.copy()
@ -55,8 +55,7 @@ FluMenu{
text:pasteText text:pasteText
focus: false focus: false
padding: 0 padding: 0
height: visible ? 34 : 0 height: visible ? 36 : 0
visible: inputItem.canPaste
onClicked: { onClicked: {
inputItem.paste() inputItem.paste()
menu.close() menu.close()
@ -67,7 +66,7 @@ FluMenu{
text:selectAllText text:selectAllText
focus: false focus: false
padding: 0 padding: 0
height: visible ? 34 : 0 height: visible ? 36 : 0
visible: inputItem.text !== "" visible: inputItem.text !== ""
onClicked: { onClicked: {
inputItem.selectAll() inputItem.selectAll()

View File

@ -10,7 +10,7 @@ Canvas {
property var chartOptions property var chartOptions
property double chartAnimationProgress: 0.1 property double chartAnimationProgress: 0.1
property int animationEasingType: Easing.InOutExpo property int animationEasingType: Easing.InOutExpo
property double animationDuration: 500 property double animationDuration: 0
property var memorizedContext property var memorizedContext
property var memorizedData property var memorizedData
property var memorizedOptions property var memorizedOptions

View File

@ -14,18 +14,115 @@ T.ScrollBar {
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding) implicitContentHeight + topPadding + bottomPadding)
padding: 2
visible: control.policy !== T.ScrollBar.AlwaysOff visible: control.policy !== T.ScrollBar.AlwaysOff
minimumSize: Math.max(orientation === Qt.Horizontal ? height / width : width / height,0.3) 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 { contentItem: Item {
property bool collapsed: (control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)) property bool collapsed: (control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0))
implicitWidth: control.interactive ? 6 : 2 implicitWidth: control.interactive ? d.maxLine : d.minLine
implicitHeight: control.interactive ? 6 : 2 implicitHeight: control.interactive ? d.maxLine : d.minLine
Rectangle{ Rectangle{
id:rect_bar id:rect_bar
width: vertical ? 2 : parent.width width: vertical ? d.minLine : parent.width
height: horizontal ? 2 : parent.height height: horizontal ? d.minLine : parent.height
color:{ color:{
if(control.pressed){ if(control.pressed){
return control.pressedColor return control.pressedColor
@ -45,8 +142,8 @@ T.ScrollBar {
when: contentItem.collapsed when: contentItem.collapsed
PropertyChanges { PropertyChanges {
target: rect_bar target: rect_bar
width: vertical ? 6 : parent.width width: vertical ? d.maxLine : parent.width
height: horizontal ? 6 : parent.height height: horizontal ? d.maxLine : parent.height
} }
} }
,State{ ,State{
@ -54,8 +151,8 @@ T.ScrollBar {
when: !contentItem.collapsed when: !contentItem.collapsed
PropertyChanges { PropertyChanges {
target: rect_bar target: rect_bar
width: vertical ? 2 : parent.width width: vertical ? d.minLine : parent.width
height: horizontal ? 2 : parent.height height: horizontal ? d.minLine : parent.height
} }
} }
] ]
@ -74,11 +171,14 @@ T.ScrollBar {
} }
,Transition { ,Transition {
to: "show" to: "show"
NumberAnimation { SequentialAnimation {
target: rect_bar PauseAnimation { duration: 450 }
properties: vertical ? "width" : "height" NumberAnimation {
duration: 167 target: rect_bar
easing.type: Easing.OutCubic properties: vertical ? "width" : "height"
duration: 167
easing.type: Easing.OutCubic
}
} }
} }
] ]

View File

@ -31,7 +31,7 @@ FluMenu{
text:cutText text:cutText
focus: false focus: false
padding: 0 padding: 0
height: visible ? 34 : 0 height: visible ? 36 : 0
visible: inputItem.selectedText !== "" && !inputItem.readOnly visible: inputItem.selectedText !== "" && !inputItem.readOnly
onClicked: { onClicked: {
inputItem.cut() inputItem.cut()
@ -43,7 +43,7 @@ FluMenu{
text:copyText text:copyText
focus: false focus: false
padding: 0 padding: 0
height: visible ? 34 : 0 height: visible ? 36 : 0
visible: inputItem.selectedText !== "" visible: inputItem.selectedText !== ""
onClicked: { onClicked: {
inputItem.copy() inputItem.copy()
@ -55,8 +55,7 @@ FluMenu{
text:pasteText text:pasteText
focus: false focus: false
padding: 0 padding: 0
height: visible ? 34 : 0 height: visible ? 36 : 0
visible: inputItem.canPaste
onClicked: { onClicked: {
inputItem.paste() inputItem.paste()
menu.close() menu.close()
@ -67,7 +66,7 @@ FluMenu{
text:selectAllText text:selectAllText
focus: false focus: false
padding: 0 padding: 0
height: visible ? 34 : 0 height: visible ? 36 : 0
visible: inputItem.text !== "" visible: inputItem.text !== ""
onClicked: { onClicked: {
inputItem.selectAll() inputItem.selectAll()