1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
// Copyright 2015 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QDialog>
class QStackedWidget;
class QListWidget;
class MainWindow;
class QEvent;
// A settings window with a QListWidget to switch between panes of a QStackedWidget.
class StackedSettingsWindow : public QDialog
{
Q_OBJECT
public:
explicit StackedSettingsWindow(QWidget* parent = nullptr);
void ActivatePane(int index);
protected:
void AddPane(QWidget*, const QString& name);
// Adds a scrollable Pane.
void AddWrappedPane(QWidget*, const QString& name);
// For derived classes to call after they create their settings panes.
void OnDoneCreatingPanes();
void changeEvent(QEvent* event) override;
private:
void UpdateNavigationListStyle();
QStackedWidget* m_stacked_panes = nullptr;
QListWidget* m_navigation_list = nullptr;
bool m_handling_theme_change = false;
};
enum class SettingsWindowPaneIndex : int
{
General = 0,
Graphics,
Controllers,
Interface,
OnScreenDisplay,
Audio,
Paths,
GameCube,
Wii,
Triforce,
Advanced,
};
class SettingsWindow final : public StackedSettingsWindow
{
Q_OBJECT
public:
explicit SettingsWindow(MainWindow* parent);
void SelectPane(SettingsWindowPaneIndex);
void closeEvent(QCloseEvent* event) override;
};
|