mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-06 10:45:26 +08:00
update
This commit is contained in:
40
src/Qt5/imports/FluentUI/Controls/FluLoadingButton.qml
Normal file
40
src/Qt5/imports/FluentUI/Controls/FluLoadingButton.qml
Normal file
@ -0,0 +1,40 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import FluentUI 1.0
|
||||
|
||||
FluButton {
|
||||
property bool loading: false
|
||||
id: control
|
||||
disabled: loading
|
||||
contentItem: Row{
|
||||
spacing: 6
|
||||
FluText {
|
||||
text: control.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font: control.font
|
||||
color: control.textColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
Item{
|
||||
width: control.loading ? 16 : 0
|
||||
height: 16
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: width!==0
|
||||
clip: true
|
||||
Behavior on width {
|
||||
enabled: FluTheme.enableAnimation
|
||||
NumberAnimation{
|
||||
duration: 167
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
FluProgressRing{
|
||||
width: 16
|
||||
height: 16
|
||||
strokeWidth:3
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -27,28 +27,31 @@ Button {
|
||||
Accessible.name: control.text
|
||||
Accessible.description: contentDescription
|
||||
Accessible.onPressAction: control.clicked()
|
||||
height: 20
|
||||
enabled: !disabled
|
||||
implicitHeight: height
|
||||
focusPolicy:Qt.TabFocus
|
||||
onClicked: clickListener()
|
||||
padding: 0
|
||||
horizontalPadding: 0
|
||||
onCheckableChanged: {
|
||||
if(checkable){
|
||||
checkable = false
|
||||
}
|
||||
}
|
||||
contentItem: Item{}
|
||||
background : RowLayout{
|
||||
background : Item{
|
||||
implicitHeight: 20
|
||||
implicitWidth: 40
|
||||
}
|
||||
contentItem: RowLayout{
|
||||
spacing: control.textSpacing
|
||||
layoutDirection:control.textRight ? Qt.LeftToRight : Qt.RightToLeft
|
||||
Rectangle {
|
||||
id:control_backgound
|
||||
width: 40
|
||||
height: control.height
|
||||
width: background.width
|
||||
height: background.height
|
||||
radius: height / 2
|
||||
FluFocusRectangle{
|
||||
visible: control.activeFocus
|
||||
radius: 20
|
||||
radius: parent.radius
|
||||
}
|
||||
color: {
|
||||
if(!enabled){
|
||||
@ -73,10 +76,10 @@ Button {
|
||||
return borderNormalColor
|
||||
}
|
||||
Rectangle {
|
||||
width: 20
|
||||
width: parent.height
|
||||
x:checked ? control_backgound.width-width : 0
|
||||
height: 20
|
||||
radius: 10
|
||||
height: width
|
||||
radius: width/2
|
||||
scale: hovered&enabled ? 7/10 : 6/10
|
||||
color: {
|
||||
if(!enabled){
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -95,4 +95,5 @@ FluWindow 1.0 Controls/FluWindow.qml
|
||||
FluRangeSlider 1.0 Controls/FluRangeSlider.qml
|
||||
FluStaggeredView 1.0 Controls/FluStaggeredView.qml
|
||||
FluProgressButton 1.0 Controls/FluProgressButton.qml
|
||||
FluLoadingButton 1.0 Controls/FluLoadingButton.qml
|
||||
plugin fluentuiplugin
|
||||
|
@ -95,5 +95,6 @@
|
||||
<file>FluentUI/Controls/ColorPicker/Content/NumberBox.qml</file>
|
||||
<file>FluentUI/Controls/ColorPicker/Content/PanelBorder.qml</file>
|
||||
<file>FluentUI/Controls/ColorPicker/Content/SBPicker.qml</file>
|
||||
<file>FluentUI/Controls/FluLoadingButton.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Reference in New Issue
Block a user