mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-10-31 08:09:33 +08:00
update
This commit is contained in:
parent
0003f8192e
commit
9adc63b3bc
@ -18,7 +18,7 @@ void postInit(){
|
||||
qDebug()<<"postInit";
|
||||
FramelessHelper::Core::setApplicationOSThemeAware();
|
||||
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
||||
FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
||||
// FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
||||
}
|
||||
void initEngine(QQmlApplicationEngine* engine){
|
||||
qDebug()<<"initEngine";
|
||||
|
@ -1,3 +1,37 @@
|
||||
//#include "FluTheme.h"
|
||||
|
||||
//#include "Def.h"
|
||||
//#include "FluColors.h"
|
||||
//#include <QPalette>
|
||||
//#include <QtGui/qpa/qplatformtheme.h>
|
||||
//#include <QtGui/private/qguiapplication_p.h>
|
||||
//#include <QGuiApplication>
|
||||
//#include <FramelessHelper/Core/utils.h>
|
||||
//#include <FramelessHelper/Core/framelessmanager.h>
|
||||
|
||||
//FRAMELESSHELPER_USE_NAMESPACE;
|
||||
|
||||
//FluTheme* FluTheme::m_instance = nullptr;
|
||||
|
||||
//FluTheme *FluTheme::getInstance()
|
||||
//{
|
||||
// if(FluTheme::m_instance == nullptr){
|
||||
// FluTheme::m_instance = new FluTheme;
|
||||
// }
|
||||
// return FluTheme::m_instance;
|
||||
//}
|
||||
|
||||
//FluTheme::FluTheme(QObject *parent)
|
||||
// : QObject{parent}
|
||||
//{
|
||||
// primaryColor(FluColors::getInstance()->Blue());
|
||||
// nativeText(false);
|
||||
// dark(FramelessManager::instance()->systemTheme() == Global::SystemTheme::Dark);
|
||||
// connect(FramelessManager::instance(), &FramelessManager::systemThemeChanged, this, [this](){
|
||||
// dark(Utils::getSystemTheme()==Global::SystemTheme::Dark);
|
||||
// });
|
||||
//}
|
||||
|
||||
#include "FluTheme.h"
|
||||
|
||||
#include "Def.h"
|
||||
@ -6,6 +40,11 @@
|
||||
#include <QtGui/qpa/qplatformtheme.h>
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <QGuiApplication>
|
||||
#include <FramelessHelper/Core/utils.h>
|
||||
#include <FramelessHelper/Core/framelessmanager.h>
|
||||
|
||||
FRAMELESSHELPER_USE_NAMESPACE;
|
||||
|
||||
|
||||
FluTheme* FluTheme::m_instance = nullptr;
|
||||
|
||||
@ -43,12 +82,10 @@ bool FluTheme::eventFilter(QObject *obj, QEvent *event)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool FluTheme::systemDark()
|
||||
{
|
||||
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
|
||||
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
|
||||
}
|
||||
return false;
|
||||
return Utils::getSystemTheme()==Global::SystemTheme::Dark;
|
||||
}
|
||||
|
||||
bool FluTheme::dark(){
|
||||
|
@ -23,7 +23,17 @@ Rectangle{
|
||||
property bool isMac: FluTools.isMacos()
|
||||
property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
id:root
|
||||
color: Qt.rgba(0,0,0,0)
|
||||
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)
|
||||
}
|
||||
Behavior on color{
|
||||
ColorAnimation {
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
height: visible ? 30 : 0
|
||||
opacity: visible
|
||||
z: 65535
|
||||
|
@ -623,15 +623,7 @@ Item {
|
||||
if(d.isMinimal || d.isCompactAndPanel){
|
||||
return FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
||||
}
|
||||
if(Window.window.active){
|
||||
return FluTheme.dark ? Qt.rgba(26/255,34/255,41/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)
|
||||
}
|
||||
Behavior on color{
|
||||
ColorAnimation {
|
||||
duration: 300
|
||||
}
|
||||
return "transparent"
|
||||
}
|
||||
x: {
|
||||
if(d.displayMode !== FluNavigationView.Minimal)
|
||||
|
@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
import org.wangwenx190.FramelessHelper
|
||||
@ -28,15 +29,15 @@ 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)
|
||||
}
|
||||
signal initArgument(var argument)
|
||||
id:window
|
||||
color:"transparent"
|
||||
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)
|
||||
}
|
||||
color: "transparent"
|
||||
onClosing:(event)=>closeFunc(event)
|
||||
Component.onCompleted: {
|
||||
helper.initWindow(window)
|
||||
@ -45,6 +46,7 @@ Window {
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
color: backgroundColor
|
||||
visible: FluTheme.darkMode !== FluDarkMode.System
|
||||
Behavior on color{
|
||||
ColorAnimation {
|
||||
duration: 300
|
||||
|
Loading…
Reference in New Issue
Block a user