mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 03:12:45 +01:00
e26e82d8d5
Sets up initial support for implementing colored tristate functions. These functions color a QWidget blue when it's overriding a global setting, and discolor it when not. The lack of color indicates it uses the global state, replacing the Qt::CheckState::PartiallyChecked state with the global state.
52 lines
1.8 KiB
C++
52 lines
1.8 KiB
C++
// Copyright 2016 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <QCheckBox>
|
|
#include <QComboBox>
|
|
#include <QString>
|
|
#include "core/settings.h"
|
|
|
|
namespace ConfigurationShared {
|
|
|
|
constexpr int USE_GLOBAL_INDEX = 0;
|
|
constexpr int USE_GLOBAL_SEPARATOR_INDEX = 1;
|
|
constexpr int USE_GLOBAL_OFFSET = 2;
|
|
|
|
enum CheckState {
|
|
Off,
|
|
On,
|
|
Global,
|
|
Count,
|
|
};
|
|
|
|
struct Trackers {
|
|
} extern trackers;
|
|
|
|
// Global-aware apply and set functions
|
|
|
|
void ApplyPerGameSetting(Settings::Setting<bool>* setting, const QCheckBox* checkbox,
|
|
const CheckState& tracker);
|
|
void ApplyPerGameSetting(Settings::Setting<bool>* setting, const QCheckBox* checkbox);
|
|
void ApplyPerGameSetting(Settings::Setting<int>* setting, const QComboBox* combobox);
|
|
void ApplyPerGameSetting(Settings::Setting<Settings::RendererBackend>* setting,
|
|
const QComboBox* combobox);
|
|
void ApplyPerGameSetting(Settings::Setting<Settings::GPUAccuracy>* setting,
|
|
const QComboBox* combobox);
|
|
|
|
void SetPerGameSetting(QCheckBox* checkbox, const Settings::Setting<bool>* setting);
|
|
void SetPerGameSetting(QComboBox* combobox, const Settings::Setting<int>* setting);
|
|
void SetPerGameSetting(QComboBox* combobox,
|
|
const Settings::Setting<Settings::RendererBackend>* setting);
|
|
void SetPerGameSetting(QComboBox* combobox,
|
|
const Settings::Setting<Settings::GPUAccuracy>* setting);
|
|
|
|
void SetBGColor(QWidget* widget, bool highlighted);
|
|
void SetColoredTristate(QCheckBox* checkbox, Settings::Setting<bool>& setting,
|
|
ConfigurationShared::CheckState& tracker);
|
|
|
|
void InsertGlobalItem(QComboBox* combobox);
|
|
|
|
} // namespace ConfigurationShared
|