mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-27 05:38:37 +08:00
调整支持mingw编译
This commit is contained in:
parent
cfbaf44a05
commit
f099d3c737
@ -2279,6 +2279,11 @@ Some contents...</source>
|
||||
<source>window effect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Theme.qml" line="178"/>
|
||||
<source></source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_TimePicker</name>
|
||||
|
@ -2461,6 +2461,11 @@ Some contents...</source>
|
||||
<source>window effect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Theme.qml" line="178"/>
|
||||
<source></source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_TimePicker</name>
|
||||
|
@ -107,8 +107,7 @@ static inline void setShadow(HWND hwnd) {
|
||||
}
|
||||
|
||||
static inline bool setWindowDarkMode(HWND hwnd, const BOOL enable) {
|
||||
return bool(DwmSetWindowAttribute(hwnd, DWMWINDOWATTRIBUTE::DWMWA_USE_IMMERSIVE_DARK_MODE,
|
||||
&enable, sizeof(BOOL)));
|
||||
return bool(DwmSetWindowAttribute(hwnd, 20, &enable, sizeof(BOOL)));
|
||||
}
|
||||
|
||||
static inline bool setWindowEffect(HWND hwnd, const QString &key, const bool &enable) {
|
||||
@ -120,8 +119,8 @@ static inline bool setWindowEffect(HWND hwnd, const QString &key, const bool &en
|
||||
if (enable) {
|
||||
DwmExtendFrameIntoClientArea(hwnd, &extendedMargins);
|
||||
if (isWin1122H2OrGreater()) {
|
||||
const DWM_SYSTEMBACKDROP_TYPE backdropType = DWMSBT_MAINWINDOW;
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_SYSTEMBACKDROP_TYPE, &backdropType,
|
||||
const DWORD backdropType = _DWMSBT_MAINWINDOW;
|
||||
DwmSetWindowAttribute(hwnd, 38, &backdropType,
|
||||
sizeof(backdropType));
|
||||
} else {
|
||||
const BOOL enable = TRUE;
|
||||
@ -129,8 +128,8 @@ static inline bool setWindowEffect(HWND hwnd, const QString &key, const bool &en
|
||||
}
|
||||
} else {
|
||||
if (isWin1122H2OrGreater()) {
|
||||
const DWM_SYSTEMBACKDROP_TYPE backdropType = DWMSBT_AUTO;
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_SYSTEMBACKDROP_TYPE, &backdropType,
|
||||
const DWORD backdropType = _DWMSBT_AUTO;
|
||||
DwmSetWindowAttribute(hwnd, 38, &backdropType,
|
||||
sizeof(backdropType));
|
||||
} else {
|
||||
const BOOL enable = FALSE;
|
||||
@ -148,12 +147,12 @@ static inline bool setWindowEffect(HWND hwnd, const QString &key, const bool &en
|
||||
}
|
||||
if (enable) {
|
||||
DwmExtendFrameIntoClientArea(hwnd, &extendedMargins);
|
||||
const DWM_SYSTEMBACKDROP_TYPE backdropType = DWMSBT_TABBEDWINDOW;
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_SYSTEMBACKDROP_TYPE, &backdropType,
|
||||
const DWORD backdropType = _DWMSBT_TABBEDWINDOW;
|
||||
DwmSetWindowAttribute(hwnd, 38, &backdropType,
|
||||
sizeof(backdropType));
|
||||
} else {
|
||||
const DWM_SYSTEMBACKDROP_TYPE backdropType = DWMSBT_AUTO;
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_SYSTEMBACKDROP_TYPE, &backdropType,
|
||||
const DWORD backdropType = _DWMSBT_AUTO;
|
||||
DwmSetWindowAttribute(hwnd, 38, &backdropType,
|
||||
sizeof(backdropType));
|
||||
}
|
||||
BOOL isDark = FluTheme::getInstance()->dark();
|
||||
@ -168,13 +167,13 @@ static inline bool setWindowEffect(HWND hwnd, const QString &key, const bool &en
|
||||
if (enable) {
|
||||
MARGINS margins{-1, -1, -1, -1};
|
||||
DwmExtendFrameIntoClientArea(hwnd, &margins);
|
||||
DWM_SYSTEMBACKDROP_TYPE system_backdrop_type =
|
||||
DWM_SYSTEMBACKDROP_TYPE::DWMSBT_TRANSIENTWINDOW;
|
||||
DwmSetWindowAttribute(hwnd, DWMWINDOWATTRIBUTE::DWMWA_SYSTEMBACKDROP_TYPE,
|
||||
&system_backdrop_type, sizeof(DWM_SYSTEMBACKDROP_TYPE));
|
||||
DWORD system_backdrop_type =
|
||||
_DWMSBT_TRANSIENTWINDOW;
|
||||
DwmSetWindowAttribute(hwnd, 38,
|
||||
&system_backdrop_type, sizeof(DWORD));
|
||||
} else {
|
||||
const DWM_SYSTEMBACKDROP_TYPE backdropType = DWMSBT_AUTO;
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_SYSTEMBACKDROP_TYPE, &backdropType,
|
||||
const DWORD backdropType = _DWMSBT_AUTO;
|
||||
DwmSetWindowAttribute(hwnd, 38, &backdropType,
|
||||
sizeof(backdropType));
|
||||
}
|
||||
BOOL isDark = FluTheme::getInstance()->dark();
|
||||
|
@ -14,7 +14,17 @@
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <dwmapi.h>
|
||||
|
||||
enum _DWM_SYSTEMBACKDROP_TYPE {
|
||||
_DWMSBT_AUTO, // [Default] Let DWM automatically decide the system-drawn backdrop for this
|
||||
// window.
|
||||
_DWMSBT_NONE, // [Disable] Do not draw any system backdrop.
|
||||
_DWMSBT_MAINWINDOW, // [Mica] Draw the backdrop material effect corresponding to a
|
||||
// long-lived window.
|
||||
_DWMSBT_TRANSIENTWINDOW, // [Acrylic] Draw the backdrop material effect corresponding to a
|
||||
// transient window.
|
||||
_DWMSBT_TABBEDWINDOW, // [Mica Alt] Draw the backdrop material effect corresponding to a
|
||||
// window with a tabbed title bar.
|
||||
};
|
||||
enum WINDOWCOMPOSITIONATTRIB {
|
||||
WCA_UNDEFINED = 0,
|
||||
WCA_NCRENDERING_ENABLED = 1,
|
||||
|
@ -12,6 +12,11 @@ Window {
|
||||
property bool fixSize: false
|
||||
property Component loadingItem: com_loading
|
||||
property bool fitsAppBarWindows: false
|
||||
property var tintOpacity: FluTheme.dark ? 0.80 : 0.75
|
||||
property int blurRadius: 60
|
||||
property alias effect: frameless.effect
|
||||
readonly property alias effective: frameless.effective
|
||||
readonly property var availableEffects: frameless.availableEffects
|
||||
property Item appBar: FluAppBar {
|
||||
title: window.title
|
||||
height: 30
|
||||
@ -23,6 +28,15 @@ Window {
|
||||
icon: window.windowIcon
|
||||
}
|
||||
property color backgroundColor: {
|
||||
if(frameless.effective && active){
|
||||
var backcolor
|
||||
if(frameless.effect==="dwm-blur"){
|
||||
backcolor = FluTools.withOpacity(FluTheme.windowActiveBackgroundColor, window.tintOpacity)
|
||||
}else{
|
||||
backcolor = "transparent"
|
||||
}
|
||||
return backcolor
|
||||
}
|
||||
if(active){
|
||||
return FluTheme.windowActiveBackgroundColor
|
||||
}
|
||||
@ -106,6 +120,11 @@ Window {
|
||||
Component.onDestruction: {
|
||||
frameless.onDestruction()
|
||||
}
|
||||
onEffectiveChanged: {
|
||||
if(effective){
|
||||
FluTheme.blurBehindWindowEnabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id:com_background
|
||||
@ -161,8 +180,8 @@ Window {
|
||||
FluAcrylic{
|
||||
anchors.fill: parent
|
||||
target: img_back
|
||||
tintOpacity: FluTheme.dark ? 0.80 : 0.75
|
||||
blurRadius: 64
|
||||
tintOpacity: window.tintOpacity
|
||||
blurRadius: window.blurRadius
|
||||
visible: window.active && FluTheme.blurBehindWindowEnabled
|
||||
tintColor: FluTheme.dark ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1)
|
||||
targetRect: Qt.rect(window.x-window.screen.virtualX,window.y-window.screen.virtualY,window.width,window.height)
|
||||
@ -274,7 +293,7 @@ Window {
|
||||
sourceComponent: window.useSystemAppBar ? undefined : com_app_bar
|
||||
}
|
||||
Item{
|
||||
id:layout_content
|
||||
id: layout_content
|
||||
anchors{
|
||||
top: loader_app_bar.bottom
|
||||
left: parent.left
|
||||
@ -293,7 +312,6 @@ Window {
|
||||
id:info_bar
|
||||
root: layout_container
|
||||
}
|
||||
|
||||
FluLoader{
|
||||
id:loader_border
|
||||
anchors.fill: parent
|
||||
|
Loading…
Reference in New Issue
Block a user