main
zhuzihcu 2023-03-29 15:43:23 +08:00
parent b70a982586
commit 98f4d970c6
13 changed files with 81 additions and 12 deletions

View File

@ -8,7 +8,7 @@ import FluentUI 1.0
FluWindow { FluWindow {
id:rootwindow id:rootwindow
width: 860 width: 1000
height: 640 height: 640
title: "FluentUI" title: "FluentUI"
minimumWidth: 520 minimumWidth: 520
@ -17,11 +17,20 @@ FluWindow {
FluAppBar{ FluAppBar{
id:appbar id:appbar
z:10 z:10
showDark: true
} }
FluObject{ FluObject{
id:original_items id:original_items
FluPaneItem{
title:"Home"
icon:FluentIcons.Home
onTap:{
nav_view.push("qrc:/T_Home.qml")
}
}
FluPaneItemHeader{ FluPaneItemHeader{
title:"Inputs" title:"Inputs"
} }
@ -245,11 +254,9 @@ FluWindow {
logo: "qrc:/res/image/favicon.ico" logo: "qrc:/res/image/favicon.ico"
z: 11 z: 11
Component.onCompleted: { Component.onCompleted: {
nav_view.setCurrentIndex(1) nav_view.setCurrentIndex(0)
nav_view.push("qrc:/T_Buttons.qml") nav_view.push("qrc:/T_Home.qml")
} }
} }

View File

@ -47,5 +47,8 @@
<file>T_MediaPlayer.qml</file> <file>T_MediaPlayer.qml</file>
<file>T_TabView.qml</file> <file>T_TabView.qml</file>
<file>res/image/favicon.ico</file> <file>res/image/favicon.ico</file>
<file>T_Home.qml</file>
<file>res/image/bg_home_header.png</file>
<file>res/image/ic_home_github.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -69,13 +69,13 @@ Rectangle{
RowLayout{ RowLayout{
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.rightMargin: 14 Layout.rightMargin: 5
visible: showDark visible: showDark
spacing: 5 spacing: 5
FluText{ FluText{
text:"夜间模式" text:"夜间模式"
color:root.textColor color:root.textColor
fontStyle: FluText.Body fontStyle: FluText.Caption
} }
FluToggleSwitch{ FluToggleSwitch{
selected: FluTheme.isDark selected: FluTheme.isDark

View File

@ -148,6 +148,12 @@ TextField{
to:input_popup.y to:input_popup.y
duration: 150 duration: 150
} }
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
}
} }
onClosed: { onClosed: {
input.focus = false input.focus = false

View File

@ -72,6 +72,12 @@ Rectangle {
to:popup.y to:popup.y
duration: 150 duration: 150
} }
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
}
} }
background: FluCalendarView{ background: FluCalendarView{
id:container id:container

View File

@ -43,6 +43,12 @@ Button{
to:popup.y to:popup.y
duration: 150 duration: 150
} }
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
}
} }
contentItem: Item{} contentItem: Item{}
function showPopup() { function showPopup() {

View File

@ -111,6 +111,12 @@ Rectangle {
to:popup.y to:popup.y
duration: 150 duration: 150
} }
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
}
} }
background: Rectangle{ background: Rectangle{
id:container id:container

View File

@ -83,6 +83,7 @@ Button {
FluMenu{ FluMenu{
id:menu id:menu
width: control.width width: control.width
animEnabled: true
} }
} }

View File

@ -5,7 +5,7 @@ import QtQuick.Controls 2.15
Menu { Menu {
default property alias content: container.data default property alias content: container.data
property bool animEnabled: false
id: popup id: popup
width: 140 width: 140
height: container.height height: container.height
@ -18,7 +18,13 @@ Menu {
property: "y" property: "y"
from:0 from:0
to:popup.y to:popup.y
duration: 150 duration: animEnabled ? 150 : 0
}
NumberAnimation {
property: "opacity"
from:0
to:1
duration: animEnabled ? 150 : 0
} }
} }

View File

@ -132,12 +132,30 @@ Item {
} }
} }
FluText{ FluIcon{
text:model.title id:item_icon
iconSource: {
if(model.icon){
return model.icon
}
return 0
}
width: 30
height: 30
iconSize: 15
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left:parent.left left:parent.left
leftMargin: 14 leftMargin: 3
}
}
FluText{
id:item_title
text:model.title
anchors{
verticalCenter: parent.verticalCenter
left:item_icon.right
} }
} }
} }
@ -326,6 +344,7 @@ Item {
clip: true clip: true
anchors{ anchors{
top: layout_header.bottom top: layout_header.bottom
topMargin: 6
left: parent.left left: parent.left
right: parent.right right: parent.right
bottom: layout_footer.top bottom: layout_footer.top

View File

@ -2,6 +2,7 @@
QtObject { QtObject {
property string title property string title
property var icon
signal tap signal tap
signal repTap signal repTap
} }

View File

@ -19,6 +19,8 @@ Item {
FluText{ FluText{
id:text_title id:text_title
fontStyle: FluText.TitleLarge fontStyle: FluText.TitleLarge
visible: text !== ""
height: visible?implicitHeight:0
anchors{ anchors{
top: parent.top top: parent.top
topMargin: control.topPadding topMargin: control.topPadding

View File

@ -107,6 +107,12 @@ Rectangle {
modal: true modal: true
dim:false dim:false
enter: Transition { enter: Transition {
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
}
NumberAnimation { NumberAnimation {
property: "y" property: "y"
from:0 from:0