2023-07-30 16:40:15 -06:00
|
|
|
// 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
|
2023-11-05 10:13:00 -07:00
|
|
|
if (!Settings::Instance().IsThemeDark())
|
2023-07-30 16:40:15 -06:00
|
|
|
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
|
|
|
|
}
|