Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgnometheme_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QGNOMETHEME_P_H
6#define QGNOMETHEME_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20#include <qpa/qplatformtheme.h>
21#include <qpa/qplatformtheme_p.h>
22#include <QtGui/QFont>
23#if QT_CONFIG(dbus)
24# include "qgnomeportalinterface_p.h"
25#endif // QT_CONFIG(dbus)
26
28
29class QGnomeThemePrivate;
30
31class Q_GUI_EXPORT QGnomeTheme : public QGenericUnixTheme
32{
33protected:
34 Q_DECLARE_PRIVATE(QGnomeTheme)
35
36public:
37 QGnomeTheme();
38 QVariant themeHint(ThemeHint hint) const override;
39 QIcon fileIcon(const QFileInfo &fileInfo,
40 QPlatformTheme::IconOptions = { }) const override;
41 const QFont *font(Font type) const override;
42 QString standardButtonText(int button) const override;
43
44 virtual QString gtkFontName() const;
45
46 virtual void requestColorScheme(Qt::ColorScheme) override;
47 virtual Qt::ColorScheme colorScheme() const override;
48
49#if QT_CONFIG(dbus)
50protected:
51 virtual void updateColorScheme(Qt::ColorScheme);
52 virtual void updateHighContrast(Qt::ContrastPreference);
53
54public:
55 QPlatformMenuBar *createPlatformMenuBar() const override;
56 Qt::ContrastPreference contrastPreference() const override;
57
58# if QT_CONFIG(systemtrayicon)
59 QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
60# endif // QT_CONFIG(systemtrayicon)
61#endif // QT_CONFIG(dbus)
62
63 static const char *name;
64};
65
66class Q_GUI_EXPORT QGnomeThemePrivate : public QGenericUnixThemePrivate
67{
68 friend QGnomeTheme;
69
70public:
71 QGnomeThemePrivate();
72 ~QGnomeThemePrivate();
73
74 void configureFonts(const QString &gtkFontName) const;
75
76 Qt::ColorScheme colorScheme() const;
77 bool hasRequestedColorScheme() const;
78
79private:
80 mutable QFont *systemFont = nullptr;
81 mutable QFont *fixedFont = nullptr;
82
83 Qt::ColorScheme m_requestedColorScheme = Qt::ColorScheme::Unknown;
84
85#if QT_CONFIG(dbus)
86 QGnomePortalInterface m_gnomePortal;
87 QString m_themeName;
88#endif // QT_CONFIG(dbus)
89};
90
91QT_END_NAMESPACE
92#endif // QGNOMETHEME_P_H
QGnomeTheme is a theme implementation for the Gnome desktop.