mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-11-24 10:23:21 +00:00
Fusion is one of the built-in styles that Qt ships with, and that is generally supported in all platforms and handles custom color palettes properly. The color palettes have been borrowed from the Dolphin Memory Engine buddy application. The new styles are: - **Fusion Light** - **Fusion Dark Gray** - **Fusion Dark** A demo of each style on Windows: | System | Light | Dark | Fusion Light | Fusion Dark Gray | Fusion Dark | | ------ | ----- | ---- | ------------ | ---------------- | ----------- | | <img width="1920" height="1080" alt="Dolphin Emulator System style" src="https://github.com/user-attachments/assets/7f55a19d-d9a1-43d1-a435-1e1d5b29abe2" /> | <img width="1920" height="1080" alt="Dolphin Emulator Light style" src="https://github.com/user-attachments/assets/4c70f2f9-16b8-4777-b72b-55b2dffcd1e4" /> | <img width="1920" height="1080" alt="Dolphin Emulator Dark style" src="https://github.com/user-attachments/assets/5e669477-d2a5-4d19-b2c5-a2ed9bb1e6fe" /> | <img width="1920" height="1080" alt="Dolphin Emulator Light Fusion style" src="https://github.com/user-attachments/assets/b1f95c47-0691-4809-bd74-99e913c17684" /> | <img width="1920" height="1080" alt="Dolphin Emulator Dark Gray Fusion style" src="https://github.com/user-attachments/assets/c9d30aa3-f941-4fc5-806f-d3fbd2cae0cc" /> | <img width="1920" height="1080" alt="Dolphin Emulator Dark Fusion style" src="https://github.com/user-attachments/assets/123d2125-e126-4e8c-aa42-793ded8ffacc" /> | > [!NOTE] > Notice that the **Light** and **Dark** styles remain available only on > Windows due to limitations on how styles in the various platforms > handle (or mishandle) custom color palettes. > [!IMPORTANT] > Due to [`KDE-511547`](https://bugs.kde.org/show_bug.cgi?id=511547), > after having used Breeze (default style in Plasma systems), top tool > bars in tools areas will lose their correct background color; a > restart will be required in order to get the updated color in the main > window. > > UPDATE: The issue has been fixed upstream and should be available in > KDE Plama 6.5.3 and newer.
247 lines
6.8 KiB
C++
247 lines
6.8 KiB
C++
// Copyright 2015 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include <QFont>
|
|
#include <QObject>
|
|
#include <QRadioButton>
|
|
#include <QSettings>
|
|
|
|
#include "Common/Config/Config.h"
|
|
#include "Core/Config/MainSettings.h"
|
|
#include "DiscIO/Enums.h"
|
|
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
|
|
|
namespace Core
|
|
{
|
|
enum class State;
|
|
}
|
|
|
|
namespace DiscIO
|
|
{
|
|
enum class Language;
|
|
}
|
|
|
|
namespace NetPlay
|
|
{
|
|
class NetPlayClient;
|
|
class NetPlayServer;
|
|
} // namespace NetPlay
|
|
|
|
class InputConfig;
|
|
|
|
// UI settings to be stored in the config directory.
|
|
class Settings final : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Settings(const Settings&) = delete;
|
|
Settings& operator=(const Settings&) = delete;
|
|
Settings(Settings&&) = delete;
|
|
Settings& operator=(Settings&&) = delete;
|
|
|
|
~Settings() override;
|
|
|
|
void UnregisterDevicesChangedCallback();
|
|
|
|
static Settings& Instance();
|
|
static QSettings& GetQSettings();
|
|
|
|
// UI
|
|
void TriggerThemeChanged();
|
|
void InitDefaultPalette();
|
|
bool IsSystemDark();
|
|
bool IsThemeDark();
|
|
|
|
void SetUserStyleName(const QString& stylesheet_name);
|
|
QString GetUserStyleName() const;
|
|
|
|
enum class StyleType : int
|
|
{
|
|
System = 0,
|
|
Light = 1,
|
|
Dark = 2,
|
|
User = 3,
|
|
FusionLight = 4,
|
|
FusionDarkGray = 5,
|
|
FusionDark = 6,
|
|
|
|
MinValue = 0,
|
|
MaxValue = 6,
|
|
};
|
|
|
|
void SetStyleType(StyleType type);
|
|
StyleType GetStyleType() const;
|
|
|
|
// this evaluates the current stylesheet settings and refreshes the GUI with them
|
|
void ApplyStyle();
|
|
|
|
void GetToolTipStyle(QColor& window_color, QColor& text_color, QColor& emphasis_text_color,
|
|
QColor& border_color, const QPalette& palette,
|
|
const QPalette& high_contrast_palette) const;
|
|
|
|
bool IsLogVisible() const;
|
|
void SetLogVisible(bool visible);
|
|
bool IsLogConfigVisible() const;
|
|
void SetLogConfigVisible(bool visible);
|
|
void SetToolBarVisible(bool visible);
|
|
bool IsToolBarVisible() const;
|
|
void SetWidgetsLocked(bool visible);
|
|
bool AreWidgetsLocked() const;
|
|
|
|
void RefreshWidgetVisibility();
|
|
|
|
// GameList
|
|
QStringList GetPaths() const;
|
|
void AddPath(const QString& path);
|
|
void RemovePath(const QString& path);
|
|
bool GetPreferredView() const;
|
|
void SetPreferredView(bool list);
|
|
QString GetDefaultGame() const;
|
|
void SetDefaultGame(QString path);
|
|
void RefreshGameList();
|
|
void NotifyRefreshGameListStarted();
|
|
void NotifyRefreshGameListComplete();
|
|
void NotifyMetadataRefreshComplete();
|
|
void ReloadTitleDB();
|
|
bool IsAutoRefreshEnabled() const;
|
|
void SetAutoRefreshEnabled(bool enabled);
|
|
|
|
// Emulation
|
|
int GetStateSlot() const;
|
|
void SetStateSlot(int);
|
|
bool IsBatchModeEnabled() const;
|
|
void SetBatchModeEnabled(bool batch);
|
|
|
|
bool IsSDCardInserted() const;
|
|
void SetSDCardInserted(bool inserted);
|
|
bool IsUSBKeyboardConnected() const;
|
|
void SetUSBKeyboardConnected(bool connected);
|
|
|
|
bool IsWiiSpeakMuted() const;
|
|
void SetWiiSpeakMuted(bool muted);
|
|
|
|
void SetIsContinuouslyFrameStepping(bool is_stepping);
|
|
bool GetIsContinuouslyFrameStepping() const;
|
|
|
|
// Graphics
|
|
Config::ShowCursor GetCursorVisibility() const;
|
|
bool GetLockCursor() const;
|
|
void SetKeepWindowOnTop(bool top);
|
|
bool IsKeepWindowOnTopEnabled() const;
|
|
bool GetGraphicModsEnabled() const;
|
|
void SetGraphicModsEnabled(bool enabled);
|
|
|
|
// Audio
|
|
int GetVolume() const;
|
|
void SetVolume(int volume);
|
|
void IncreaseVolume(int volume);
|
|
void DecreaseVolume(int volume);
|
|
|
|
// NetPlay
|
|
std::shared_ptr<NetPlay::NetPlayClient> GetNetPlayClient();
|
|
void ResetNetPlayClient(NetPlay::NetPlayClient* client = nullptr);
|
|
std::shared_ptr<NetPlay::NetPlayServer> GetNetPlayServer();
|
|
void ResetNetPlayServer(NetPlay::NetPlayServer* server = nullptr);
|
|
|
|
// Cheats
|
|
bool GetCheatsEnabled() const;
|
|
|
|
// Debug
|
|
void SetDebugModeEnabled(bool enabled);
|
|
bool IsDebugModeEnabled() const;
|
|
void SetRegistersVisible(bool enabled);
|
|
bool IsRegistersVisible() const;
|
|
void SetThreadsVisible(bool enabled);
|
|
bool IsThreadsVisible() const;
|
|
void SetWatchVisible(bool enabled);
|
|
bool IsWatchVisible() const;
|
|
void SetBreakpointsVisible(bool enabled);
|
|
bool IsBreakpointsVisible() const;
|
|
void SetCodeVisible(bool enabled);
|
|
bool IsCodeVisible() const;
|
|
void SetMemoryVisible(bool enabled);
|
|
bool IsMemoryVisible() const;
|
|
void SetNetworkVisible(bool enabled);
|
|
bool IsNetworkVisible() const;
|
|
void SetJITVisible(bool enabled);
|
|
bool IsJITVisible() const;
|
|
void SetAssemblerVisible(bool enabled);
|
|
bool IsAssemblerVisible() const;
|
|
QFont GetDebugFont() const;
|
|
void SetDebugFont(QFont font);
|
|
|
|
// Auto-Update
|
|
QString GetAutoUpdateTrack() const;
|
|
void SetAutoUpdateTrack(const QString& mode);
|
|
|
|
// Fallback Region
|
|
DiscIO::Region GetFallbackRegion() const;
|
|
void SetFallbackRegion(const DiscIO::Region& region);
|
|
|
|
// Analytics
|
|
bool IsAnalyticsEnabled() const;
|
|
void SetAnalyticsEnabled(bool enabled);
|
|
|
|
signals:
|
|
void ConfigChanged();
|
|
void EmulationStateChanged(Core::State new_state);
|
|
void ThemeChanged();
|
|
void PathAdded(const QString&);
|
|
void PathRemoved(const QString&);
|
|
void DefaultGameChanged(const QString&);
|
|
void GameListRefreshRequested();
|
|
void GameListRefreshStarted();
|
|
void GameListRefreshCompleted();
|
|
void TitleDBReloadRequested();
|
|
void MetadataRefreshRequested();
|
|
void MetadataRefreshCompleted();
|
|
void AutoRefreshToggled(bool enabled);
|
|
void CursorVisibilityChanged();
|
|
void LockCursorChanged();
|
|
void KeepWindowOnTopChanged(bool top);
|
|
void NANDRefresh();
|
|
void RegistersVisibilityChanged(bool visible);
|
|
void ThreadsVisibilityChanged(bool visible);
|
|
void LogVisibilityChanged(bool visible);
|
|
void LogConfigVisibilityChanged(bool visible);
|
|
void ToolBarVisibilityChanged(bool visible);
|
|
void WidgetLockChanged(bool locked);
|
|
void EnableCheatsChanged(bool enabled);
|
|
void WatchVisibilityChanged(bool visible);
|
|
void BreakpointsVisibilityChanged(bool visible);
|
|
void CodeVisibilityChanged(bool visible);
|
|
void MemoryVisibilityChanged(bool visible);
|
|
void NetworkVisibilityChanged(bool visible);
|
|
void JITVisibilityChanged(bool visible);
|
|
void AssemblerVisibilityChanged(bool visible);
|
|
void DebugModeToggled(bool enabled);
|
|
void DebugFontChanged(const QFont& font);
|
|
void AutoUpdateTrackChanged(const QString& mode);
|
|
void FallbackRegionChanged(const DiscIO::Region& region);
|
|
void AnalyticsToggled(bool enabled);
|
|
void ReleaseDevices();
|
|
void DevicesChanged();
|
|
void WiiSpeakMuteChanged(bool muted);
|
|
void EnableGfxModsChanged(bool enabled);
|
|
|
|
private:
|
|
Settings();
|
|
|
|
bool m_batch = false;
|
|
std::atomic<bool> m_continuously_frame_stepping = false;
|
|
|
|
std::shared_ptr<NetPlay::NetPlayClient> m_client;
|
|
std::shared_ptr<NetPlay::NetPlayServer> m_server;
|
|
Common::EventHook m_hotplug_event_hook;
|
|
Config::ConfigChangedCallbackID m_config_changed_callback_id;
|
|
|
|
Common::EventHook m_core_state_changed_hook;
|
|
};
|
|
|
|
Q_DECLARE_METATYPE(Core::State);
|