Compare commits

...

23 Commits

Author SHA1 Message Date
bd8c80feb8 update 2024-04-04 17:43:58 +08:00
6b617d10d5 update 2024-04-04 17:08:45 +08:00
cf163f5e3b update 2024-04-04 16:53:31 +08:00
b4329fdd0a update 2024-04-04 12:11:08 +08:00
84b2045b5f update 2024-04-04 02:48:26 +08:00
18193a18be update 2024-04-04 02:01:52 +08:00
fe08b08c1f update 2024-04-04 01:10:14 +08:00
ef96618151 update 2024-04-03 21:52:26 +08:00
be34220652 update 2024-04-03 19:31:01 +08:00
5cf0812562 update 2024-04-03 19:30:15 +08:00
c2b845658d update 2024-04-03 13:24:30 +08:00
eb4ec242b1 update 2024-04-03 11:28:18 +08:00
a95916ab03 update 2024-04-03 11:19:35 +08:00
bf5bedc9ed update 2024-04-03 11:09:35 +08:00
7d1666597f update 2024-04-02 00:32:06 +08:00
da9f63eb24 update 2024-03-31 21:56:11 +08:00
68015776ab update 2024-03-31 21:52:06 +08:00
d222cb640c update 2024-03-31 11:17:05 +08:00
0ab7f811e3 update 2024-03-31 10:59:15 +08:00
6a5f9d04a9 update 2024-03-29 16:56:09 +08:00
cb33af8836 update 2024-03-29 16:23:16 +08:00
5fd934b5f5 update 2024-03-29 00:51:55 +08:00
b7fde5f79c update 2024-03-29 00:48:58 +08:00
193 changed files with 2832 additions and 2177 deletions

View File

