From 9786e69fc26e532491d6023dfd9692b47934916d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Sat, 24 Jun 2023 10:27:28 +0800 Subject: [PATCH] update --- example/CMakeLists.txt | 7 ---- src/CMakeLists.txt | 6 ++-- src/imports/FluentUI/Controls/FluSlider.qml | 40 +++++++++++---------- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 2186e660..18da1c1e 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -105,10 +105,3 @@ install(TARGETS example LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) - -qt_generate_deploy_app_script( - TARGET example - OUTPUT_SCRIPT deploy_script - NO_UNSUPPORTED_PLATFORM_ERROR -) -install(SCRIPT ${deploy_script}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 19311b13..8edac72d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -62,9 +62,9 @@ qt_add_qml_module(fluentuiplugin #链接库 target_link_libraries(fluentuiplugin PUBLIC - Qt::Core - Qt::Quick - Qt::Qml + Qt::CorePrivate + Qt::QuickPrivate + Qt::QmlPrivate ) #安装 diff --git a/src/imports/FluentUI/Controls/FluSlider.qml b/src/imports/FluentUI/Controls/FluSlider.qml index 8b55076b..f7c468ae 100644 --- a/src/imports/FluentUI/Controls/FluSlider.qml +++ b/src/imports/FluentUI/Controls/FluSlider.qml @@ -42,27 +42,31 @@ T.Slider { } } } + background: Item { + x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) + y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) + implicitWidth: control.horizontal ? 180 : 6 + implicitHeight: control.horizontal ? 6 : 180 + width: control.horizontal ? control.availableWidth : implicitWidth + height: control.horizontal ? implicitHeight : control.availableHeight + Rectangle{ + anchors.fill: parent + anchors.margins: 1 + radius: 2 + color:FluTheme.dark ? Qt.rgba(162/255,162/255,162/255,1) : Qt.rgba(138/255,138/255,138/255,1) + } + scale: control.horizontal && control.mirrored ? -1 : 1 + Rectangle { + y: control.horizontal ? 0 : control.visualPosition * parent.height + width: control.horizontal ? control.position * parent.width : 6 + height: control.horizontal ? 6 : control.position * parent.height + radius: 3 + color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + } + } FluTooltip{ parent: control.handle visible: control.tooltipEnabled && control.pressed text:String(control.value) } - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 180 : 4 - implicitHeight: control.horizontal ? 4 : 180 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - radius: 3 - color:FluTheme.dark ? Qt.rgba(162/255,162/255,162/255,1) : Qt.rgba(138/255,138/255,138/255,1) - scale: control.horizontal && control.mirrored ? -1 : 1 - Rectangle { - y: control.horizontal ? 0 : control.visualPosition * parent.height - width: control.horizontal ? control.position * parent.width : 4 - height: control.horizontal ? 4 : control.position * parent.height - radius: 2 - color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark - } - } }