Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
朱子楚\zhuzi committed Mar 15, 2024
1 parent 9d5765e commit 3f7555d
Show file tree
Hide file tree
Showing 16 changed files with 553 additions and 194 deletions.
1 change: 0 additions & 1 deletion example/qml-Qt6/App.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Item {
"/login":"qrc:/example/qml/window/LoginWindow.qml",
"/hotload":"qrc:/example/qml/window/HotloadWindow.qml",
"/crash":"qrc:/example/qml/window/CrashWindow.qml",
"/fluentInitalizr":"qrc:/example/qml/window/FluentInitalizrWindow.qml",
"/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml",
"/standardWindow":"qrc:/example/qml/window/StandardWindow.qml",
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml",
Expand Down
11 changes: 8 additions & 3 deletions example/qml-Qt6/page/T_Home.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ import QtQuick.Window
import QtQuick.Controls
import FluentUI
import "../global"
import "../window"


FluScrollablePage{

launchMode: FluPageType.SingleTask
animDisabled: true

FluentInitalizrWindow{
id:fluent_initalizr
}

ListModel{
id: model_header
ListElement{
Expand All @@ -27,11 +33,10 @@ FluScrollablePage{
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){
FluApp.navigate("/fluentInitalizr")
fluent_initalizr.showDialog()
}
}
}

Item{
Layout.fillWidth: true
Layout.preferredHeight: 320
Expand Down Expand Up @@ -60,7 +65,6 @@ FluScrollablePage{
leftMargin: 20
}
}

Component{
id:com_grallery
Item{
Expand Down Expand Up @@ -287,3 +291,4 @@ FluScrollablePage{
}

}

175 changes: 88 additions & 87 deletions example/qml-Qt6/window/FluentInitalizrWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,108 +5,109 @@ import FluentUI
import Qt.labs.platform
import "../component"

FluWindow {
FluWindowDialog {

id:window
title:qsTr("FluentUI Initalizr")
width: 600
height: 400
fixSize: true
modality: Qt.ApplicationModal
launchMode: FluWindowType.SingleTask
showStayTop: false

Connections{
target: InitalizrHelper
function onError(message){
showError(message)
}
function onSuccess(path){
FluTools.showFileInFolder(path+"/CMakeLists.txt")
window.close()
}
}

FluText{
id:text_title
text:qsTr("FluentUI Initalizr")
font: FluTextStyle.Title
anchors{
left: parent.left
top: parent.top
leftMargin: 20
topMargin: 20
}
}

Column{
spacing: 14
anchors{
left: parent.left
top: text_title.bottom
leftMargin: 20
topMargin: 20
}
FluTextBox{
id:text_box_name
width: 180
placeholderText: qsTr("Name")
focus: true
}
Row{
spacing: 8
FluTextBox{
id:text_box_path
width: 300
placeholderText: qsTr("Create In")
anchors.verticalCenter: parent.verticalCenter
}
FluButton{
text:qsTr("Browse")
anchors.verticalCenter: parent.verticalCenter
onClicked: {
folder_dialog.open()
contentDelegate:Component{
Item{
Connections{
target: InitalizrHelper
function onError(message){
showError(message)
}
function onSuccess(path){
FluTools.showFileInFolder(path+"/CMakeLists.txt")
window.close()
}
}
}
}

FolderDialog{
id:folder_dialog
onAccepted: {
text_box_path.text = FluTools.toLocalPath(currentFolder)
}
}
FluText{
id:text_title
text:qsTr("FluentUI Initalizr")
font: FluTextStyle.Title
anchors{
left: parent.left
top: parent.top
leftMargin: 20
topMargin: 20
}
}

Rectangle{
id:layout_actions
width: parent.width
height: 60
anchors.bottom: parent.bottom
color: FluTheme.backgroundColor
Row{
height: parent.height
spacing: 20
anchors{
right: parent.right
rightMargin: 20
Column{
spacing: 14
anchors{
left: parent.left
top: text_title.bottom
leftMargin: 20
topMargin: 20
}
FluTextBox{
id:text_box_name
width: 180
placeholderText: qsTr("Name")
focus: true
}
Row{
spacing: 8
FluTextBox{
id:text_box_path
width: 300
placeholderText: qsTr("Create In")
anchors.verticalCenter: parent.verticalCenter
}
FluButton{
text:qsTr("Browse")
anchors.verticalCenter: parent.verticalCenter
onClicked: {
folder_dialog.open()
}
}
}
}
FluButton{
text:qsTr("Cancel")
width: 120
anchors.verticalCenter: parent.verticalCenter
onClicked: {
window.close()

FolderDialog{
id:folder_dialog
onAccepted: {
text_box_path.text = FluTools.toLocalPath(currentFolder)
}
}
FluFilledButton{
text:qsTr("Create")
width: 120
anchors.verticalCenter: parent.verticalCenter
onClicked: {
InitalizrHelper.generate(text_box_name.text,text_box_path.text)

Rectangle{
id:layout_actions
width: parent.width
height: 60
anchors.bottom: parent.bottom
color: FluTheme.backgroundColor
Row{
height: parent.height
spacing: 20
anchors{
right: parent.right
rightMargin: 20
}
FluButton{
text:qsTr("Cancel")
width: 120
anchors.verticalCenter: parent.verticalCenter
onClicked: {
window.close()
}
}
FluFilledButton{
text:qsTr("Create")
width: 120
anchors.verticalCenter: parent.verticalCenter
onClicked: {
InitalizrHelper.generate(text_box_name.text,text_box_path.text)
}
}
}
}
}
}

}
1 change: 0 additions & 1 deletion example/qml/App.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Item {
"/login":"qrc:/example/qml/window/LoginWindow.qml",
"/hotload":"qrc:/example/qml/window/HotloadWindow.qml",
"/crash":"qrc:/example/qml/window/CrashWindow.qml",
"/fluentInitalizr":"qrc:/example/qml/window/FluentInitalizrWindow.qml",
"/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml",
"/standardWindow":"qrc:/example/qml/window/StandardWindow.qml",
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml",
Expand Down
9 changes: 6 additions & 3 deletions example/qml/page/T_Home.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "../window"
import "../global"

FluScrollablePage{

launchMode: FluPageType.SingleTask
animDisabled: true

FluentInitalizrWindow{
id:fluent_initalizr
}

ListModel{
id: model_header
ListElement{
Expand All @@ -27,11 +32,10 @@ FluScrollablePage{
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){
FluApp.navigate("/fluentInitalizr")
fluent_initalizr.showDialog()
}
}
}

Item{
Layout.fillWidth: true
Layout.preferredHeight: 320
Expand Down Expand Up @@ -60,7 +64,6 @@ FluScrollablePage{
leftMargin: 20
}
}

Component{
id:com_grallery
Item{
Expand Down
Loading

0 comments on commit 3f7555d

Please sign in to comment.