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) project(FluentUI VERSION 0.1 LANGUAGES CXX)
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(example) add_subdirectory(example)
add_definitions(-DFRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT)
add_definitions(-DFRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT)
add_subdirectory(framelesshelper) 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) project(example VERSION 0.1 LANGUAGES CXX)

View File

@ -18,14 +18,11 @@ FluScrollablePage{
Column { Column {
spacing: 10 spacing: 10
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
FluRatingControl{ FluRatingControl {}
}
FluRatingControl { FluRatingControl {
number: 10 number: 10
} }
} }
} }
CodeExpander { CodeExpander {
@ -35,6 +32,4 @@ FluScrollablePage{
}' }'
} }
} }

View File

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

View File

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

View File

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