mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
DolphinQt: Add function to set a QWidget's window decorations to dark ones on Windows.
This commit is contained in:
25
Source/Core/DolphinQt/QtUtils/SetWindowDecorations.cpp
Normal file
25
Source/Core/DolphinQt/QtUtils/SetWindowDecorations.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright 2023 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <dwmapi.h>
|
||||
#endif
|
||||
|
||||
void SetQWidgetWindowDecorations(QWidget* widget)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (!Settings::Instance().IsSystemDark())
|
||||
return;
|
||||
|
||||
BOOL use_dark_title_bar = TRUE;
|
||||
DwmSetWindowAttribute(HWND(widget->winId()),
|
||||
20 /* DWMWINDOWATTRIBUTE::DWMWA_USE_IMMERSIVE_DARK_MODE */,
|
||||
&use_dark_title_bar, DWORD(sizeof(use_dark_title_bar)));
|
||||
#endif
|
||||
}
|
Reference in New Issue
Block a user