-
Notifications
You must be signed in to change notification settings - Fork 103
/
theme_manager.h
57 lines (45 loc) · 1.21 KB
/
theme_manager.h
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
/*
SPDX-FileCopyrightText: 2009-2014 Graeme Gott <graeme@gottcode.org>
SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef FOCUSWRITER_THEME_MANAGER_H
#define FOCUSWRITER_THEME_MANAGER_H
class Theme;
#include <QDialog>
class QListWidget;
class QListWidgetItem;
class QSettings;
class QTabWidget;
class ThemeManager : public QDialog
{
Q_OBJECT
public:
explicit ThemeManager(QSettings& settings, QWidget* parent = nullptr);
Q_SIGNALS:
void themeSelected(const Theme& theme);
protected:
void hideEvent(QHideEvent* event) override;
private Q_SLOTS:
void newTheme();
void editTheme();
void cloneTheme();
void deleteTheme();
void importTheme();
void exportTheme();
void currentThemeChanged(const QListWidgetItem* current);
private:
QListWidgetItem* addItem(const QString& id, bool is_default, const QString& name);
bool selectItem(const QString& id, bool is_default);
void selectionChanged(bool is_default);
private:
QTabWidget* m_tabs;
QListWidget* m_default_themes;
QListWidget* m_themes;
QSettings& m_settings;
QPushButton* m_clone_default_button;
QPushButton* m_clone_button;
QPushButton* m_edit_button;
QPushButton* m_remove_button;
QPushButton* m_export_button;
};
#endif // FOCUSWRITER_THEME_MANAGER_H