diff --git a/example/AboutPage.qml b/example/AboutPage.qml index 3f6f2c0f..62e4045e 100644 --- a/example/AboutPage.qml +++ b/example/AboutPage.qml @@ -34,7 +34,7 @@ FluWindow { fontStyle: FluText.Title } FluText{ - text:"v1.0.1" + text:"v1.0.2" fontStyle: FluText.Body Layout.alignment: Qt.AlignBottom } diff --git a/example/MainPage.qml b/example/MainPage.qml index 6f89eed3..a9b65da2 100644 --- a/example/MainPage.qml +++ b/example/MainPage.qml @@ -91,7 +91,7 @@ FluWindow { FluMenuItem{ text:"意见反馈" onClicked:{ - showInfo("正在建设中...") + Qt.openUrlExternally("https://github.com/zhuzichu520/FluentUI/issues/new") } } FluMenuItem{ diff --git a/example/T_Slider.qml b/example/T_Slider.qml index 2f2b6926..1fedbc0d 100644 --- a/example/T_Slider.qml +++ b/example/T_Slider.qml @@ -26,6 +26,12 @@ Item { Layout.leftMargin: 15 value: 50 } + FluSlider{ + orientation:FluSlider.Vertical + Layout.topMargin: 20 + Layout.leftMargin: 15 + value: 50 + } } } } diff --git a/src/controls/FluButton.qml b/src/controls/FluButton.qml index 41b82c4d..cfbf82fd 100644 --- a/src/controls/FluButton.qml +++ b/src/controls/FluButton.qml @@ -7,8 +7,8 @@ Rectangle { property string text: "Standard Button" property int startPadding : 15 property int endPadding : 15 - property int topPadding: 8 - property int bottomPadding: 8 + property int topPadding: 5 + property int bottomPadding: 5 property bool disabled: false property color primaryColor : "#0064B0" signal clicked diff --git a/src/controls/FluFilledButton.qml b/src/controls/FluFilledButton.qml index 729c624c..c3f07bed 100644 --- a/src/controls/FluFilledButton.qml +++ b/src/controls/FluFilledButton.qml @@ -8,8 +8,8 @@ Rectangle { property string text: "Filled Button" property int startPadding : 15 property int endPadding : 15 - property int topPadding: 8 - property int bottomPadding: 8 + property int topPadding: 5 + property int bottomPadding: 5 property bool disabled: false signal clicked diff --git a/src/controls/FluProgressBar.qml b/src/controls/FluProgressBar.qml index cef6c30e..20bb6241 100644 --- a/src/controls/FluProgressBar.qml +++ b/src/controls/FluProgressBar.qml @@ -4,8 +4,8 @@ import QtQuick.Controls 2.12 FluRectangle { id: control - width: 180 - height: 6 + width: 150 + height: 5 radius: [3,3,3,3] clip: true color: FluTheme.isDark ? Qt.rgba(41/255,41/255,41/255,1) : Qt.rgba(214/255,214/255,214/255,1) diff --git a/src/controls/FluProgressRing.qml b/src/controls/FluProgressRing.qml index 2f18a845..f6bf84f7 100644 --- a/src/controls/FluProgressRing.qml +++ b/src/controls/FluProgressRing.qml @@ -4,13 +4,13 @@ import QtQuick.Controls 2.12 Rectangle { id: control - width: 60 - height: 60 - radius: 30 + width: 44 + height: 44 + radius: 22 border.width: linWidth color: "#00000000" border.color: FluTheme.isDark ? Qt.rgba(41/255,41/255,41/255,1) : Qt.rgba(214/255,214/255,214/255,1) - property real linWidth : 6 + property real linWidth : 5 property real progress: 0.25 property bool indeterminate: true readonly property real radius2 : radius - linWidth/2 diff --git a/src/controls/FluSlider.qml b/src/controls/FluSlider.qml index fb34c454..b9a3799f 100644 --- a/src/controls/FluSlider.qml +++ b/src/controls/FluSlider.qml @@ -6,23 +6,40 @@ Item{ id:root - property int lineWidth: 6 - property int dotSize: 30 + property int lineWidth: 5 + property int dotSize: 26 property int value: 50 + enum Orientation { + Horizontal, + Vertical + } + + height: control.height + width: control.width + + property int orientation: FluSlider.Horizontal + + property bool isHorizontal: orientation === FluSlider.Horizontal + Component.onCompleted: { - dot.x =value/100*control.width - dotSize/2 - root.value = Qt.binding(function(){ - return (dot.x+15)/control.width*100 - }) + if(isHorizontal){ + dot.x =value/100*control.width - dotSize/2 + root.value = Qt.binding(function(){ + return (dot.x+dotSize/2)/control.width*100 + }) + }else{ + dot.y =value/100*control.height - dotSize/2 + root.value = Qt.binding(function(){ + return (dot.y+dotSize/2)/control.height*100 + }) + } } FluRectangle { - id: control - - width: 300 - height: root.lineWidth + width: isHorizontal ? 200 : root.lineWidth + height: isHorizontal ? root.lineWidth : 200 radius: [3,3,3,3] clip: true anchors.verticalCenter: parent.verticalCenter @@ -30,8 +47,8 @@ Item{ Rectangle{ id:rect radius: 3 - width: control.width*(value/100) - height: control.height + width: isHorizontal ? control.width*(value/100) : control.width + height: isHorizontal ? control.height : control.height*(value/100) color:FluTheme.isDark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark } } @@ -40,11 +57,12 @@ Item{ id:dot width: dotSize height: dotSize - FluShadow{ - radius: 15 - } - radius: 15 - anchors.verticalCenter: parent.verticalCenter + FluShadow{ + radius: dotSize/2 + } + radius: dotSize/2 + anchors.verticalCenter: isHorizontal ? parent.verticalCenter : undefined + anchors.horizontalCenter: isHorizontal ? undefined :parent.horizontalCenter color:FluTheme.isDark ? Qt.rgba(69/255,69/255,69/255,1) :Qt.rgba(1,1,1,1) Rectangle{ width: dotSize/2 @@ -65,9 +83,11 @@ Item{ hoverEnabled: true drag { target: dot - axis: Drag.XAxis - minimumX: -dotSize/2 - maximumX: control.width - dotSize/2 + axis: isHorizontal ? Drag.XAxis : Drag.YAxis + minimumX: isHorizontal ? -dotSize/2 : 0 + maximumX: isHorizontal ? (control.width - dotSize/2) : 0 + minimumY: isHorizontal ? 0 : -dotSize/2 + maximumY: isHorizontal ? 0 : (control.height - dotSize/2) } onPressed: { tool_tip.visible = true