@ -177,7 +177,6 @@
<file>qml/window/SingleInstanceWindow.qml</file>
<file>qml/window/SingleTaskWindow.qml</file>
<file>qml/window/StandardWindow.qml</file>
<file>res/image/bg_scenic.png</file>
<file>res/image/image_1.jpg</file>
<file>qml/window/PageWindow.qml</file>
<file>qml/page/T_StaggeredLayout.qml</file>
@ -195,7 +194,6 @@
<file>res/image/ic_crash.png</file>
<file>qml/window/CrashWindow.qml</file>
<file>qml/page/T_SplitLayout.qml</file>
<file>qml/window/FluentInitalizrWindow.qml</file>
<file>res/template/CMakeLists.txt.in</file>
<file>res/template/src/App.qml.in</file>
<file>res/template/src/CMakeLists.txt.in</file>
@ -207,5 +205,9 @@
<file>res/template/src/zh_CN.ts.in</file>
<file>res/template/src/README.md.in</file>
<file>qml/global/GlobalModel.qml</file>
<file>qml/page/T_Sheet.qml</file>
<file>qml/page/T_GroupBox.qml</file>
<file>res/image/bg_scenic.jpg</file>
<file>qml/window/FluentInitializrWindow.qml</file>
</qresource>
</RCC>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@ FluLauncher {
FluApp.windowIcon = "qrc:/example/res/image/favicon.ico"
FluApp.useSystemAppBar = SettingsHelper.getUseSystemAppBar()
FluTheme.darkMode = SettingsHelper.getDarkMode()
FluTheme.enableAnimation = true
FluTheme.animationEnabled = true
FluRouter.routes = {
"/":"qrc:/example/qml/window/MainWindow.qml",
"/about":"qrc:/example/qml/window/AboutWindow.qml",

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title: qsTr("Bar Chart")
FluArea{
width: 500
height: 370
paddings: 10
FluFrame{
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
Layout.topMargin: 20
FluChart{
anchors.fill: parent
@ -69,10 +69,10 @@ FluScrollablePage{
}
}
FluArea{
width: 500
height: 370
paddings: 10
FluFrame{
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
Layout.topMargin: 20
FluChart{
anchors.fill: parent

View File

@ -13,10 +13,10 @@ FluScrollablePage{
return Math.random().toFixed(1);
}
FluArea{
height: 370
width: 500
paddings: 10
FluFrame{
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
Layout.topMargin: 20
FluChart{
anchors.fill: parent

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title: qsTr("Line Chart")
FluArea{
width: 500
height: 370
paddings: 10
FluFrame{
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
Layout.topMargin: 20
FluChart{
anchors.fill: parent

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title: qsTr("Pie Chart")
FluArea{
width: 500
height: 370
paddings: 10
FluFrame{
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
Layout.topMargin: 20
FluChart{
anchors.fill: parent
@ -50,10 +50,10 @@ FluScrollablePage{
}
}
FluArea{
width: 500
height: 370
paddings: 10
FluFrame{
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
Layout.topMargin: 20
FluChart{
anchors.fill: parent

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title: qsTr("Polar Area Chart")
FluArea{
width: 500
height: 370
paddings: 10
FluFrame{
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
Layout.topMargin: 20
FluChart{
anchors.fill: parent

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title: qsTr("Radar Chart")
FluArea{
width: 500
height: 370
paddings: 10
FluFrame{
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
Layout.topMargin: 20
FluChart{
anchors.fill: parent

View File

@ -13,10 +13,10 @@ FluScrollablePage{
return Math.random().toFixed(1);
}
FluArea{
height: 370
width: 500
paddings: 10
FluFrame{
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
Layout.topMargin: 20
FluChart{
anchors.fill: parent
@ -119,5 +119,4 @@ FluScrollablePage{
}
}
}
}

View File

@ -137,7 +137,9 @@ FluExpander{
"FluNetwork",
"FluShortcutPicker",
"FluWindowResultLauncher",
"FluRouter"
"FluRouter",
"FluGroupBox",
"FluSheet",
];
code = code.replace(/\n/g, "<br>");
code = code.replace(/ /g, "&nbsp;");

View File

@ -104,6 +104,12 @@ FluObject{
url: "qrc:/example/qml/page/T_ToggleSwitch.qml"
onTap: { navigationView.push(url) }
}
FluPaneItem{
title: qsTr("GroupBox")
menuDelegate: paneItemMenu
url: "qrc:/example/qml/page/T_GroupBox.qml"
onTap: { navigationView.push(url) }
}
FluPaneItem{
title: qsTr("PaneItem Disabled")
disabled: true
@ -271,6 +277,12 @@ FluObject{
url: "qrc:/example/qml/page/T_Menu.qml"
onTap: { navigationView.push(url) }
}
FluPaneItem{
title: qsTr("Sheet")
menuDelegate: paneItemMenu
url: "qrc:/example/qml/page/T_Sheet.qml"
onTap: { navigationView.push(url) }
}
}
FluPaneItemExpander{
@ -473,10 +485,12 @@ FluObject{
}
FluPaneItem{
title: qsTr("Test Crash")
visible: FluTools.isWin()
onTapListener: function(){
AppInfo.testCrash()
}
Component.onCompleted: {
visible = FluTools.isWin()
}
}
}

View File

@ -11,7 +11,6 @@ FluScrollablePage{
RowLayout{
spacing: 10
Layout.topMargin: 20
FluText{
text:"tintColor:"
Layout.alignment: Qt.AlignVCenter
@ -42,10 +41,10 @@ FluScrollablePage{
value: 32
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 1200/4+20
paddings: 10
Layout.preferredHeight: 1200/4+20
padding: 10
Layout.topMargin: 10
FluClip{
width: 1920/4
@ -54,7 +53,7 @@ FluScrollablePage{
Image {
id:image
asynchronous: true
source: "qrc:/example/res/image/bg_scenic.png"
source: "qrc:/example/res/image/bg_scenic.jpg"
anchors.fill: parent
sourceSize: Qt.size(2*width,2*height)
}
@ -72,7 +71,7 @@ FluScrollablePage{
anchors.centerIn: parent
text: "Acrylic"
color: "#FFFFFF"
font.bold: true
font: FluTextStyle.Subtitle
}
MouseArea {
property point clickPos: Qt.point(0,0)
@ -95,7 +94,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'Image{
id:image
width: 800

View File

@ -12,7 +12,6 @@ FluContentPage {
id:text_box
placeholderText: qsTr("Please enter a keyword")
anchors{
topMargin: 20
top:parent.top
}
}
@ -59,6 +58,7 @@ FluContentPage {
FluText {
id:item_name
font.pixelSize: 10
font.family: FluTextStyle.family
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: item_icon.bottom
width:parent.width

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Badge")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 120
paddings: 10
padding: 10
Column{
spacing: 15
@ -114,7 +113,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'Rectangle{
width: 40
height: 40

View File

@ -18,11 +18,10 @@ FluScrollablePage{
breadcrumb_2.items = items
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 68
padding: 10
FluBreadcrumbBar{
id:breadcrumb_1
@ -36,10 +35,10 @@ FluScrollablePage{
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.preferredHeight: 100
padding: 10
Layout.topMargin: 20
ColumnLayout{
@ -77,7 +76,7 @@ FluScrollablePage{
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluBreadcrumbBar{
width:parent.width
separator:">"

View File

@ -10,15 +10,14 @@ FluScrollablePage{
title: qsTr("Buttons")
FluText{
Layout.topMargin: 20
text: qsTr("Support the Tab key to switch focus, and the Space key to perform click events")
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 68
Layout.topMargin: 10
padding: 10
FluTextButton{
disabled: text_button_switch.checked
@ -42,7 +41,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluTextButton{
text:"Text Button"
onClicked: {
@ -51,10 +50,10 @@ FluScrollablePage{
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.preferredHeight: 68
padding: 10
Layout.topMargin: 20
FluButton{
@ -79,7 +78,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluButton{
text:"Standard Button"
onClicked: {
@ -88,11 +87,11 @@ FluScrollablePage{
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
Layout.preferredHeight: 68
Layout.topMargin: 20
paddings: 10
padding: 10
FluFilledButton{
disabled: filled_button_switch.checked
@ -116,7 +115,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluFilledButton{
text:"Filled Button"
onClicked: {
@ -125,11 +124,11 @@ FluScrollablePage{
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
Layout.preferredHeight: 68
Layout.topMargin: 20
paddings: 10
padding: 10
FluToggleButton{
disabled:toggle_button_switch.checked
@ -150,7 +149,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluToggleButton{
text:"Toggle Button"
onClicked: {
@ -172,11 +171,11 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
Layout.preferredHeight: 68
Layout.topMargin: 20
paddings: 10
padding: 10
FluProgressButton{
id: btn_progress
@ -202,7 +201,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluProgressButton{
text:"Progress Button"
onClicked: {
@ -211,11 +210,11 @@ FluScrollablePage{
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
Layout.preferredHeight: 68
Layout.topMargin: 20
paddings: 10
padding: 10
FluLoadingButton{
id: btn_loading
@ -241,7 +240,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluLoadingButton{
text:"Loading Button"
onClicked: {
@ -251,10 +250,10 @@ FluScrollablePage{
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: layout_icon_button.height + 30
paddings: 10
Layout.preferredHeight: layout_icon_button.height + 30
padding: 10
Layout.topMargin: 20
Flow{
id: layout_icon_button
@ -323,7 +322,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluIconButton{
iconSource:FluentIcons.ChromeCloseContrast
onClicked: {
@ -332,10 +331,10 @@ FluScrollablePage{
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.preferredHeight: 68
padding: 10
Layout.topMargin: 20
FluDropDownButton{
disabled: drop_down_button_switch.checked
@ -371,7 +370,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluDropDownButton{
text:"DropDownButton"
FluMenuItem{
@ -389,10 +388,10 @@ FluScrollablePage{
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.preferredHeight: 100
padding: 10
Layout.topMargin: 20
FluRadioButtons{
spacing: 8
@ -424,7 +423,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluRadioButton{
checked:true
text:"Text Button"

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("CalendarPicker")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 80
paddings: 10
Layout.preferredHeight: 80
padding: 10
ColumnLayout{
anchors{
verticalCenter: parent.verticalCenter
@ -28,7 +27,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluCalendarPicker{
}'

View File

@ -11,7 +11,6 @@ FluScrollablePage{
FluCaptcha{
id: captcha
Layout.topMargin: 20
ignoreCase:switch_case.checked
MouseArea{
anchors.fill: parent

View File

@ -22,11 +22,10 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 370
paddings: 10
Layout.topMargin: 20
padding: 10
Column{
spacing: 15
anchors{
@ -62,10 +61,10 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 340
paddings: 10
padding: 10
Layout.topMargin: 10
Column{
spacing: 15
@ -104,7 +103,6 @@ FluScrollablePage{
horizontalAlignment: Qt.AlignHCenter
text:model.title
color: FluColors.Grey10
font.pixelSize: 15
}
}
}
@ -126,7 +124,7 @@ FluScrollablePage{
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluCarousel{
id:carousel
width: 400

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("CheckBox")
FluArea{
FluFrame{
Layout.fillWidth: true
height: 72
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 72
padding: 10
FluText{
text: qsTr("A 2-state CheckBox")
@ -49,16 +48,16 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluCheckBox{
text:"Text"
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 72
paddings: 10
Layout.preferredHeight: 72
padding: 10
Layout.topMargin: 20
FluText{
@ -104,7 +103,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluCheckBox{
text:"Text"
indeterminate:true

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Clip")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 380
paddings: 10
Layout.preferredHeight: 380
padding: 10
Column{
spacing: 15
@ -88,7 +87,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluClip{
radius: [25,25,25,25]
width: 50

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("ColorPicker")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 60
paddings: 10
Layout.preferredHeight: 60
padding: 10
RowLayout{
FluText{
text: qsTr("Click to Select a Color - >")
@ -33,7 +32,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluColorPicker{
}'

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("ComboBox")
FluArea{
FluFrame{
Layout.fillWidth: true
height: 80
paddings: 5
Layout.topMargin: 20
Layout.preferredHeight: 80
padding: 5
Column{
spacing: 5
anchors.verticalCenter: parent.verticalCenter
@ -32,10 +31,10 @@ FluScrollablePage{
}
}
FluArea {
FluFrame {
Layout.fillWidth: true
height: 80
paddings: 5
Layout.preferredHeight: 80
padding: 5
Layout.topMargin: 20
Column{
spacing: 5
@ -56,10 +55,10 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 80
paddings: 10
padding: 10
Layout.topMargin: 20
Column{
spacing: 5
@ -85,7 +84,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluComboBox{
editable: true
model: ListModel {

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("DatePicker")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 80
paddings: 10
Layout.preferredHeight: 80
padding: 10
ColumnLayout{
anchors{
verticalCenter: parent.verticalCenter
@ -32,17 +31,17 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluDatePicker{
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 80
paddings: 10
Layout.preferredHeight: 80
padding: 10
ColumnLayout{
anchors{
verticalCenter: parent.verticalCenter
@ -61,7 +60,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluDatePicker{
showYear:false
}'

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Dialog")
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 68
padding: 10
FluButton{
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Show Double Button Dialog")
@ -24,7 +23,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluContentDialog{
id:dialog
title: qsTr("Friendly Reminder")
@ -57,10 +56,10 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.preferredHeight: 68
padding: 10
Layout.topMargin: 20
FluButton{
anchors.verticalCenter: parent.verticalCenter
@ -72,7 +71,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluContentDialog{
id: dialog
title: qsTr("Friendly Reminder")
@ -114,10 +113,10 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.preferredHeight: 100
padding: 10
Layout.topMargin: 20
FluButton{
anchors.top: parent.top
@ -138,7 +137,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluContentDialog{
id: dialog
title: qsTr("Friendly Reminder")

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Expander")
FluArea{
FluFrame{
Layout.fillWidth: true
height: layout_column.height+20
paddings: 10
Layout.topMargin: 20
padding: 10
Column{
id:layout_column
spacing: 15
@ -83,7 +82,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluExpander{
headerText: qsTr("Open a radio box")
Item{

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("FlipView")
FluArea{
FluFrame{
Layout.fillWidth: true
height: 340
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 340
padding: 10
ColumnLayout{
anchors.verticalCenter: parent.verticalCenter
FluText{
@ -40,7 +39,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluFlipView{
Image{
source: "qrc:/example/res/image/banner_1.jpg"
@ -61,10 +60,10 @@ FluScrollablePage{
'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 340
paddings: 10
padding: 10
Layout.topMargin: 20
ColumnLayout{
anchors.verticalCenter: parent.verticalCenter
@ -93,7 +92,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluFlipView{
vertical:true
Image{

View File

@ -0,0 +1,48 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "../component"
FluScrollablePage{
title: qsTr("GroupBox")
FluGroupBox {
title: qsTr("CheckBox Group")
ColumnLayout {
spacing: 10
anchors.fill: parent
FluCheckBox { text: qsTr("E-mail") }
FluCheckBox { text: qsTr("Calendar") }
FluCheckBox { text: qsTr("Contacts") }
}
}
FluGroupBox {
title: qsTr("RadioButton Group")
FluRadioButtons {
spacing: 10
FluRadioButton { text: qsTr("E-mail") }
FluRadioButton { text: qsTr("Calendar") }
FluRadioButton { text: qsTr("Contacts") }
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: 4
code:'FluGroupBox {
title: qsTr("CheckBox Group")
ColumnLayout {
spacing: 10
anchors.fill: parent
FluCheckBox { text: qsTr("E-mail") }
FluCheckBox { text: qsTr("Calendar") }
FluCheckBox { text: qsTr("Contacts") }
}
}'
}
}

View File

@ -9,10 +9,11 @@ import "../global"
FluScrollablePage{
launchMode: FluPageType.SingleTask
animDisabled: true
animationEnabled: false
header: Item{}
FluentInitalizrWindow{
id:fluent_initalizr
FluentInitializrWindow{
id:fluent_Initializr
}
ListModel{
@ -28,11 +29,11 @@ FluScrollablePage{
}
ListElement{
icon: "qrc:/example/res/image/favicon.ico"
title: qsTr("FluentUI Initalizr")
title: qsTr("FluentUI Initializr")
desc: qsTr("FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options.")
url: "https://github.com/zhuzichu520/FluentUI"
clicked: function(model){
fluent_initalizr.showDialog()
fluent_Initializr.showDialog()
}
}
}
@ -121,6 +122,7 @@ FluScrollablePage{
Layout.leftMargin: 20
color: FluColors.Grey120
font.pixelSize: 12
font.family: FluTextStyle.family
wrapMode: Text.WrapAnywhere
}
}
@ -177,7 +179,7 @@ FluScrollablePage{
property string desc: modelData.extra.desc
width: 320
height: 120
FluArea{
FluFrame{
radius: 8
width: 300
height: 100

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Image")
FluArea{
FluFrame{
Layout.fillWidth: true
height: 260
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 260
padding: 10
Column{
spacing: 15
anchors{
@ -37,7 +36,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluImage{
width: 400
height: 300

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("InfoBar")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 270
paddings: 10
Layout.preferredHeight: 270
padding: 10
ColumnLayout{
spacing: 14
anchors{
@ -60,7 +59,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'showInfo(qsTr("This is an InfoBar in the Info Style"))
showWarning(qsTr("This is an InfoBar in the Warning Style"))

View File

@ -47,11 +47,10 @@ FluScrollablePage{
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 100
padding: 10
Column{
id: layout_column
spacing: 15
@ -78,7 +77,7 @@ FluScrollablePage{
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluMenu{
id:menu
FluMenuItem:{
@ -99,10 +98,10 @@ menu.popup()
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.preferredHeight: 100
padding: 10
Layout.topMargin: 20
Column{
spacing: 15
@ -151,7 +150,7 @@ menu.popup()
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluMenuBar{
id:menu
FluMenu:{

View File

@ -21,11 +21,10 @@ FluScrollablePage{
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 86
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 86
padding: 10
Column{
spacing: 15
anchors{
@ -44,10 +43,10 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 86
paddings: 10
Layout.preferredHeight: 86
padding: 10
Layout.topMargin: 10
Column{
spacing: 15
@ -68,10 +67,10 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 86
paddings: 10
Layout.preferredHeight: 86
padding: 10
Layout.topMargin: 10
Column{
spacing: 15
@ -92,7 +91,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluWindow{
//launchMode: FluWindowType.Standard
//launchMode: FluWindowType.SingleTask
@ -102,10 +101,10 @@ FluScrollablePage{
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.preferredHeight: 100
padding: 10
Layout.topMargin: 20
Column{
spacing: 15
@ -126,7 +125,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluButton{
text: qsTr("Create Window")
onClicked: {
@ -136,10 +135,10 @@ FluScrollablePage{
'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 130
paddings: 10
Layout.preferredHeight: 130
padding: 10
Layout.topMargin: 20
Column{
@ -164,7 +163,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluWindowResultLauncher{
id:loginResultLauncher
path: "/login"

View File

@ -40,7 +40,6 @@ FluContentPage{
clip: true
anchors{
top: parent.top
topMargin: 20
bottom: parent.bottom
left: parent.left
}
@ -533,7 +532,7 @@ FluContentPage{
}
}
FluArea{
FluFrame{
anchors{
top: layout_flick.top
bottom: layout_flick.bottom

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Pagination")
FluArea{
FluFrame{
Layout.fillWidth: true
height: 200
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 200
padding: 10
ColumnLayout{
spacing: 20
anchors.verticalCenter: parent.verticalCenter
@ -37,7 +36,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluPagination{
pageCurrent: 1
itemCount: 1000

View File

@ -9,13 +9,10 @@ FluScrollablePage{
title: qsTr("Pivot")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 400
paddings: 10
Layout.preferredHeight: 400
padding: 10
FluPivot{
anchors.fill: parent
@ -49,7 +46,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluPivot{
anchors.fill: parent
FluPivotItem:{

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Progress")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 130
paddings: 10
Layout.preferredHeight: 130
padding: 10
ColumnLayout{
spacing: 10
@ -32,7 +31,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluProgressBar{
}
@ -42,11 +41,11 @@ FluProgressRing{
'
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 286
paddings: 10
Layout.preferredHeight: 286
padding: 10
ColumnLayout{
spacing: 10
@ -88,7 +87,7 @@ FluProgressRing{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluProgressBar{
indeterminate: false
}

View File

@ -11,7 +11,6 @@ FluScrollablePage{
FluQRCode{
id:qrcode
Layout.topMargin: 20
size:slider_size.value
text:text_box.text
color:color_picker.current

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("RadioButton")
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 68
padding: 10
Row{
spacing: 30
anchors.verticalCenter: parent.verticalCenter
@ -41,16 +40,16 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluRadioButton{
text:"Text"
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.preferredHeight: 100
padding: 10
Layout.topMargin: 20
FluRadioButtons{
spacing: 8
@ -83,7 +82,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluRadioButtons{
spacing: 8
FluRadioButton{

View File

@ -9,11 +9,10 @@ FluScrollablePage {
title: qsTr("RatingControl")
FluArea {
FluFrame {
Layout.fillWidth: true
height: 100
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 100
padding: 10
Column {
spacing: 10
@ -27,7 +26,7 @@ FluScrollablePage {
CodeExpander {
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code: 'FluRatingControl{
}'

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Rectangle")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 80
paddings: 10
Layout.preferredHeight: 80
padding: 10
Column{
spacing: 15
@ -64,7 +63,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluRectangle{
radius: [25,25,25,25]
width: 50

View File

@ -9,6 +9,6 @@ FluPage{
launchMode: FluPageType.SingleTop
FluRemoteLoader{
anchors.fill: parent
source: "https://zhu-zichu.gitee.io/Qt5_T_RemoteLoader.qml"
source: "https://zhu-zichu.gitee.io/Qt_174_RemoteLoader.qml"
}
}

View File

@ -17,11 +17,11 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 60
paddings: 10
Layout.preferredHeight: 60
padding: 10
Row{
spacing: 20
anchors.verticalCenter: parent.verticalCenter
@ -42,11 +42,11 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 50
paddings: 10
padding: 10
FluCheckBox{
text: qsTr("Use System AppBar")
checked: FluApp.useSystemAppBar
@ -58,11 +58,11 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 50
paddings: 10
padding: 10
FluCheckBox{
text:qsTr("Fits AppBar Windows")
checked: window.fitsAppBarWindows
@ -85,11 +85,11 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 128
paddings: 10
padding: 10
ColumnLayout{
spacing: 5
@ -115,11 +115,11 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 160
paddings: 10
padding: 10
ColumnLayout{
spacing: 5
@ -155,11 +155,11 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 80
paddings: 10
padding: 10
ColumnLayout{
spacing: 10

View File

@ -0,0 +1,90 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "../component"
FluScrollablePage{
title: qsTr("Sheet")
FluSheet{
id:sheet
title: qsTr("Title")
FluText{
text: qsTr("Some contents...\nSome contents...\nSome contents...")
anchors{
left: parent.left
leftMargin: 10
}
}
}
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 280
padding: 10
Column{
anchors.centerIn: parent
spacing: 10
Row{
spacing: 10
FluButton{
width: 80
height: 30
text: qsTr("top")
onClicked: {
sheet.open(FluSheetType.Top)
}
}
FluButton{
width: 80
height: 30
text: qsTr("right")
onClicked: {
sheet.open(FluSheetType.Right)
}
}
}
Row{
spacing: 10
FluButton{
width: 80
height: 30
text: qsTr("bottom")
onClicked: {
sheet.open(FluSheetType.Bottom)
}
}
FluButton{
width: 80
height: 30
text: qsTr("left")
onClicked: {
sheet.open(FluSheetType.Left)
}
}
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluSheet{
id:sheet
title: qsTr("Title")
FluText{
text: qsTr("Some contents...")
anchors{
left: parent.left
leftMargin: 10
}
}
}
sheet.open(FluSheetType.Bottom)
'
}
}

View File

@ -9,18 +9,17 @@ FluScrollablePage{
title: qsTr("ShortcutPicker")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 100
paddings: 10
Layout.preferredHeight: 100
padding: 10
FluShortcutPicker{
anchors.verticalCenter: parent.verticalCenter
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluShortcutPicker{
}'

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Slider")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 200
Layout.topMargin: 20
paddings: 10
padding: 10
Row{
spacing: 30
@ -27,18 +26,18 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluSlider{
value:50
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 200
Layout.topMargin: 20
paddings: 10
padding: 10
Row{
spacing: 30
FluRangeSlider{
@ -51,7 +50,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluRangeSlider{
orientation: Qt.Vertical
}'

View File

@ -13,7 +13,6 @@ FluContentPage{
id:layout_dropdown
anchors{
top: parent.top
topMargin: 20
}
FluText{
text:"orientation:"

View File

@ -27,7 +27,6 @@ FluContentPage{
Flickable{
id: scroll
anchors.fill: parent
anchors.topMargin: 20
boundsBehavior:Flickable.StopAtBounds
contentHeight: staggered_view.implicitHeight
clip: true
@ -43,8 +42,7 @@ FluContentPage{
FluText{
color:"#FFFFFF"
text:model.index
font.bold: true
font.pixelSize: 18
font: FluTextStyle.Title
anchors.centerIn: parent
}
}

View File

@ -9,12 +9,11 @@ FluScrollablePage{
title: qsTr("StatusLayout")
FluArea{
FluFrame{
id:layout_actions
Layout.fillWidth: true
Layout.topMargin: 20
height: 50
paddings: 10
Layout.preferredHeight: 50
padding: 10
RowLayout{
spacing: 14
FluDropDownButton{
@ -53,11 +52,11 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 10
height: 380
paddings: 10
Layout.preferredHeight: 380
padding: 10
FluStatusLayout{
id:status_view
anchors.fill: parent
@ -76,7 +75,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluStatusLayout{
anchors.fill: parent
statusMode: FluStatusLayoutType.Loading

View File

@ -29,11 +29,10 @@ FluScrollablePage{
newTab()
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 50
paddings: 10
Layout.preferredHeight: 50
padding: 10
RowLayout{
spacing: 14
FluDropDownButton{
@ -91,11 +90,11 @@ FluScrollablePage{
}
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 15
height: 400
paddings: 10
Layout.preferredHeight: 400
padding: 10
FluTabView{
id:tab_view
onNewPressed:{
@ -105,7 +104,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluTabView{
anchors.fill: parent
Component.onCompleted: {

View File

@ -159,7 +159,7 @@ FluContentPage{
FluCheckBox{
anchors.centerIn: parent
checked: true === options.checked
enableAnimation: false
animationEnabled: false
clickListener: function(){
var obj = table_view.getRow(row)
obj.checkbox = table_view.customItem(com_checbox,{checked:!options.checked})
@ -239,7 +239,7 @@ FluContentPage{
}
FluCheckBox{
checked: true === root.seletedAll
enableAnimation: false
animationEnabled: false
Layout.alignment: Qt.AlignVCenter
clickListener: function(){
root.seletedAll = !root.seletedAll
@ -390,7 +390,7 @@ FluContentPage{
}
}
FluArea{
FluFrame{
id:layout_controls
anchors{
left: parent.left

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Text")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 60
paddings: 10
Layout.preferredHeight: 60
padding: 10
FluCopyableText{
text: qsTr("This is a text that can be copied")
@ -23,7 +22,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluCopyableText{
text: qsTr("This is a text that can be copied")
}'

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("TextBox")
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 68
padding: 10
FluTextBox{
placeholderText: qsTr("Single-line Input Box")
@ -36,16 +35,16 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluTextBox{
placeholderText: qsTr("Single-line Input Box")
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.preferredHeight: 68
padding: 10
Layout.topMargin: 20
FluPasswordBox{
@ -67,16 +66,16 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluPasswordBox{
placeholderText: qsTr("Please enter your password")
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 36+multiine_textbox.height
paddings: 10
Layout.preferredHeight: 36+multiine_textbox.height
padding: 10
Layout.topMargin: 20
FluMultilineTextBox{
@ -100,16 +99,16 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluMultilineTextBox{
placeholderText: qsTr("Multi-line Input Box")
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.preferredHeight: 68
padding: 10
Layout.topMargin: 20
FluAutoSuggestBox{
placeholderText: qsTr("AutoSuggestBox")
@ -131,16 +130,16 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluAutoSuggestBox{
placeholderText: qsTr("AutoSuggestBox")
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.preferredHeight: 68
padding: 10
Layout.topMargin: 20
FluSpinBox{
disabled: spin_box_switch.checked
@ -160,7 +159,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluSpinBox{
}'

View File

@ -11,11 +11,10 @@ FluScrollablePage{
id: root
title: qsTr("Theme")
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
Layout.preferredHeight: 340
paddings: 10
padding: 10
ColumnLayout{
spacing:0
@ -115,16 +114,16 @@ FluScrollablePage{
}
FluToggleSwitch{
Layout.topMargin: 5
checked: FluTheme.enableAnimation
checked: FluTheme.animationEnabled
onClicked: {
FluTheme.enableAnimation = !FluTheme.enableAnimation
FluTheme.animationEnabled = !FluTheme.animationEnabled
}
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluTheme.accentColor = FluColors.Orange
FluTheme.dark = true

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("TimePicker")
launchMode: FluPageType.SingleInstance
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 80
paddings: 10
Layout.preferredHeight: 80
padding: 10
ColumnLayout{
@ -43,17 +42,17 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluTimePicker{
}'
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 80
paddings: 10
Layout.preferredHeight: 80
padding: 10
ColumnLayout{
@ -83,7 +82,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluTimePicker{
hourFormat:FluTimePickerType.HH
}'

View File

@ -106,7 +106,6 @@ FluScrollablePage{
RowLayout{
spacing: 20
Layout.topMargin: 20
FluTextBox{
id: text_box
text: "Technical testing 2015-09-01"

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("ToggleSwitch")
FluArea{
FluFrame{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 68
padding: 10
Row{
spacing: 30
anchors.verticalCenter: parent.verticalCenter
@ -41,7 +40,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluToggleSwitch{
text:"Text"
}'

View File

@ -10,15 +10,14 @@ FluScrollablePage{
title: qsTr("Tooltip")
FluText{
Layout.topMargin: 20
text: qsTr("Hover over Tultip and it pops up")
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 68
paddings: 10
Layout.preferredHeight: 68
padding: 10
Column{
spacing: 5
@ -41,7 +40,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluIconButton{
iconSource:FluentIcons.ChromeCloseContrast
iconSize: 15
@ -53,11 +52,11 @@ FluScrollablePage{
'
}
FluArea{
FluFrame{
Layout.fillWidth: true
Layout.topMargin: 20
height: 68
paddings: 10
Layout.preferredHeight: 68
padding: 10
Column{
spacing: 5
@ -84,7 +83,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluButton{
id: button_1
text: qsTr("Delete")

View File

@ -18,11 +18,10 @@ FluScrollablePage{
]
}
FluArea{
FluFrame{
Layout.fillWidth: true
height: 130
paddings: 10
Layout.topMargin: 20
Layout.preferredHeight: 130
padding: 10
FluFilledButton{
anchors{
@ -66,7 +65,7 @@ FluScrollablePage{
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
Layout.topMargin: -6
code:'FluTour{
id:tour
steps:[

View File

@ -33,7 +33,6 @@ FluContentPage {
spacing: 12
width: 300
anchors{
topMargin: 20
top:parent.top
left: parent.left
leftMargin: 10
@ -103,7 +102,7 @@ FluContentPage {
}
}
}
FluArea{
FluFrame{
anchors{
left: layout_column.right
top: parent.top

View File

@ -10,15 +10,14 @@ FluContentPage {
title: qsTr("Typography")
rightPadding: 10
FluArea{
FluFrame{
anchors{
top:parent.top
left: parent.left
right: parent.right
bottom: parent.bottom
topMargin: 20
}
paddings: 10
padding: 10
ColumnLayout{
spacing: 0
scale: textScale

View File

@ -9,9 +9,8 @@ FluContentPage{
title: qsTr("Watermark")
FluArea{
FluFrame{
anchors.fill: parent
anchors.topMargin: 20
ColumnLayout{
anchors{

View File

@ -8,14 +8,14 @@ import "../component"
FluWindowDialog {
id:window
title:qsTr("FluentUI Initalizr")
title:qsTr("FluentUI Initializr")
width: 600
height: 400
contentDelegate:Component{
Item{
Connections{
target: InitalizrHelper
target: InitializrHelper
function onError(message){
showError(message)
}
@ -27,7 +27,7 @@ FluWindowDialog {
FluText{
id:text_title
text:qsTr("FluentUI Initalizr")
text:qsTr("FluentUI Initializr")
font: FluTextStyle.Title
anchors{
left: parent.left
@ -102,7 +102,7 @@ FluWindowDialog {
width: 120
anchors.verticalCenter: parent.verticalCenter
onClicked: {
InitalizrHelper.generate(text_box_name.text,text_box_path.text)
InitializrHelper.generate(text_box_name.text,text_box_path.text)
}
}
}

View File

@ -20,7 +20,7 @@ FluWindow {
loader.reload()
}
}
FluArea{
FluFrame{
anchors.fill: parent
FluRemoteLoader{
id:loader
@ -41,7 +41,7 @@ FluWindow {
}
FluText{
text: qsTr("Drag in a qml file")
font.pixelSize: 26
font: FluTextStyle.Title
anchors.centerIn: parent
visible: !loader.itemLodaer().item && loader.statusMode === FluStatusLayoutType.Success
}

View File

@ -101,7 +101,7 @@ FluWindow {
width: 186
FluMenuItem{
text: qsTr("Open in Separate Window")
font.pixelSize: 12
font: FluTextStyle.Caption
onClicked: {
FluRouter.navigate("/pageWindow",{title:modelData.title,url:modelData.url})
}
@ -253,7 +253,7 @@ FluWindow {
}
function handleDarkChanged(button){
if(!FluTheme.enableAnimation || window.fitsAppBarWindows === false){
if(!FluTheme.animationEnabled || window.fitsAppBarWindows === false){
changeDark()
}else{
if(loader_reveal.sourceComponent){
@ -344,7 +344,7 @@ FluWindow {
id:callable
property bool silent: true
onStart: {
console.debug("satrt check update...")
console.debug("start check update...")
}
onFinish: {
console.debug("check update finish")

View File

@ -16,7 +16,7 @@ FluWindow {
onInitArgument:
(arg)=>{
window.title = arg.title
loader.setSource( arg.url,{animDisabled:true})
loader.setSource(arg.url,{animationEnabled:false})
}
FluLoader{
id: loader

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 MiB

View File

@ -1,16 +1,16 @@
#include "InitalizrHelper.h"
#include "InitializrHelper.h"
#include <QDir>
#include <QGuiApplication>
InitalizrHelper::InitalizrHelper(QObject *parent) : QObject(parent)
InitializrHelper::InitializrHelper(QObject *parent) : QObject(parent)
{
}
InitalizrHelper::~InitalizrHelper() = default;
InitializrHelper::~InitializrHelper() = default;
bool InitalizrHelper::copyDir(const QDir& fromDir, const QDir& toDir, bool coverIfFileExists){
bool InitializrHelper::copyDir(const QDir& fromDir, const QDir& toDir, bool coverIfFileExists){
QDir _formDir = fromDir;
QDir _toDir = toDir;
if(!_toDir.exists())
@ -44,7 +44,7 @@ bool InitalizrHelper::copyDir(const QDir& fromDir, const QDir& toDir, bool cover
}
template <typename...Args>
void InitalizrHelper::templateToFile(const QString& source,const QString& dest,Args &&...args){
void InitializrHelper::templateToFile(const QString& source,const QString& dest,Args &&...args){
QFile file(source);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&file);
@ -67,12 +67,12 @@ void InitalizrHelper::templateToFile(const QString& source,const QString& dest,A
}
}
void InitalizrHelper::copyFile(const QString& source,const QString& dest){
void InitializrHelper::copyFile(const QString& source,const QString& dest){
QFile::copy(source,dest);
QFile::setPermissions(dest, QFile::WriteOwner | QFile::WriteUser | QFile::WriteGroup | QFile::WriteOther);
}
void InitalizrHelper::generate(const QString& name,const QString& path){
void InitializrHelper::generate(const QString& name,const QString& path){
if(name.isEmpty()){
error(tr("The name cannot be empty"));
return;

View File

@ -1,26 +1,26 @@
#ifndef INITALIZRHELPER_H
#define INITALIZRHELPER_H
#ifndef INITIALIZRHELPER_H
#define INITIALIZRHELPER_H
#include <QObject>
#include <QtQml/qqml.h>
#include <QDir>
#include "src/singleton.h"
class InitalizrHelper : public QObject
class InitializrHelper : public QObject
{
Q_OBJECT
private:
explicit InitalizrHelper(QObject* parent = nullptr);
explicit InitializrHelper(QObject* parent = nullptr);
bool copyDir(const QDir& fromDir, const QDir& toDir, bool coverIfFileExists = true);
void copyFile(const QString& source,const QString& dest);
template <typename...Args>
void templateToFile(const QString& source,const QString& dest,Args &&...args);
public:
SINGLETON(InitalizrHelper)
~InitalizrHelper() override;
SINGLETON(InitializrHelper)
~InitializrHelper() override;
Q_INVOKABLE void generate(const QString& name,const QString& path);
Q_SIGNAL void error(const QString& message);
Q_SIGNAL void success(const QString& path);
};
#endif // INITALIZRHELPER_H
#endif // INITIALIZRHELPER_H

View File

@ -15,7 +15,7 @@
#include "src/component/FileWatcher.h"
#include "src/component/FpsItem.h"
#include "src/helper/SettingsHelper.h"
#include "src/helper/InitalizrHelper.h"
#include "src/helper/InitializrHelper.h"
#include "src/helper/TranslateHelper.h"
#include "src/helper/Network.h"
@ -32,6 +32,9 @@ Q_IMPORT_QML_PLUGIN(FluentUIPlugin)
int main(int argc, char *argv[])
{
const char *uri = "example";
int major = 1;
int minor = 0;
#ifdef WIN32
::SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
qputenv("QT_QPA_PLATFORM","windows:darkmode=2");
@ -54,8 +57,8 @@ int main(int argc, char *argv[])
QGuiApplication::setApplicationVersion(APPLICATION_VERSION);
QGuiApplication::setQuitOnLastWindowClosed(false);
SettingsHelper::getInstance()->init(argv);
Log::setup(argv,"example");
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
Log::setup(argv,uri);
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
#endif
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
@ -66,9 +69,6 @@ int main(int argc, char *argv[])
#endif
#endif
QGuiApplication app(argc, argv);
const char *uri = "example";
int major = 1;
int minor = 0;
//@uri example
qmlRegisterType<CircularReveal>(uri, major, minor, "CircularReveal");
qmlRegisterType<FileWatcher>(uri, major, minor, "FileWatcher");
@ -79,7 +79,7 @@ int main(int argc, char *argv[])
TranslateHelper::getInstance()->init(&engine);
engine.rootContext()->setContextProperty("AppInfo",AppInfo::getInstance());
engine.rootContext()->setContextProperty("SettingsHelper",SettingsHelper::getInstance());
engine.rootContext()->setContextProperty("InitalizrHelper",InitalizrHelper::getInstance());
engine.rootContext()->setContextProperty("InitializrHelper",InitializrHelper::getInstance());
engine.rootContext()->setContextProperty("TranslateHelper",TranslateHelper::getInstance());
engine.rootContext()->setContextProperty("Network",Network::getInstance());
#ifdef FLUENTUI_BUILD_STATIC_LIB
@ -94,7 +94,7 @@ int main(int argc, char *argv[])
engine.load(url);
const int exec = QGuiApplication::exec();
if (exec == 931) {
QProcess::startDetached(qApp->applicationFilePath(), QStringList());
QProcess::startDetached(qApp->applicationFilePath(), qApp->arguments());
}
return exec;
}

View File

@ -4,6 +4,17 @@
#include <QObject>
#include <QtQml/qqml.h>
namespace FluSheetType {
Q_NAMESPACE
enum Position {
Left = 0x0000,
Top = 0x0001,
Right = 0x0002,
Bottom = 0x0004,
};
Q_ENUM_NS(Position)
QML_NAMED_ELEMENT(FluSheetType)
}
namespace FluThemeType {
Q_NAMESPACE

View File

@ -1,4 +1,5 @@
#include "FluColors.h"
#include "FluTools.h"
FluColors::FluColors(QObject *parent):QObject{parent}{
Transparent(QColor(0, 0, 0, 0));
@ -111,17 +112,12 @@ FluColors::FluColors(QObject *parent):QObject{parent}{
FluAccentColor* FluColors::createAccentColor(QColor primaryColor){
FluAccentColor *accentColor = new FluAccentColor(this);
accentColor->darkest(withOpacity(primaryColor,0.7));
accentColor->darker(withOpacity(primaryColor,0.8));
accentColor->dark(withOpacity(primaryColor,0.9));
accentColor->darkest(FluTools::getInstance()->withOpacity(primaryColor,0.7));
accentColor->darker(FluTools::getInstance()->withOpacity(primaryColor,0.8));
accentColor->dark(FluTools::getInstance()->withOpacity(primaryColor,0.9));
accentColor->normal(primaryColor);
accentColor->light(withOpacity(primaryColor,0.9));
accentColor->lighter(withOpacity(primaryColor,0.8));
accentColor->lightest(withOpacity(primaryColor,0.7));
accentColor->light(FluTools::getInstance()->withOpacity(primaryColor,0.9));
accentColor->lighter(FluTools::getInstance()->withOpacity(primaryColor,0.8));
accentColor->lightest(FluTools::getInstance()->withOpacity(primaryColor,0.7));
return accentColor;
}
QColor FluColors::withOpacity(QColor color,qreal opacity){
int alpha = qRound(opacity * 255) & 0xff;
return QColor::fromRgba((alpha << 24) | (color.rgba() & 0xffffff));
}

View File

@ -3,6 +3,7 @@
#include <QObject>
#include <QtQml/qqml.h>
#include "FluAccentColor.h"
#include "stdafx.h"
#include "singleton.h"
@ -50,7 +51,6 @@ class FluColors : public QObject
QML_SINGLETON
private:
explicit FluColors(QObject *parent = nullptr);
QColor withOpacity(QColor color,qreal opacity);
public:
SINGLETON(FluColors)
Q_INVOKABLE FluAccentColor* createAccentColor(QColor primaryColor);

View File

@ -3,6 +3,7 @@
#include <QQuickWindow>
#include <QGuiApplication>
#include <QScreen>
#include <QDateTime>
#ifdef Q_OS_WIN
#pragma comment (lib,"user32.lib")
@ -45,6 +46,9 @@ FluFrameless::FluFrameless(QQuickItem *parent)
}
FluFrameless::~FluFrameless(){
}
void FluFrameless::onDestruction(){
qApp->removeNativeEventFilter(this);
}
@ -54,14 +58,16 @@ void FluFrameless::componentComplete(){
}
_current = window()->winId();
window()->setFlags(( window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint);
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
if(QQuickWindow::sceneGraphBackend() == "software"){
window()->setFlag(Qt::FramelessWindowHint,false);
}
#endif
if(!_fixSize){
window()->setFlag(Qt::WindowMaximizeButtonHint);
}
window()->installEventFilter(this);
qApp->installNativeEventFilter(this);
if(_appbar){
_appbar->installEventFilter(this);
}
if(_maximizeButton){
setHitTestVisible(_maximizeButton);
}
@ -151,6 +157,7 @@ bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
clientRect->left = originalLeft + offsetSize;
clientRect->right = originalRight - offsetSize;
}
_setMaximizeHovered(false);
*result = WVR_REDRAW;
return true;
}else if(uMsg == WM_NCHITTEST){
@ -158,8 +165,11 @@ bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
if (*result == HTNOWHERE) {
*result = HTZOOM;
}
_setMaximizeHovered(true);
return true;
}
_setMaximizeHovered(false);
_setMaximizePressed(false);
*result = 0;
POINT nativeGlobalPos{GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
POINT nativeLocalPos = nativeGlobalPos;
@ -195,8 +205,7 @@ bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
if (0 != *result) {
return true;
}
auto aa = _hitAppBar();
if(aa){
if(_hitAppBar()){
*result = HTCAPTION;
return true;
}
@ -206,12 +215,14 @@ bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
if(_hitMaximizeButton()){
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QGuiApplication::sendEvent(_maximizeButton,&event);
_setMaximizePressed(true);
return true;
}
}else if(uMsg == WM_NCLBUTTONUP || uMsg == WM_NCRBUTTONUP){
if(_hitMaximizeButton()){
QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QGuiApplication::sendEvent(_maximizeButton,&event);
_setMaximizePressed(false);
return true;
}
}else if(uMsg == WM_NCPAINT){
@ -222,12 +233,6 @@ bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
return true;
}else if(uMsg == WM_GETMINMAXINFO){
MINMAXINFO* minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
minmaxInfo->ptMaxPosition.x = 0;
minmaxInfo->ptMaxPosition.y = 0;
minmaxInfo->ptMaxSize.x = 0;
minmaxInfo->ptMaxSize.y = 0;
#else
auto pixelRatio = window()->devicePixelRatio();
auto geometry = window()->screen()->availableGeometry();
RECT rect;
@ -236,7 +241,6 @@ bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
minmaxInfo->ptMaxPosition.y = rect.top - offsetXY.x();
minmaxInfo->ptMaxSize.x = geometry.width()*pixelRatio + offsetXY.x() * 2;
minmaxInfo->ptMaxSize.y = geometry.height()*pixelRatio + offsetXY.y() * 2;
#endif
return false;
}else if(uMsg == WM_NCRBUTTONDOWN){
if (wParam == HTCAPTION) {
@ -332,6 +336,14 @@ bool FluFrameless::_hitMaximizeButton(){
return false;
}
void FluFrameless::_setMaximizePressed(bool val){
_maximizeButton->setProperty("down",val);
}
void FluFrameless::_setMaximizeHovered(bool val){
_maximizeButton->setProperty("hover",val);
}
void FluFrameless::_updateCursor(int edges){
switch (edges) {
case 0:
@ -378,7 +390,9 @@ void FluFrameless::showNormal(){
}
void FluFrameless::setHitTestVisible(QQuickItem* val){
_hitTestList.append(val);
if(!_hitTestList.contains(val)){
_hitTestList.append(val);
}
}
@ -407,7 +421,18 @@ bool FluFrameless::eventFilter(QObject *obj, QEvent *ev){
}
}else{
if(_hitAppBar()){
window()->startSystemMove();
qint64 clickTimer = QDateTime::currentMSecsSinceEpoch();
qint64 offset = clickTimer - this->_clickTimer;
this->_clickTimer = clickTimer;
if(offset<300){
if(_isMaximized()){
showNormal();
}else{
showMaximized();
}
}else{
window()->startSystemMove();
}
}
}
break;

View File

@ -36,6 +36,7 @@ public:
Q_INVOKABLE void showMinimized();
Q_INVOKABLE void showNormal();
Q_INVOKABLE void setHitTestVisible(QQuickItem*);
Q_INVOKABLE void onDestruction();
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
private:
@ -47,11 +48,13 @@ private:
bool _containsCursorToItem(QQuickItem* item);
bool _hitAppBar();
bool _hitMaximizeButton();
qint64 _current;
void _setMaximizePressed(bool val);
void _setMaximizeHovered(bool val);
private:
qint64 _current;
int _edges = 0;
int _margins = 8;
qint64 _clickTimer = 0;
QList<QPointer<QQuickItem>> _hitTestList;
};

View File

@ -1,35 +1,47 @@
#include "FluTextStyle.h"
FluTextStyle::FluTextStyle(QObject *parent):QObject{parent}{
_family = QFont().defaultFamily();
#ifdef Q_OS_WIN
_family = "微软雅黑";
#endif
QFont caption;
caption.setFamily(_family);
caption.setPixelSize(12);
Caption(caption);
QFont body;
body.setFamily(_family);
body.setPixelSize(13);
Body(body);
QFont bodyStrong;
bodyStrong.setFamily(_family);
bodyStrong.setPixelSize(13);
bodyStrong.setWeight(QFont::DemiBold);
BodyStrong(bodyStrong);
QFont subtitle;
subtitle.setFamily(_family);
subtitle.setPixelSize(20);
subtitle.setWeight(QFont::DemiBold);
Subtitle(subtitle);
QFont title;
title.setFamily(_family);
title.setPixelSize(28);
title.setWeight(QFont::DemiBold);
Title(title);
QFont titleLarge;
titleLarge.setFamily(_family);
titleLarge.setPixelSize(40);
titleLarge.setWeight(QFont::DemiBold);
TitleLarge(titleLarge);
QFont display;
display.setFamily(_family);
display.setPixelSize(68);
display.setWeight(QFont::DemiBold);
Display(display);

View File

@ -14,6 +14,7 @@ class FluTextStyle : public QObject
{
Q_OBJECT
public:
Q_PROPERTY_AUTO(QString,family)
Q_PROPERTY_AUTO(QFont,Caption);
Q_PROPERTY_AUTO(QFont,Body);
Q_PROPERTY_AUTO(QFont,BodyStrong);

View File

@ -14,7 +14,7 @@ FluTheme::FluTheme(QObject *parent):QObject{parent}{
accentColor(FluColors::getInstance()->Blue());
darkMode(FluThemeType::DarkMode::Light);
nativeText(false);
enableAnimation(true);
animationEnabled(true);
_systemDark = systemDark();
qApp->installEventFilter(this);
}

View File

@ -32,7 +32,7 @@ class FluTheme : public QObject
Q_PROPERTY_AUTO(QColor,itemCheckColor);
Q_PROPERTY_AUTO(int,darkMode);
Q_PROPERTY_AUTO(bool,nativeText);
Q_PROPERTY_AUTO(bool,enableAnimation);
Q_PROPERTY_AUTO(bool,animationEnabled);
QML_NAMED_ELEMENT(FluTheme)
QML_SINGLETON
private:

View File

@ -119,8 +119,9 @@ QUrl FluTools::getUrlByFilePath(const QString& path){
return QUrl::fromLocalFile(path);
}
QColor FluTools::colorAlpha(const QColor& color,qreal alpha){
return QColor(color.red(),color.green(),color.blue(),255*alpha);
QColor FluTools::withOpacity(const QColor& color,qreal opacity){
int alpha = qRound(opacity * 255) & 0xff;
return QColor::fromRgba((alpha << 24) | (color.rgba() & 0xffffff));
}
QString FluTools::md5(QString text){

View File

@ -39,7 +39,7 @@ public:
Q_INVOKABLE QRect getVirtualGeometry();
Q_INVOKABLE QString getApplicationDirPath();
Q_INVOKABLE QUrl getUrlByFilePath(const QString& path);
Q_INVOKABLE QColor colorAlpha(const QColor&,qreal alpha);
Q_INVOKABLE QColor withOpacity(const QColor&,qreal alpha);
Q_INVOKABLE QString md5(QString text);
Q_INVOKABLE QString sha256(QString text);
Q_INVOKABLE QString toBase64(QString text);

View File

@ -2,7 +2,7 @@
#include <QMetaEnum>
FluNode::FluNode(QObject *parent): QObject{parent}{
FluTreeNode::FluTreeNode(QObject *parent): QObject{parent}{
}
FluTreeModel::FluTreeModel(QObject *parent): QAbstractItemModel{parent}{
@ -41,7 +41,7 @@ QHash<int, QByteArray> FluTreeModel::roleNames() const {
return { {Qt::DisplayRole, "dataModel"} };
};
void FluTreeModel::setData(QList<FluNode*> data){
void FluTreeModel::setData(QList<FluTreeNode*> data){
beginResetModel();
_rows = data;
endResetModel();
@ -51,20 +51,20 @@ void FluTreeModel::removeRows(int row,int count){
if (row < 0 || row + count > _rows.size() || count==0)
return;
beginRemoveRows(QModelIndex(),row, row + count - 1);
QList<FluNode*> firstPart = _rows.mid(0,row);
QList<FluNode*> secondPart = _rows.mid(row + count);
QList<FluTreeNode*> firstPart = _rows.mid(0,row);
QList<FluTreeNode*> secondPart = _rows.mid(row + count);
_rows.clear();
_rows.append(firstPart);
_rows.append(secondPart);
endRemoveRows();
}
void FluTreeModel::insertRows(int row,QList<FluNode*> data){
void FluTreeModel::insertRows(int row,QList<FluTreeNode*> data){
if (row < 0 || row > _rows.size() || data.size() == 0)
return;;
beginInsertRows(QModelIndex(), row, row + data.size() - 1);
QList<FluNode*> firstPart = _rows.mid(0, row);
QList<FluNode*> secondPart = _rows.mid(row);
QList<FluTreeNode*> firstPart = _rows.mid(0, row);
QList<FluTreeNode*> secondPart = _rows.mid(row);
_rows.clear();
_rows.append(firstPart);
_rows.append(data);
@ -76,18 +76,18 @@ QObject* FluTreeModel::getRow(int row){
return _rows.at(row);
}
void FluTreeModel::checkRow(int row,bool chekced){
void FluTreeModel::checkRow(int row,bool checked){
auto itemData = _rows.at(row);
if(itemData->hasChildren()){
QList<FluNode*> stack = itemData->_children;
QList<FluTreeNode*> stack = itemData->_children;
std::reverse(stack.begin(), stack.end());
while (stack.count() > 0) {
auto item = stack.at(stack.count()-1);
stack.pop_back();
if(!item->hasChildren()){
item->_checked = chekced;
item->_checked = checked;
}
QList<FluNode*> children = item->_children;
QList<FluTreeNode*> children = item->_children;
if(!children.isEmpty()){
std::reverse(children.begin(), children.end());
foreach (auto c, children) {
@ -96,13 +96,13 @@ void FluTreeModel::checkRow(int row,bool chekced){
}
}
}else{
if(itemData->_checked == chekced){
if(itemData->_checked == checked){
return;
}
itemData->_checked = chekced;
itemData->_checked = checked;
}
Q_EMIT layoutChanged(QList<QPersistentModelIndex>(),QAbstractItemModel::VerticalSortHint);
QList<FluNode*> data;
Q_EMIT dataChanged(index(0,0),index(rowCount()-1,0));
QList<FluTreeNode*> data;
foreach (auto item, _dataSource) {
if(!item->hasChildren()){
if(item->_checked){
@ -119,16 +119,16 @@ void FluTreeModel::setDataSource(QList<QMap<QString,QVariant>> data){
delete _root;
_root = nullptr;
}
_root = new FluNode(this);
_root = new FluTreeNode(this);
std::reverse(data.begin(), data.end());
while (data.count() > 0) {
auto item = data.at(data.count()-1);
data.pop_back();
FluNode* node = new FluNode(this);
FluTreeNode* node = new FluTreeNode(this);
node->_title = item.value("title").toString();
node->_key = item.value("key").toString();
node->_depth = item.value("__depth").toInt();
node->_parent = item.value("__parent").value<FluNode*>();
node->_parent = item.value("__parent").value<FluTreeNode*>();
node->_isExpanded = true;
if(node->_parent){
node->_parent->_children.append(node);
@ -181,8 +181,8 @@ void FluTreeModel::expand(int row){
_rows.at(row)->_isExpanded = true;
Q_EMIT dataChanged(index(row,0),index(row,0));
auto modelData = _rows.at(row);
QList<FluNode*> insertData;
QList<FluNode*> stack = modelData->_children;
QList<FluTreeNode*> insertData;
QList<FluTreeNode*> stack = modelData->_children;
std::reverse(stack.begin(), stack.end());
while (stack.count() > 0) {
auto item = stack.at(stack.count()-1);
@ -190,7 +190,7 @@ void FluTreeModel::expand(int row){
if(item->isShown()){
insertData.append(item);
}
QList<FluNode*> children = item->_children;
QList<FluTreeNode*> children = item->_children;
if(!children.isEmpty()){
std::reverse(children.begin(), children.end());
foreach (auto c, children) {
@ -201,7 +201,7 @@ void FluTreeModel::expand(int row){
insertRows(row+1,insertData);
}
void FluTreeModel::dragAnddrop(int dragIndex,int dropIndex,bool isDropTopArea){
void FluTreeModel::dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea){
if(dropIndex>_rows.count() || dropIndex<0){
return;
}
@ -242,7 +242,7 @@ void FluTreeModel::dragAnddrop(int dragIndex,int dropIndex,bool isDropTopArea){
Q_EMIT layoutAboutToBeChanged();
if(dragItem->_parent == dropItem->_parent){
QList<FluNode*>* children = &(dragItem->_parent->_children);
QList<FluTreeNode*>* children = &(dragItem->_parent->_children);
int srcIndex = children->indexOf(dragItem);
int destIndex = children->indexOf(dropItem);
if(dropIndex > dragIndex){
@ -260,14 +260,14 @@ void FluTreeModel::dragAnddrop(int dragIndex,int dropIndex,bool isDropTopArea){
}
children->move(srcIndex,targetIndex);
}else{
QList<FluNode*>* srcChildren = &(dragItem->_parent->_children);
QList<FluNode*>* destChildren = &(dropItem->_parent->_children);
QList<FluTreeNode*>* srcChildren = &(dragItem->_parent->_children);
QList<FluTreeNode*>* destChildren = &(dropItem->_parent->_children);
int srcIndex = srcChildren->indexOf(dragItem);
int destIndex = destChildren->indexOf(dropItem);
dragItem->_depth = dropItem->_depth;
dragItem->_parent = dropItem->_parent;
if(dragItem->hasChildren()){
QList<FluNode*> stack = dragItem->_children;
QList<FluTreeNode*> stack = dragItem->_children;
foreach (auto node, stack) {
node->_depth = dragItem->_depth+1;
}
@ -275,7 +275,7 @@ void FluTreeModel::dragAnddrop(int dragIndex,int dropIndex,bool isDropTopArea){
while (stack.count() > 0) {
auto item = stack.at(stack.count()-1);
stack.pop_back();
QList<FluNode*> children = item->_children;
QList<FluTreeNode*> children = item->_children;
if(!children.isEmpty()){
std::reverse(children.begin(), children.end());
foreach (auto c, children) {
@ -302,8 +302,7 @@ void FluTreeModel::dragAnddrop(int dragIndex,int dropIndex,bool isDropTopArea){
destChildren->insert(targetIndex,dragItem);
}
changePersistentIndex(index(qMin(dragIndex,dropIndex),0),index(qMax(dragIndex,dropIndex),0));
Q_EMIT layoutChanged(QList<QPersistentModelIndex>(),QAbstractItemModel::VerticalSortHint);
Q_EMIT dataChanged(index(0,0),index(rowCount()-1,0));
}
bool FluTreeModel::hitHasChildrenExpanded(int row){
@ -318,14 +317,14 @@ void FluTreeModel::refreshNode(int row){
Q_EMIT dataChanged(index(row,0),index(row,0));
};
FluNode* FluTreeModel::getNode(int row){
FluTreeNode* FluTreeModel::getNode(int row){
return _rows.at(row);
}
void FluTreeModel::allExpand(){
beginResetModel();
QList<FluNode*> data;
QList<FluNode*> stack = _root->_children;
QList<FluTreeNode*> data;
QList<FluTreeNode*> stack = _root->_children;
std::reverse(stack.begin(), stack.end());
while (stack.count() > 0) {
auto item = stack.at(stack.count()-1);
@ -334,7 +333,7 @@ void FluTreeModel::allExpand(){
item->_isExpanded = true;
}
data.append(item);
QList<FluNode*> children = item->_children;
QList<FluTreeNode*> children = item->_children;
if(!children.isEmpty()){
std::reverse(children.begin(), children.end());
foreach (auto c, children) {
@ -347,7 +346,7 @@ void FluTreeModel::allExpand(){
}
void FluTreeModel::allCollapse(){
beginResetModel();
QList<FluNode*> stack = _root->_children;
QList<FluTreeNode*> stack = _root->_children;
std::reverse(stack.begin(), stack.end());
while (stack.count() > 0) {
auto item = stack.at(stack.count()-1);
@ -355,7 +354,7 @@ void FluTreeModel::allCollapse(){
if(item->hasChildren()){
item->_isExpanded = false;
}
QList<FluNode*> children = item->_children;
QList<FluTreeNode*> children = item->_children;
if(!children.isEmpty()){
std::reverse(children.begin(), children.end());
foreach (auto c, children) {

View File

@ -8,9 +8,9 @@
#include "stdafx.h"
/**
* @brief The FluNode class
* @brief The FluTreeNode class
*/
class FluNode : public QObject{
class FluTreeNode : public QObject{
Q_OBJECT
Q_PROPERTY(QString key READ key CONSTANT)
Q_PROPERTY(QString title READ title CONSTANT)
@ -18,14 +18,14 @@ class FluNode : public QObject{
Q_PROPERTY(bool isExpanded READ isExpanded CONSTANT)
Q_PROPERTY(bool checked READ checked CONSTANT)
public:
explicit FluNode(QObject *parent = nullptr);
explicit FluTreeNode(QObject *parent = nullptr);
Q_INVOKABLE QString key(){return _key;};
Q_INVOKABLE QString title(){return _title;};
Q_INVOKABLE int depth(){return _depth;};
Q_INVOKABLE bool isExpanded(){return _isExpanded;};
Q_INVOKABLE bool hasChildren(){ return !_children.isEmpty();};
Q_INVOKABLE bool hasNextNodeByIndex(int index){
FluNode* p = this;
FluTreeNode* p = this;
for(int i=0;i<(_depth - index -1);i++){
p = p->_parent;
}
@ -75,15 +75,15 @@ public:
int _depth=0;
bool _checked = false;
bool _isExpanded=true;
QList<FluNode*> _children;
FluNode* _parent = nullptr;
QList<FluTreeNode*> _children;
FluTreeNode* _parent = nullptr;
};
class FluTreeModel : public QAbstractItemModel
{
Q_OBJECT
Q_PROPERTY_AUTO(int,dataSourceSize)
Q_PROPERTY_AUTO(QList<FluNode*>,selectionModel)
Q_PROPERTY_AUTO(QList<FluTreeNode*>,selectionModel)
QML_NAMED_ELEMENT(FluTreeModel)
QML_ADDED_IN_MINOR_VERSION(1)
public:
@ -96,23 +96,23 @@ public:
QModelIndex index(int row, int column,const QModelIndex &parent = QModelIndex()) const override;
Q_INVOKABLE void removeRows(int row,int count);
Q_INVOKABLE void insertRows(int row,QList<FluNode*> data);
Q_INVOKABLE void insertRows(int row,QList<FluTreeNode*> data);
Q_INVOKABLE QObject* getRow(int row);
Q_INVOKABLE void setData(QList<FluNode*> data);
Q_INVOKABLE void setData(QList<FluTreeNode*> data);
Q_INVOKABLE void setDataSource(QList<QMap<QString,QVariant>> data);
Q_INVOKABLE void collapse(int row);
Q_INVOKABLE void expand(int row);
Q_INVOKABLE void dragAnddrop(int dragIndex,int dropIndex,bool isDropTopArea);
Q_INVOKABLE FluNode* getNode(int row);
Q_INVOKABLE void dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea);
Q_INVOKABLE FluTreeNode* getNode(int row);
Q_INVOKABLE void refreshNode(int row);
Q_INVOKABLE void checkRow(int row,bool chekced);
Q_INVOKABLE void checkRow(int row,bool checked);
Q_INVOKABLE bool hitHasChildrenExpanded(int row);
Q_INVOKABLE void allExpand();
Q_INVOKABLE void allCollapse();
private:
QList<FluNode*> _rows;
QList<FluNode*> _dataSource;
FluNode* _root = nullptr;
QList<FluTreeNode*> _rows;
QList<FluTreeNode*> _dataSource;
FluTreeNode* _root = nullptr;
};
#endif // FLUTREEMODEL_H

View File

@ -36,7 +36,7 @@ void FluentUI::registerTypes(const char *uri){
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluAcrylic.qml"),uri,major,minor,"FluAcrylic");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluAppBar.qml"),uri,major,minor,"FluAppBar");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluArea.qml"),uri,major,minor,"FluArea");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluFrame.qml"),uri,major,minor,"FluFrame");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluAutoSuggestBox.qml"),uri,major,minor,"FluAutoSuggestBox");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluBadge.qml"),uri,major,minor,"FluBadge");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluBreadcrumbBar.qml"),uri,major,minor,"FluBreadcrumbBar");
@ -124,6 +124,9 @@ void FluentUI::registerTypes(const char *uri){
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluWindowResultLauncher.qml"),uri,major,minor,"FluWindowResultLauncher");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLauncher.qml"),uri,major,minor,"FluLauncher");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluEvent.qml"),uri,major,minor,"FluEvent");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSheet.qml"),uri,major,minor,"FluSheet");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluGroupBox.qml"),uri,major,minor,"FluGroupBox");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluControlBackground.qml"),uri,major,minor,"FluControlBackground");
qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRouter.qml"),uri,major,minor,"FluRouter");
qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluEventBus.qml"),uri,major,minor,"FluEventBus");
@ -139,17 +142,13 @@ void FluentUI::registerTypes(const char *uri){
qmlRegisterUncreatableMetaObject(FluTabViewType::staticMetaObject, uri,major,minor,"FluTabViewType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluNavigationViewType::staticMetaObject, uri,major,minor,"FluNavigationViewType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri,major,minor,"FluTimelineType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluSheetType::staticMetaObject, uri,major,minor,"FluSheetType", "Access to enums & flags only");
qmlRegisterModule(uri,major,minor);
#endif
}
void FluentUI::initializeEngine(QQmlEngine *engine, const char *uri){
#ifdef Q_OS_WIN
QFont font;
font.setFamily("微软雅黑");
QGuiApplication::setFont(font);
#endif
engine->rootContext()->setContextProperty("FluApp",FluApp::getInstance());
engine->rootContext()->setContextProperty("FluColors",FluColors::getInstance());
engine->rootContext()->setContextProperty("FluTheme",FluTheme::getInstance());

View File

@ -225,6 +225,7 @@ Rectangle{
}
FluIconButton{
id:btn_maximize
property bool hover: btn_maximize.hovered
Layout.preferredWidth: 40
Layout.preferredHeight: 30
padding: 0
@ -232,10 +233,10 @@ Rectangle{
horizontalPadding: 0
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
color: {
if(pressed){
if(down){
return maximizePressColor
}
return hovered ? maximizeHoverColor : maximizeNormalColor
return btn_maximize.hover ? maximizeHoverColor : maximizeNormalColor
}
Layout.alignment: Qt.AlignVCenter
visible: d.resizable && !isMac && showMaximize

View File

@ -1,28 +0,0 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import FluentUI 1.0
Rectangle {
default property alias contentData : layout_content.data
property int paddings : 0
property int leftPadding : 0
property int rightPadding : 0
property int topPadding : 0
property int bottomPadding : 0
id:control
radius: 4
color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
border.width: 1
implicitHeight: height
implicitWidth: width
Item {
id: layout_content
anchors.fill: parent
anchors.leftMargin: Math.max(paddings,leftPadding)
anchors.rightMargin: Math.max(paddings,rightPadding)
anchors.topMargin: Math.max(paddings,topPadding)
anchors.bottomMargin: Math.max(paddings,bottomPadding)
}
}

View File

@ -56,7 +56,7 @@ FluTextBox{
property: "opacity"
from:0
to:1
duration: FluTheme.enableAnimation ? 83 : 0
duration: FluTheme.animationEnabled ? 83 : 0
}
}
contentItem: FluRectangle{

View File

@ -33,7 +33,7 @@ Item {
properties: "opacity"
from: 1
to: 0
duration: FluTheme.enableAnimation ? 83 : 1
duration: FluTheme.animationEnabled ? 83 : 1
}
}
add: Transition {
@ -41,7 +41,7 @@ Item {
properties: "opacity"
from: 0
to: 1
duration: FluTheme.enableAnimation ? 83 : 1
duration: FluTheme.animationEnabled ? 83 : 1
}
}
delegate: Item{

View File

@ -7,7 +7,7 @@ Button {
property string contentDescription: ""
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(246/255,246/255,246/255,1)
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(244/255,244/255,244/255,1)
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(251/255,251/255,251/255,1)
property color dividerColor: FluTheme.dark ? Qt.rgba(80/255,80/255,80/255,1) : Qt.rgba(233/255,233/255,233/255,1)
property color textColor: {
if(FluTheme.dark){
@ -38,18 +38,17 @@ Button {
horizontalPadding:12
font:FluTextStyle.Body
focusPolicy:Qt.TabFocus
background: Rectangle{
implicitWidth: 28
implicitHeight: 28
border.color: control.dividerColor
border.width: 1
background: FluControlBackground{
implicitWidth: 30
implicitHeight: 30
radius: 4
color:{
color: {
if(!enabled){
return disableColor
}
return hovered ? hoverColor :normalColor
}
shadow: !pressed && enabled
FluFocusRectangle{
visible: control.activeFocus
radius:4

View File

@ -63,7 +63,7 @@ FluButton {
property: "opacity"
from:0
to:1
duration: FluTheme.enableAnimation ? 83 : 0
duration: FluTheme.animationEnabled ? 83 : 0
}
}
exit:Transition {
@ -71,12 +71,12 @@ FluButton {
property: "opacity"
from:1
to:0
duration: FluTheme.enableAnimation ? 83 : 0
duration: FluTheme.animationEnabled ? 83 : 0
}
}
contentItem: Item{
clip: true
FluArea{
FluFrame{
id:container
width: 300
height: 360
@ -163,7 +163,7 @@ FluButton {
OpacityAnimator{
from: 0
to: 1
duration: 88
duration: 83
}
ScaleAnimator{
from: 0.5
@ -176,7 +176,7 @@ FluButton {
OpacityAnimator{
from: 1
to: 0
duration: 88
duration: 83
}
ScaleAnimator{
from: 1.0
@ -449,7 +449,7 @@ FluButton {
DayOfWeekRow {
id: dayOfWeekRow
locale: FluApp.locale
font.bold: false
font: FluTextStyle.Body
delegate: Label {
text: model.shortName
font: dayOfWeekRow.font

View File

@ -22,7 +22,7 @@ Button {
property alias textColor: btn_text.textColor
property bool textRight: true
property real textSpacing: 6
property bool enableAnimation: FluTheme.enableAnimation
property bool animationEnabled: FluTheme.animationEnabled
property var clickListener : function(){
checked = !checked
}
@ -41,6 +41,8 @@ Button {
visible: control.activeFocus
}
}
focusPolicy:Qt.TabFocus
font:FluTextStyle.Body
horizontalPadding:0
verticalPadding: 0
padding: 0
@ -48,7 +50,6 @@ Button {
Accessible.name: control.text
Accessible.description: contentDescription
Accessible.onPressAction: control.clicked()
focusPolicy:Qt.TabFocus
contentItem: RowLayout{
spacing: control.textSpacing
layoutDirection:control.textRight ? Qt.LeftToRight : Qt.RightToLeft
@ -94,7 +95,7 @@ Button {
return normalColor
}
Behavior on color {
enabled: control.enableAnimation
enabled: control.animationEnabled
ColorAnimation{
duration: 83
}
@ -107,7 +108,7 @@ Button {
visible: indeterminate
iconColor: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
Behavior on visible {
enabled: control.enableAnimation
enabled: control.animationEnabled
NumberAnimation{
duration: 83
}
@ -121,7 +122,7 @@ Button {
visible: checked && !indeterminate
iconColor: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
Behavior on visible {
enabled: control.enableAnimation
enabled: control.animationEnabled
NumberAnimation{
duration: 83
}
@ -133,6 +134,7 @@ Button {
text: control.text
Layout.alignment: Qt.AlignVCenter
visible: text !== ""
font: control.font
}
}
}

View File

@ -45,7 +45,7 @@ T.ComboBox {
topPadding: 6 - control.padding
bottomPadding: 6 - control.padding
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.5)
selectionColor: FluTools.withOpacity(FluTheme.primaryColor,0.5)
selectedTextColor: color
text: control.editable ? control.editText : control.displayText
enabled: control.editable
@ -62,12 +62,14 @@ T.ComboBox {
validator: control.validator
selectByMouse: true
verticalAlignment: Text.AlignVCenter
leftInset:1
topInset:1
bottomInset:1
rightInset:1
background: FluTextBoxBackground{
borderWidth: 0
border.width: 1
bottomMargin: {
if(!control.editable){
return 1
}
return contentItem && contentItem.activeFocus ? 2 : 1
}
inputItem: contentItem
}
Component.onCompleted: {
@ -120,7 +122,7 @@ T.ComboBox {
property: "opacity"
from:0
to:1
duration: FluTheme.enableAnimation ? 83 : 0
duration: FluTheme.animationEnabled ? 83 : 0
}
}
exit:Transition {
@ -128,7 +130,7 @@ T.ComboBox {
property: "opacity"
from:1
to:0
duration: FluTheme.enableAnimation ? 83 : 0
duration: FluTheme.animationEnabled ? 83 : 0
}
}
background:Rectangle{

View File

@ -5,56 +5,4 @@ import QtQuick.Controls 2.15
import FluentUI 1.0
FluPage {
property alias title: text_title.text
default property alias content: container.data
property int leftPadding: 10
property int topPadding: 0
property int rightPadding: 10
property int bottomPadding: 10
property alias color: status_view.color
property alias statusMode: status_view.statusMode
property alias loadingText: status_view.loadingText
property alias emptyText:status_view.emptyText
property alias errorText:status_view.errorText
property alias errorButtonText:status_view.errorButtonText
property alias loadingItem :status_view.loadingItem
property alias emptyItem : status_view.emptyItem
property alias errorItem :status_view.errorItem
signal errorClicked
id:control
FluText{
id:text_title
visible: text !== ""
height: visible ? contentHeight : 0
font: FluTextStyle.Title
anchors{
top: parent.top
topMargin: control.topPadding
left: parent.left
right: parent.right
leftMargin: control.leftPadding
rightMargin: control.rightPadding
}
}
FluStatusLayout{
id:status_view
color: "#00000000"
statusMode: FluStatusLayoutType.Success
onErrorClicked: control.errorClicked()
anchors{
left: parent.left
right: parent.right
top: text_title.bottom
bottom: parent.bottom
leftMargin: control.leftPadding
rightMargin: control.rightPadding
bottomMargin: control.bottomPadding
}
Item{
clip: true
id:container
anchors.fill: parent
}
}
}

View File

@ -0,0 +1,52 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
Item{
id:control
property int radius: 4
property bool shadow: true
property alias border: d.border
property var bottomMargin: undefined
property var topMargin: undefined
property var leftMargin: undefined
property var rightMargin: undefined
property color color: FluTheme.dark ? Qt.rgba(42/255,42/255,42/255,1) : Qt.rgba(254/255,254/255,254/255,1)
property alias gradient : rect_border.gradient
Rectangle{
id:d
property color startColor: Qt.lighter(d.border.color,1.25)
property color endColor: shadow ? control.border.color : startColor
visible: false
border.color: FluTheme.dark ? Qt.rgba(48/255,48/255,48/255,1) : Qt.rgba(188/255,188/255,188/255,1)
}
Rectangle{
id:rect_border
anchors.fill: parent
radius: control.radius
gradient: Gradient {
GradientStop { position: 0.0; color: d.startColor }
GradientStop { position: 1 - 3/control.height; color: d.startColor }
GradientStop { position: 1.0; color: d.endColor}
}
}
Rectangle{
id:rect_back
anchors{
fill: parent
margins: control.border.width
topMargin: control.topMargin
bottomMargin: control.bottomMargin
leftMargin: control.leftMargin
rightMargin: control.rightMargin
}
Behavior on anchors.bottomMargin {
NumberAnimation{
easing.type: Easing.OutCubic
duration: 167
}
}
radius: control.radius
color: control.color
}
}

View File

@ -17,7 +17,7 @@ TextEdit {
selectByMouse: true
selectedTextColor: color
bottomPadding: 0
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.5)
selectionColor: FluTools.withOpacity(FluTheme.primaryColor,0.5)
font:FluTextStyle.Body
onSelectedTextChanged: {
control.forceActiveFocus()

View File

@ -42,7 +42,7 @@ FluButton {
id:divider_1
width: 1
x: parent.width/3
height: parent.height
height: parent.height - 1
color: control.dividerColor
visible: showYear
}
@ -50,7 +50,7 @@ FluButton {
id:divider_2
width: 1
x: showYear ? parent.width*2/3 : parent.width/2
height: parent.height
height: parent.height - 1
color: control.dividerColor
}
FluText{
@ -105,7 +105,7 @@ FluButton {
property: "opacity"
from:0
to:1
duration: FluTheme.enableAnimation ? 83 : 0
duration: FluTheme.animationEnabled ? 83 : 0
}
}
exit:Transition {
@ -113,7 +113,7 @@ FluButton {
property: "opacity"
from:1
to:0
duration: FluTheme.enableAnimation ? 83 : 0
duration: FluTheme.animationEnabled ? 83 : 0
}
}
background:Item{

View File

@ -3,75 +3,21 @@ import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import FluentUI 1.0
Button {
property bool disabled: false
property string contentDescription: ""
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(246/255,246/255,246/255,1)
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(244/255,244/255,244/255,1)
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(131/255,131/255,131/255,1)
}
if(pressed){
return Qt.rgba(162/255,162/255,162/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(160/255,160/255,160/255,1)
}
if(pressed){
return Qt.rgba(96/255,96/255,96/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property var window : Window.window
default property alias contentData: menu.contentData
Accessible.role: Accessible.Button
Accessible.name: control.text
Accessible.description: contentDescription
Accessible.onPressAction: control.clicked()
FluButton {
id: control
default property alias contentData: menu.contentData
rightPadding:35
enabled: !disabled
focusPolicy:Qt.TabFocus
verticalPadding: 0
horizontalPadding:12
background: Rectangle{
implicitWidth: 28
implicitHeight: 28
border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
border.width: 1
radius: 4
FluFocusRectangle{
visible: control.activeFocus
radius:8
FluIcon{
iconSource:FluentIcons.ChevronDown
iconSize: 15
anchors{
right: parent.right
rightMargin: 10
verticalCenter: parent.verticalCenter
}
color:{
if(!enabled){
return disableColor
}
return hovered ? hoverColor :normalColor
}
FluIcon{
iconSource:FluentIcons.ChevronDown
iconSize: 15
anchors{
right: parent.right
rightMargin: 10
verticalCenter: parent.verticalCenter
}
iconColor:title.color
}
}
contentItem: FluText {
id:title
text: control.text
verticalAlignment: Text.AlignVCenter
color: control.textColor
iconColor:control.textColor
}
onClicked: {
if(menu.count !==0){

Some files were not shown because too many files have changed in this diff Show More