Compare commits
2 Commits
e1292966c1
...
4b01fcf2b4
Author | SHA1 | Date |
---|---|---|
|
4b01fcf2b4 | |
|
752fe8cfba |
|
@ -288,3 +288,28 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
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
|
||||||
|
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.
|
|
@ -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: {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -409,6 +409,31 @@ Item {
|
||||||
Drag.hotSpot.x: item_control.width / 2
|
Drag.hotSpot.x: item_control.width / 2
|
||||||
Drag.hotSpot.y: item_control.height / 2
|
Drag.hotSpot.y: item_control.height / 2
|
||||||
Drag.dragType: Drag.Automatic
|
Drag.dragType: Drag.Automatic
|
||||||
|
onClicked: {
|
||||||
|
if(type === 0){
|
||||||
|
if(model.onTapListener){
|
||||||
|
model.onTapListener()
|
||||||
|
}else{
|
||||||
|
nav_list.currentIndex = _idx
|
||||||
|
layout_footer.currentIndex = -1
|
||||||
|
model.tap()
|
||||||
|
if(d.isMinimal || d.isCompact){
|
||||||
|
d.enableNavigationPanel = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(model.onTapListener){
|
||||||
|
model.onTapListener()
|
||||||
|
}else{
|
||||||
|
nav_list.currentIndex = nav_list.count-layout_footer.count+_idx
|
||||||
|
layout_footer.currentIndex = _idx
|
||||||
|
model.tap()
|
||||||
|
if(d.isMinimal || d.isCompact){
|
||||||
|
d.enableNavigationPanel = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:item_mouse
|
id:item_mouse
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -433,29 +458,7 @@ Item {
|
||||||
loader_item_menu.item.popup();
|
loader_item_menu.item.popup();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(type === 0){
|
item_control.clicked()
|
||||||
if(model.onTapListener){
|
|
||||||
model.onTapListener()
|
|
||||||
}else{
|
|
||||||
nav_list.currentIndex = _idx
|
|
||||||
layout_footer.currentIndex = -1
|
|
||||||
model.tap()
|
|
||||||
if(d.isMinimal || d.isCompact){
|
|
||||||
d.enableNavigationPanel = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(model.onTapListener){
|
|
||||||
model.onTapListener()
|
|
||||||
}else{
|
|
||||||
nav_list.currentIndex = nav_list.count-layout_footer.count+_idx
|
|
||||||
layout_footer.currentIndex = _idx
|
|
||||||
model.tap()
|
|
||||||
if(d.isMinimal || d.isCompact){
|
|
||||||
d.enableNavigationPanel = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,6 +170,8 @@ T.ScrollBar {
|
||||||
}
|
}
|
||||||
,Transition {
|
,Transition {
|
||||||
to: "show"
|
to: "show"
|
||||||
|
SequentialAnimation {
|
||||||
|
PauseAnimation { duration: 450 }
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: rect_bar
|
target: rect_bar
|
||||||
properties: vertical ? "width" : "height"
|
properties: vertical ? "width" : "height"
|
||||||
|
@ -80,6 +179,7 @@ T.ScrollBar {
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,64 +3,22 @@ import QtQuick.Controls 2.15
|
||||||
import FluentUI 1.0
|
import FluentUI 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
//高性能阴影!!!比DropShadow阴影性能高出数倍!!!
|
||||||
property color color: FluTheme.dark ? "#FFFFFF" : "#999999"
|
property color color: FluTheme.dark ? "#999999" : "#999999"
|
||||||
|
property int elevation: 5
|
||||||
property int radius: 4
|
property int radius: 4
|
||||||
id:control
|
id:control
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: -4
|
Repeater{
|
||||||
|
model: elevation
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: control.width
|
anchors.fill: parent
|
||||||
height: control.height
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
opacity: 0.02
|
opacity: 0.02 * (elevation-index+1)
|
||||||
border.width: 1
|
anchors.margins: -index+1
|
||||||
radius: control.radius
|
radius: control.radius
|
||||||
|
border.width: index
|
||||||
border.color: control.color
|
border.color: control.color
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
width: control.width - 2
|
|
||||||
height: control.height - 2
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: "#00000000"
|
|
||||||
opacity: 0.04
|
|
||||||
border.width: 1
|
|
||||||
radius: control.radius
|
|
||||||
border.color: control.color
|
|
||||||
}
|
}
|
||||||
Rectangle{
|
|
||||||
width: control.width - 4
|
|
||||||
height: control.height - 4
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: "#00000000"
|
|
||||||
opacity: 0.06
|
|
||||||
border.width: 1
|
|
||||||
radius: control.radius
|
|
||||||
border.color: control.color
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
width: control.width - 6
|
|
||||||
height: control.height - 6
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: "#00000000"
|
|
||||||
opacity: 0.08
|
|
||||||
border.width: 1
|
|
||||||
radius: control.radius
|
|
||||||
border.color: control.color
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
width: control.width - 8
|
|
||||||
height: control.height - 8
|
|
||||||
anchors.centerIn: parent
|
|
||||||
opacity: 0.1
|
|
||||||
radius: control.radius
|
|
||||||
color: "#00000000"
|
|
||||||
border.width: 1
|
|
||||||
border.color: control.color
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -410,6 +410,31 @@ Item {
|
||||||
Drag.hotSpot.x: item_control.width / 2
|
Drag.hotSpot.x: item_control.width / 2
|
||||||
Drag.hotSpot.y: item_control.height / 2
|
Drag.hotSpot.y: item_control.height / 2
|
||||||
Drag.dragType: Drag.Automatic
|
Drag.dragType: Drag.Automatic
|
||||||
|
onClicked:{
|
||||||
|
if(type === 0){
|
||||||
|
if(model.onTapListener){
|
||||||
|
model.onTapListener()
|
||||||
|
}else{
|
||||||
|
nav_list.currentIndex = _idx
|
||||||
|
layout_footer.currentIndex = -1
|
||||||
|
model.tap()
|
||||||
|
if(d.isMinimal || d.isCompact){
|
||||||
|
d.enableNavigationPanel = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(model.onTapListener){
|
||||||
|
model.onTapListener()
|
||||||
|
}else{
|
||||||
|
nav_list.currentIndex = nav_list.count-layout_footer.count+_idx
|
||||||
|
layout_footer.currentIndex = _idx
|
||||||
|
model.tap()
|
||||||
|
if(d.isMinimal || d.isCompact){
|
||||||
|
d.enableNavigationPanel = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:item_mouse
|
id:item_mouse
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -434,29 +459,7 @@ Item {
|
||||||
loader_item_menu.item.popup();
|
loader_item_menu.item.popup();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(type === 0){
|
item_control.clicked()
|
||||||
if(model.onTapListener){
|
|
||||||
model.onTapListener()
|
|
||||||
}else{
|
|
||||||
nav_list.currentIndex = _idx
|
|
||||||
layout_footer.currentIndex = -1
|
|
||||||
model.tap()
|
|
||||||
if(d.isMinimal || d.isCompact){
|
|
||||||
d.enableNavigationPanel = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(model.onTapListener){
|
|
||||||
model.onTapListener()
|
|
||||||
}else{
|
|
||||||
nav_list.currentIndex = nav_list.count-layout_footer.count+_idx
|
|
||||||
layout_footer.currentIndex = _idx
|
|
||||||
model.tap()
|
|
||||||
if(d.isMinimal || d.isCompact){
|
|
||||||
d.enableNavigationPanel = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,6 +171,8 @@ T.ScrollBar {
|
||||||
}
|
}
|
||||||
,Transition {
|
,Transition {
|
||||||
to: "show"
|
to: "show"
|
||||||
|
SequentialAnimation {
|
||||||
|
PauseAnimation { duration: 450 }
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: rect_bar
|
target: rect_bar
|
||||||
properties: vertical ? "width" : "height"
|
properties: vertical ? "width" : "height"
|
||||||
|
@ -81,6 +180,7 @@ T.ScrollBar {
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,64 +3,22 @@ import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
//高性能阴影!!!比DropShadow阴影性能高出数倍!!!
|
||||||
property color color: FluTheme.dark ? "#FFFFFF" : "#999999"
|
property color color: FluTheme.dark ? "#999999" : "#999999"
|
||||||
|
property int elevation: 5
|
||||||
property int radius: 4
|
property int radius: 4
|
||||||
id:control
|
id:control
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: -4
|
Repeater{
|
||||||
|
model: elevation
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: control.width
|
anchors.fill: parent
|
||||||
height: control.height
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
opacity: 0.02
|
opacity: 0.02 * (elevation-index+1)
|
||||||
border.width: 1
|
anchors.margins: -index+1
|
||||||
radius: control.radius
|
radius: control.radius
|
||||||
|
border.width: index
|
||||||
border.color: control.color
|
border.color: control.color
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
width: control.width - 2
|
|
||||||
height: control.height - 2
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: "#00000000"
|
|
||||||
opacity: 0.04
|
|
||||||
border.width: 1
|
|
||||||
radius: control.radius
|
|
||||||
border.color: control.color
|
|
||||||
}
|
}
|
||||||
Rectangle{
|
|
||||||
width: control.width - 4
|
|
||||||
height: control.height - 4
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: "#00000000"
|
|
||||||
opacity: 0.06
|
|
||||||
border.width: 1
|
|
||||||
radius: control.radius
|
|
||||||
border.color: control.color
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
width: control.width - 6
|
|
||||||
height: control.height - 6
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: "#00000000"
|
|
||||||
opacity: 0.08
|
|
||||||
border.width: 1
|
|
||||||
radius: control.radius
|
|
||||||
border.color: control.color
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
width: control.width - 8
|
|
||||||
height: control.height - 8
|
|
||||||
anchors.centerIn: parent
|
|
||||||
opacity: 0.1
|
|
||||||
radius: control.radius
|
|
||||||
color: "#00000000"
|
|
||||||
border.width: 1
|
|
||||||
border.color: control.color
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue