Sayonara Player
GUI_FontPreferences.h
1 
2 /* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
3  *
4  * This file is part of sayonara player
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15 
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef GUI_FONTPREFERENCES_H
21 #define GUI_FONTPREFERENCES_H
22 
23 #include "Gui/Utils/Widgets/Widget.h"
24 #include "Utils/Pimpl.h"
25 
26 UI_FWD(GUI_FontPreferences)
27 
28 class QFont;
29 class QFontDatabase;
30 
32  public Gui::Widget
33 {
34  Q_OBJECT
35  UI_CLASS(GUI_FontPreferences)
36  PIMPL(GUI_FontPreferences)
37 
38 public:
39  explicit GUI_FontPreferences(QWidget* parent=nullptr);
40  ~GUI_FontPreferences() override;
41 
42  bool commit();
43  void revert();
44 
45  QString actionName() const;
46 
47 protected:
48  void languageChanged() override;
49  void skinChanged() override;
50  void showEvent(QShowEvent* e) override;
51 
52 protected slots:
53  void defaultClicked();
54  void comboFontsChanged(const QFont& font);
55 
56 private:
57  QStringList availableFontSizes(const QString& fontName, const QString& style=QString());
58  QStringList availableFontSizes(const QFont& font);
59 
60  void fillSizes(const QStringList& sizes);
61  void initUi();
62 };
63 
64 #endif // FONTCONFIG_H
Style::style
QString style(bool dark)
fetch the stylesheet file formatted as string
Gui::Widget
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() \nT...
Definition: Widget.h:39
GUI_FontPreferences
Definition: GUI_FontPreferences.h:33