Sayonara Player
Loading...
Searching...
No Matches
GuiUtils.h
1/* GuiUtils.h */
2
3/* Copyright (C) 2011-2024 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
24class QWidget;
25class QPixmap;
26class QColor;
27class QFontMetrics;
28class QImage;
29class QString;
30class QIcon;
31class QPoint;
32class QMainWindow;
33class QScreen;
34class QSize;
35
36template<typename T>
37class QList;
38
39#include <QPalette>
40
41namespace Gui
42{
43 namespace Util
44 {
45 enum IconTheme
46 {
47 Dark, // MintY icons
48 Internal // Self painted icons
49 };
50
51 QImage image(const QString& iconName, IconTheme themeName);
52 QImage image(const QString& iconName, IconTheme themeName, const QSize& size, bool keepAspectRatio = true);
53
54 QScreen* getBiggestScreen();
55
56 QColor color(QPalette::ColorGroup colorGroup, QPalette::ColorRole colorRole);
57
58 void placeInScreenCenter(QWidget* widget, float relativeSizeX, float relativeSizeY);
59
60 int textWidth(const QFontMetrics& fm, const QString& text);
61 int textWidth(QWidget* widget, const QString& text);
62
63 int viewRowHeight(const QFontMetrics& fontMetrics);
64 }
65}
66
67#endif // GUI_UTILS_H
Definition EngineUtils.h:33
Helper functions.
Definition MetaTypeRegistry.h:25