mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-02-02 19:27:38 +08:00
update
This commit is contained in:
parent
9e8e55cb73
commit
1d68de9287
@ -123,7 +123,6 @@
|
|||||||
<file>res/image/qrcode_zfb.jpg</file>
|
<file>res/image/qrcode_zfb.jpg</file>
|
||||||
<file>qml/App.qml</file>
|
<file>qml/App.qml</file>
|
||||||
<file>qml/component/CodeExpander.qml</file>
|
<file>qml/component/CodeExpander.qml</file>
|
||||||
<file>qml/component/CustomWindow.qml</file>
|
|
||||||
<file>qml/global/ItemsFooter.qml</file>
|
<file>qml/global/ItemsFooter.qml</file>
|
||||||
<file>qml/global/ItemsOriginal.qml</file>
|
<file>qml/global/ItemsOriginal.qml</file>
|
||||||
<file>qml/global/qmldir</file>
|
<file>qml/global/qmldir</file>
|
||||||
|
@ -1,64 +0,0 @@
|
|||||||
import QtQuick 2.15
|
|
||||||
import QtQuick.Layouts 1.15
|
|
||||||
import FluentUI 1.0
|
|
||||||
import org.wangwenx190.FramelessHelper 1.0
|
|
||||||
|
|
||||||
FluWindow {
|
|
||||||
id:window
|
|
||||||
property bool fixSize
|
|
||||||
property alias titleVisible: title_bar.titleVisible
|
|
||||||
property bool appBarVisible: true
|
|
||||||
default property alias content: container.data
|
|
||||||
FluAppBar {
|
|
||||||
id: title_bar
|
|
||||||
title: window.title
|
|
||||||
visible: window.appBarVisible
|
|
||||||
icon:"qrc:/example/res/image/favicon.ico"
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
darkText: lang.dark_mode
|
|
||||||
}
|
|
||||||
Item{
|
|
||||||
id:container
|
|
||||||
anchors{
|
|
||||||
top: title_bar.bottom
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
clip: true
|
|
||||||
}
|
|
||||||
FramelessHelper{
|
|
||||||
id:framless_helper
|
|
||||||
onReady: {
|
|
||||||
setTitleBarItem(title_bar)
|
|
||||||
moveWindowToDesktopCenter()
|
|
||||||
setHitTestVisible(title_bar.minimizeButton())
|
|
||||||
setHitTestVisible(title_bar.maximizeButton())
|
|
||||||
setHitTestVisible(title_bar.closeButton())
|
|
||||||
setWindowFixedSize(fixSize)
|
|
||||||
title_bar.maximizeButton.visible = !fixSize
|
|
||||||
if (blurBehindWindowEnabled)
|
|
||||||
window.background = undefined
|
|
||||||
window.show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Connections{
|
|
||||||
target: FluTheme
|
|
||||||
function onDarkChanged(){
|
|
||||||
if (FluTheme.dark)
|
|
||||||
FramelessUtils.systemTheme = FramelessHelperConstants.Dark
|
|
||||||
else
|
|
||||||
FramelessUtils.systemTheme = FramelessHelperConstants.Light
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function setHitTestVisible(com){
|
|
||||||
framless_helper.setHitTestVisible(com)
|
|
||||||
}
|
|
||||||
function setTitleBarItem(com){
|
|
||||||
framless_helper.setTitleBarItem(com)
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,7 +5,7 @@ import FluentUI 1.0
|
|||||||
import "qrc:///example/qml/component"
|
import "qrc:///example/qml/component"
|
||||||
import "../component"
|
import "../component"
|
||||||
|
|
||||||
CustomWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"关于"
|
title:"关于"
|
||||||
|
@ -6,7 +6,7 @@ import example 1.0
|
|||||||
import "qrc:///example/qml/component"
|
import "qrc:///example/qml/component"
|
||||||
import "../component"
|
import "../component"
|
||||||
|
|
||||||
CustomWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"热加载"
|
title:"热加载"
|
||||||
|
@ -5,7 +5,7 @@ import FluentUI 1.0
|
|||||||
import "qrc:///example/qml/component"
|
import "qrc:///example/qml/component"
|
||||||
import "../component"
|
import "../component"
|
||||||
|
|
||||||
CustomWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"登录"
|
title:"登录"
|
||||||
|
@ -12,7 +12,7 @@ import "../component"
|
|||||||
import "../viewmodel"
|
import "../viewmodel"
|
||||||
import "../global"
|
import "../global"
|
||||||
|
|
||||||
CustomWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title: "FluentUI"
|
title: "FluentUI"
|
||||||
@ -21,8 +21,8 @@ CustomWindow {
|
|||||||
closeDestory:false
|
closeDestory:false
|
||||||
minimumWidth: 520
|
minimumWidth: 520
|
||||||
minimumHeight: 200
|
minimumHeight: 200
|
||||||
appBarVisible: false
|
|
||||||
launchMode: FluWindowType.SingleTask
|
launchMode: FluWindowType.SingleTask
|
||||||
|
appBar: undefined
|
||||||
|
|
||||||
SettingsViewModel{
|
SettingsViewModel{
|
||||||
id:viewmodel_settings
|
id:viewmodel_settings
|
||||||
|
@ -6,7 +6,7 @@ import example 1.0
|
|||||||
import "qrc:///example/qml/component"
|
import "qrc:///example/qml/component"
|
||||||
import "../component"
|
import "../component"
|
||||||
|
|
||||||
CustomWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
width: 800
|
width: 800
|
||||||
|
@ -5,7 +5,7 @@ import FluentUI 1.0
|
|||||||
import "qrc:///example/qml/component"
|
import "qrc:///example/qml/component"
|
||||||
import "../component"
|
import "../component"
|
||||||
|
|
||||||
CustomWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"SingleInstance"
|
title:"SingleInstance"
|
||||||
|
@ -5,7 +5,7 @@ import FluentUI 1.0
|
|||||||
import "qrc:///example/qml/component"
|
import "qrc:///example/qml/component"
|
||||||
import "../component"
|
import "../component"
|
||||||
|
|
||||||
CustomWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"SingleTask"
|
title:"SingleTask"
|
||||||
|
@ -5,7 +5,7 @@ import FluentUI 1.0
|
|||||||
import "qrc:///example/qml/component"
|
import "qrc:///example/qml/component"
|
||||||
import "../component"
|
import "../component"
|
||||||
|
|
||||||
CustomWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"Standard"
|
title:"Standard"
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Window 2.15
|
|||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
import FluentUI 1.0
|
import FluentUI 1.0
|
||||||
|
import org.wangwenx190.FramelessHelper 1.0
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
default property alias content: container.data
|
default property alias content: container.data
|
||||||
@ -10,7 +11,9 @@ Window {
|
|||||||
property int launchMode: FluWindowType.Standard
|
property int launchMode: FluWindowType.Standard
|
||||||
property var argument:({})
|
property var argument:({})
|
||||||
property var background : com_background
|
property var background : com_background
|
||||||
|
property bool fixSize: false
|
||||||
property Component loadingItem: com_loading
|
property Component loadingItem: com_loading
|
||||||
|
property var appBar: com_app_bar
|
||||||
property color backgroundColor: {
|
property color backgroundColor: {
|
||||||
if(active){
|
if(active){
|
||||||
return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
||||||
@ -28,6 +31,7 @@ Window {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
signal initArgument(var argument)
|
signal initArgument(var argument)
|
||||||
|
property bool showSystemAppBar: true
|
||||||
id:window
|
id:window
|
||||||
color:"transparent"
|
color:"transparent"
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
@ -50,13 +54,33 @@ Window {
|
|||||||
color: window.backgroundColor
|
color: window.backgroundColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Component{
|
||||||
|
id:com_app_bar
|
||||||
|
FluAppBar {
|
||||||
|
title: window.title
|
||||||
|
}
|
||||||
|
}
|
||||||
Loader{
|
Loader{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceComponent: background
|
sourceComponent: background
|
||||||
}
|
}
|
||||||
|
Loader{
|
||||||
|
id: loader_title_bar
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
sourceComponent: window.appBar
|
||||||
|
}
|
||||||
Item{
|
Item{
|
||||||
id:container
|
id:container
|
||||||
anchors.fill: parent
|
anchors{
|
||||||
|
top: loader_title_bar.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
clip: true
|
clip: true
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
@ -65,10 +89,6 @@ Window {
|
|||||||
id:loader_loading
|
id:loader_loading
|
||||||
anchors.fill: container
|
anchors.fill: container
|
||||||
}
|
}
|
||||||
FluInfoBar{
|
|
||||||
id:infoBar
|
|
||||||
root: window
|
|
||||||
}
|
|
||||||
Component{
|
Component{
|
||||||
id:com_loading
|
id:com_loading
|
||||||
Popup{
|
Popup{
|
||||||
@ -132,6 +152,37 @@ Window {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluInfoBar{
|
||||||
|
id:infoBar
|
||||||
|
root: window
|
||||||
|
}
|
||||||
|
Connections{
|
||||||
|
target: FluTheme
|
||||||
|
function onDarkChanged(){
|
||||||
|
if (FluTheme.dark)
|
||||||
|
FramelessUtils.systemTheme = FramelessHelperConstants.Dark
|
||||||
|
else
|
||||||
|
FramelessUtils.systemTheme = FramelessHelperConstants.Light
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FramelessHelper{
|
||||||
|
id:framless_helper
|
||||||
|
onReady: {
|
||||||
|
if(appBar && !showSystemAppBar){
|
||||||
|
var title_bar = loader_title_bar.item
|
||||||
|
setTitleBarItem(title_bar)
|
||||||
|
moveWindowToDesktopCenter()
|
||||||
|
setHitTestVisible(title_bar.minimizeButton())
|
||||||
|
setHitTestVisible(title_bar.maximizeButton())
|
||||||
|
setHitTestVisible(title_bar.closeButton())
|
||||||
|
setWindowFixedSize(fixSize)
|
||||||
|
title_bar.maximizeButton.visible = !fixSize
|
||||||
|
if (blurBehindWindowEnabled)
|
||||||
|
window.background = undefined
|
||||||
|
}
|
||||||
|
window.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
WindowLifecycle{
|
WindowLifecycle{
|
||||||
id:lifecycle
|
id:lifecycle
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user