main
朱子楚\zhuzi 2023-06-08 23:19:38 +08:00
parent 6da4a2e10e
commit 49029164ff
6 changed files with 63 additions and 91 deletions

View File

@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.20)
project(FluentUI VERSION 0.1 LANGUAGES CXX)
add_subdirectory(src)
add_subdirectory(example)
add_definitions(-DFRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT)
add_definitions(-DFRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT)
add_subdirectory(framelesshelper)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.20)
project(example VERSION 0.1 LANGUAGES CXX)

View File

@ -5,36 +5,31 @@ import QtQuick.Controls
import FluentUI
import "../component"
FluScrollablePage{
FluScrollablePage {
title:"RatingControl"
title: "RatingControl"
FluArea{
FluArea {
Layout.fillWidth: true
height: 100
paddings: 10
Layout.topMargin: 20
Column{
Column {
spacing: 10
anchors.verticalCenter: parent.verticalCenter
FluRatingControl{
FluRatingControl {}
FluRatingControl {
number: 10
}
FluRatingControl{
number:10
}
}
}
CodeExpander{
CodeExpander {
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluRatingControl{
code: 'FluRatingControl{
}'
}
}

View File

@ -90,12 +90,8 @@ CustomWindow {
FluNavigationView{
id:nav_view
anchors{
top: parent.top
left: parent.left
right: parent.right
bottom: parent.bottom
}
width: parent.width
height: parent.height
z:999
items: ItemsOriginal
footerItems:ItemsFooter

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.20)
project(fluentuiplugin LANGUAGES CXX)
@ -52,6 +52,8 @@ qt_add_qml_module(fluentuiplugin
OUTPUT_DIRECTORY ${QML_PLUGIN_DIRECTORY}
VERSION 1.0
URI "FluentUI"
#qmltypesfluentuiplugin.qmltypes使import FluentUIplugins.qmltypes
TYPEINFO "plugins.qmltypes"
SOURCES ${sources_files} fluentui.rc
QML_FILES ${qml_files}
RESOURCES ${resource_files}

View File

@ -7,10 +7,10 @@ import FluentUI
Item {
enum DisplayMode {
Open,
Compact,
Minimal,
Auto
Open = 0,
Compact = 1,
Minimal = 2,
Auto = 3
}
enum PageModeFlag{
Standard = 0,
@ -55,9 +55,7 @@ Item {
collapseAll()
}
if(d.displayMode === FluNavigationView.Minimal){
anim_layout_list_x.enabled = false
d.enableNavigationPanel = false
timer_anim_x_enable.restart()
}
}
function handleItems(){
@ -202,18 +200,12 @@ Item {
right: parent.right
rightMargin: 12
}
opacity: {
visible: {
if(d.isCompactAndNotPanel){
return false
}
return true
}
visible:opacity
Behavior on opacity {
NumberAnimation{
duration: 83
}
}
Behavior on rotation {
NumberAnimation{
duration: 83
@ -273,18 +265,12 @@ Item {
FluText{
id:item_title
text:model.title
opacity: {
visible: {
if(d.isCompactAndNotPanel){
return false
}
return true
}
visible:opacity
Behavior on opacity {
NumberAnimation{
duration: 83
}
}
anchors{
verticalCenter: parent.verticalCenter
left:item_icon.right
@ -429,18 +415,12 @@ Item {
FluText{
id:item_title
text:model.title
opacity: {
visible: {
if(d.isCompactAndNotPanel){
return false
}
return true
}
visible:opacity
Behavior on opacity {
NumberAnimation{
duration: 83
}
}
color:{
if(item_control.pressed){
return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120
@ -496,11 +476,18 @@ Item {
Layout.preferredWidth: d.isMinimal ? 30 : 0
Layout.preferredHeight: 30
Layout.alignment: Qt.AlignVCenter
clip: true
onClicked: {
d.enableNavigationPanel = !d.enableNavigationPanel
}
visible: d.isMinimal
Behavior on Layout.preferredWidth{
visible: opacity
opacity: d.isMinimal
Behavior on opacity{
NumberAnimation{
duration: 83
}
}
Behavior on Layout.preferredWidth {
NumberAnimation{
duration: 167
easing.type: Easing.BezierSpline
@ -547,11 +534,26 @@ Item {
}
Item{
anchors{
left: d.isMinimal || d.isCompactAndPanel ? parent.left : layout_list.right
left: parent.left
top: nav_app_bar.bottom
right: parent.right
bottom: parent.bottom
leftMargin: d.isCompactAndPanel ? 50 : 0
leftMargin: {
if(d.isMinimal){
return 0
}
if(d.isCompact){
return 50
}
return 300
}
}
Behavior on anchors.leftMargin {
NumberAnimation{
duration: 167
easing.type: Easing.BezierSpline
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
StackView{
id:nav_swipe
@ -586,11 +588,12 @@ Item {
MouseArea{
anchors.fill: parent
visible: d.isMinimalAndPanel||d.isCompactAndPanel
onWheel: {
}
onClicked: {
d.enableNavigationPanel = false
}
}
Rectangle{
id:layout_list
width: {
@ -599,21 +602,6 @@ Item {
}
return 300
}
Behavior on width{
NumberAnimation{
duration: 167
easing.type: Easing.BezierSpline
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
Behavior on x{
id:anim_layout_list_x
NumberAnimation{
duration: 167
easing.type: Easing.BezierSpline
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
anchors{
top: parent.top
bottom: parent.bottom
@ -627,6 +615,13 @@ Item {
return "transparent"
}
x: visible ? 0 : -width
Behavior on x {
NumberAnimation{
duration: 167
easing.type: Easing.BezierSpline
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
visible: {
if(d.displayMode !== FluNavigationView.Minimal)
return true
@ -656,27 +651,15 @@ Item {
id:loader_auto_suggest_box
anchors.centerIn: parent
sourceComponent: autoSuggestBox
opacity: {
visible: {
if(d.isCompactAndNotPanel){
return false
}
return true
}
visible: opacity
Behavior on opacity{
NumberAnimation{
duration: 83
}
}
}
FluIconButton{
visible:opacity
opacity:d.isCompactAndNotPanel
Behavior on opacity{
NumberAnimation{
duration: 83
}
}
visible:d.isCompactAndNotPanel
hoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
pressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
normalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
@ -870,13 +853,6 @@ Item {
control_popup.open()
}
}
Timer{
id:timer_anim_x_enable
interval: 150
onTriggered: {
anim_layout_list_x.enabled = true
}
}
function collapseAll(){
for(var i=0;i<nav_list.model.length;i++){
var item = nav_list.model[i]