mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-03 01:38:36 +00:00
dark mode for win10
This commit is contained in:
parent
bbdf0732ad
commit
6e41e11f0d
4 changed files with 12 additions and 10 deletions
|
@ -45,6 +45,7 @@
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>pch_qt.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>pch_qt.h</PrecompiledHeaderFile>
|
||||||
<ForcedIncludeFiles>pch_qt.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>pch_qt.h</ForcedIncludeFiles>
|
||||||
|
<TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</TreatWarningAsError>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Manifest>
|
<Manifest>
|
||||||
<AdditionalManifestFiles>DolphinQt.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
|
<AdditionalManifestFiles>DolphinQt.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
|
|
@ -199,7 +199,7 @@ void Settings::ApplyStyle()
|
||||||
// which would select Qt's default theme, but unlike other OSes we don't automatically get a
|
// which would select Qt's default theme, but unlike other OSes we don't automatically get a
|
||||||
// default dark theme on Windows when the user has selected dark mode in the Windows settings.
|
// default dark theme on Windows when the user has selected dark mode in the Windows settings.
|
||||||
// So manually check if the user wants dark mode and, if yes, load our embedded dark theme.
|
// So manually check if the user wants dark mode and, if yes, load our embedded dark theme.
|
||||||
if (style_type == StyleType::Dark || (style_type != StyleType::Light && IsSystemDark()))
|
if (style_type == StyleType::Dark && IsSystemDark())
|
||||||
{
|
{
|
||||||
QFile file(QStringLiteral(":/dolphin_dark_win/dark.qss"));
|
QFile file(QStringLiteral(":/dolphin_dark_win/dark.qss"));
|
||||||
if (file.open(QFile::ReadOnly))
|
if (file.open(QFile::ReadOnly))
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QOperatingSystemVersion>
|
||||||
|
|
||||||
#include "Common/CommonPaths.h"
|
#include "Common/CommonPaths.h"
|
||||||
#include "Common/FileSearch.h"
|
#include "Common/FileSearch.h"
|
||||||
|
@ -130,27 +131,27 @@ void InterfacePane::CreateUI()
|
||||||
const QString qt_name = QString::fromStdString(PathToFileName(path));
|
const QString qt_name = QString::fromStdString(PathToFileName(path));
|
||||||
m_combobox_theme->addItem(qt_name);
|
m_combobox_theme->addItem(qt_name);
|
||||||
}
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
// User Style Combobox
|
// User Style Combobox
|
||||||
m_combobox_userstyle = new QComboBox;
|
m_combobox_userstyle = new QComboBox;
|
||||||
m_label_userstyle = new QLabel(tr("Style:"));
|
m_label_userstyle = new QLabel(tr("Style:"));
|
||||||
combobox_layout->addRow(m_label_userstyle, m_combobox_userstyle);
|
combobox_layout->addRow(m_label_userstyle, m_combobox_userstyle);
|
||||||
|
|
||||||
auto userstyle_search_results = Common::DoFileSearch({File::GetUserPath(D_STYLES_IDX)});
|
auto userstyle_search_results = Common::DoFileSearch({File::GetUserPath(D_STYLES_IDX)});
|
||||||
|
|
||||||
m_combobox_userstyle->addItem(tr("System"), static_cast<int>(Settings::StyleType::System));
|
auto current = QOperatingSystemVersionBase::current();
|
||||||
|
|
||||||
// TODO: Support forcing light/dark on other OSes too.
|
if (current <= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10))
|
||||||
#ifdef _WIN32
|
{
|
||||||
m_combobox_userstyle->addItem(tr("Light"), static_cast<int>(Settings::StyleType::Light));
|
m_combobox_userstyle->addItem(tr("Windows 11"), static_cast<int>(Settings::StyleType::Light));
|
||||||
m_combobox_userstyle->addItem(tr("Dark"), static_cast<int>(Settings::StyleType::Dark));
|
m_combobox_userstyle->addItem(tr("Windows 10"), static_cast<int>(Settings::StyleType::Dark));
|
||||||
#endif
|
}
|
||||||
|
|
||||||
for (const std::string& path : userstyle_search_results)
|
for (const std::string& path : userstyle_search_results)
|
||||||
{
|
{
|
||||||
const QFileInfo file_info(QString::fromStdString(path));
|
const QFileInfo file_info(QString::fromStdString(path));
|
||||||
m_combobox_userstyle->addItem(file_info.completeBaseName(), file_info.fileName());
|
m_combobox_userstyle->addItem(file_info.completeBaseName(), file_info.fileName());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Checkboxes
|
// Checkboxes
|
||||||
m_checkbox_use_builtin_title_database = new QCheckBox(tr("Use Built-In Database of Game Names"));
|
m_checkbox_use_builtin_title_database = new QCheckBox(tr("Use Built-In Database of Game Names"));
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
<QtDllNames Include="@(QtDllNames_ -> '%(Identity)$(QtLibSuffix).dll')" />
|
<QtDllNames Include="@(QtDllNames_ -> '%(Identity)$(QtLibSuffix).dll')" />
|
||||||
<QtDllsSrc Include="@(QtDllNames -> '$(QtBinDir)%(Identity)')" />
|
<QtDllsSrc Include="@(QtDllNames -> '$(QtBinDir)%(Identity)')" />
|
||||||
<QtDllsDst Include="@(QtDllNames -> '$(BinaryOutputDir)%(Identity)')" />
|
<QtDllsDst Include="@(QtDllNames -> '$(BinaryOutputDir)%(Identity)')" />
|
||||||
<QtPluginNames_ Include="iconengines\qsvgicon;imageformats\qsvg;platforms\qdirect2d;platforms\qwindows;styles\qwindowsvistastyle"/>
|
<QtPluginNames_ Include="iconengines\qsvgicon;imageformats\qsvg;platforms\qdirect2d;platforms\qwindows;styles\qmodernwindowsstyle"/>
|
||||||
<QtPluginNames Include="@(QtPluginNames_ -> '%(Identity)$(QtLibSuffix).dll')" />
|
<QtPluginNames Include="@(QtPluginNames_ -> '%(Identity)$(QtLibSuffix).dll')" />
|
||||||
<QtPluginsSrc Include="@(QtPluginNames -> '$(QtPluginsDir)%(Identity)')" />
|
<QtPluginsSrc Include="@(QtPluginNames -> '$(QtPluginsDir)%(Identity)')" />
|
||||||
<QtPluginsDst Include="@(QtPluginNames -> '$(BinaryOutputDir)$(QtPluginFolder)\%(Identity)')" />
|
<QtPluginsDst Include="@(QtPluginNames -> '$(BinaryOutputDir)$(QtPluginFolder)\%(Identity)')" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue