mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-23 11:17:15 +08:00
update
This commit is contained in:
parent
6fe3081d23
commit
855305f197
@ -41,7 +41,7 @@ FluWindow {
|
||||
setWindowFixedSize(fixSize)
|
||||
title_bar.maximizeButton.visible = !fixSize
|
||||
if (blurBehindWindowEnabled)
|
||||
window.backgroundVisible = false
|
||||
window.background = undefined
|
||||
window.show()
|
||||
}
|
||||
}
|
||||
|
@ -77,6 +77,7 @@ FluScrollablePage{
|
||||
anchors.fill: parent
|
||||
tintColor: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||
target: bg
|
||||
blurRadius : 40
|
||||
targetRect: Qt.rect(list.x-list.contentX+10+(control.width)*index,list.y+10,width,height)
|
||||
}
|
||||
Rectangle{
|
||||
@ -85,14 +86,14 @@ FluScrollablePage{
|
||||
color:{
|
||||
if(FluTheme.dark){
|
||||
if(item_mouse.containsMouse){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}else{
|
||||
if(item_mouse.containsMouse){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
return Qt.rgba(0,0,0,0.09)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
return Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,13 +21,13 @@ FRAMELESSHELPER_USE_NAMESPACE
|
||||
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||
QGuiApplication::setApplicationName("FluentUI");
|
||||
QGuiApplication app(argc, argv);
|
||||
#ifdef Q_OS_WIN // 此设置仅在Windows下生效
|
||||
FramelessConfig::instance()->set(Global::Option::ForceHideWindowFrameBorder);
|
||||
#endif
|
||||
FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
||||
FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
|
||||
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur);
|
||||
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
||||
#ifdef Q_OS_WIN // 此设置仅在Windows下生效
|
||||
FramelessConfig::instance()->set(Global::Option::ForceHideWindowFrameBorder);
|
||||
#endif
|
||||
#ifdef Q_OS_MACOS
|
||||
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur,false);
|
||||
#endif
|
||||
|
@ -49,14 +49,14 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist
|
||||
return;
|
||||
}
|
||||
QVariantMap properties;
|
||||
properties.insert("route",route);
|
||||
properties.insert("_route",route);
|
||||
if(fluRegister){
|
||||
properties.insert("pageRegister",QVariant::fromValue(fluRegister));
|
||||
properties.insert("_pageRegister",QVariant::fromValue(fluRegister));
|
||||
}
|
||||
properties.insert("argument",argument);
|
||||
QQuickWindow *view=nullptr;
|
||||
for (auto& pair : wnds) {
|
||||
QString r = pair->property("route").toString();
|
||||
QString r = pair->property("_route").toString();
|
||||
if(r == route){
|
||||
view = pair;
|
||||
break;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
@ -8,10 +7,11 @@ Window {
|
||||
default property alias content: container.data
|
||||
property bool closeDestory: true
|
||||
property int launchMode: FluWindowType.Standard
|
||||
property string route
|
||||
property var argument:({})
|
||||
property var pageRegister
|
||||
property var background : com_background
|
||||
property Component loadingItem: com_loading
|
||||
property var _pageRegister
|
||||
property string _route
|
||||
property var closeFunc: function(event){
|
||||
if(closeDestory){
|
||||
deleteWindow()
|
||||
@ -20,26 +20,31 @@ Window {
|
||||
event.accepted = false
|
||||
}
|
||||
}
|
||||
property color backgroundColor: {
|
||||
if(active){
|
||||
return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(238/255,244/255,249/255,1)
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
||||
}
|
||||
property alias backgroundOpacity: bg.opacity
|
||||
property alias backgroundVisible: bg.visible
|
||||
signal initArgument(var argument)
|
||||
id:window
|
||||
color:"transparent"
|
||||
onClosing:(event)=>closeFunc(event)
|
||||
Component.onCompleted: {
|
||||
helper.initWindow(window)
|
||||
initArgument(argument)
|
||||
}
|
||||
Rectangle{
|
||||
id: bg
|
||||
Connections{
|
||||
target: window
|
||||
function onClosing(event){closeFunc(event)}
|
||||
}
|
||||
Component{
|
||||
id:com_background
|
||||
Rectangle{
|
||||
color: {
|
||||
if(active){
|
||||
return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(238/255,244/255,249/255,1)
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
anchors.fill: parent
|
||||
color: backgroundColor
|
||||
sourceComponent: background
|
||||
}
|
||||
Item{
|
||||
id:container
|
||||
@ -124,8 +129,8 @@ Window {
|
||||
FluApp.deleteWindow(window)
|
||||
}
|
||||
function onResult(data){
|
||||
if(pageRegister){
|
||||
pageRegister.onResult(data)
|
||||
if(_pageRegister){
|
||||
_pageRegister.onResult(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user