Sayonara Player
GUI_FontConfig.h
1 
2 /* Copyright (C) 2011-2017 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_FONTCONFIG_H
21 #define GUI_FONTCONFIG_H
22 
23 #include "Interfaces/PreferenceDialog/PreferenceWidget.h"
24 #include "Utils/Pimpl.h"
25 
26 UI_FWD(GUI_FontConfig)
27 
28 class QFont;
29 class QFontDatabase;
30 
32  public Preferences::Base
33 {
34  Q_OBJECT
35  UI_CLASS(GUI_FontConfig)
36  PIMPL(GUI_FontConfig)
37 
38 public:
39  explicit GUI_FontConfig(const QString& identifier);
40  virtual ~GUI_FontConfig();
41 
42  bool commit() override;
43  void revert() override;
44 
45  QString action_name() const override;
46 
47 
48 protected:
49  void init_ui() override;
50  void retranslate_ui() override;
51 
52 
53 protected slots:
54  void default_clicked();
55  void combo_fonts_changed(const QFont& font);
56  void skin_changed() override;
57 
58 private:
59  QStringList get_available_font_sizes(const QString& font_name, const QString& style=QString());
60  QStringList get_available_font_sizes(const QFont& font);
61 
62  void fill_sizes(const QStringList& sizes);
63 };
64 
65 #endif // FONTCONFIG_H
void init_ui() override
call setup_parent(this) here. initialize compoenents and connections here. After calling setup_parent...
void revert() override
This method is called, when cancel is clicked. So the gui should be re-initialized when this method i...
QString action_name() const override
has to be implemented and should return the translated action text
Definition: GUI_FontConfig.h:31
void retranslate_ui() override
call the Qt retranslateUi method here
Abstract Interface you should use when creating a preferences item.
Definition: PreferenceWidget.h:41
bool commit() override
This method is called, when OK or apply is pressed. So all settings should be written there...