Sayonara Player
GuiUtils.h
1 /* GuiUtils.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef GUI_UTILS_H
22 #define GUI_UTILS_H
23 
24 class QWidget;
25 class QPixmap;
26 class QColor;
27 class QFontMetrics;
28 class QImage;
29 class QString;
30 class QIcon;
31 class QPoint;
32 class QMainWindow;
33 class QScreen;
34 class QSize;
35 
36 template<typename T>
37 class QList;
38 
39 #include <QPalette>
40 
41 namespace Gui
42 {
43  namespace Util
44  {
45  enum IconTheme
46  {
47  MintY,
48  NoTheme
49  };
50 
51  QIcon icon(const QString& iconName, IconTheme iconTheme);
52  QIcon systemThemeIcon(const QString& iconName);
53 
54  QImage image(const QString& iconName, IconTheme themeName);
55  QImage image(const QString& iconName, IconTheme themeName, const QSize& size, bool keepAspectRatio = true);
56 
57  QPixmap pixmap(const QString& iconName, IconTheme themeName);
58  QPixmap pixmap(const QString& iconName, IconTheme themeName, const QSize& size, bool keepAspectRatio = true);
59 
60  QScreen* getBiggestScreen();
61 
62  QColor color(QPalette::ColorGroup colorGroup, QPalette::ColorRole colorRole);
63 
64  void placeInScreenCenter(QWidget* widget, float relativeSizeX, float relativeSizeY);
65 
66  int textWidth(const QFontMetrics& fm, const QString& text);
67  int textWidth(QWidget* widget, const QString& text);
68 
69  int viewRowHeight();
70  }
71 }
72 
73 #endif // GUI_UTILS_H
Definition: EngineUtils.h:33
Helper functions.
Definition: GenreView.h:36