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 virtual void updateReducedMotion(Qt::MotionPreference);
54
55public:
56 QPlatformMenuBar *createPlatformMenuBar() const override;
57 Qt::ContrastPreference contrastPreference() const override;
58 Qt::MotionPreference motionPreference() const override;
59
60# if QT_CONFIG(systemtrayicon)
61 QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
62# endif // QT_CONFIG(systemtrayicon)
63#endif // QT_CONFIG(dbus)
64
65 static const char *name;
66};
67
68class Q_GUI_EXPORT QGnomeThemePrivate : public QGenericUnixThemePrivate
69{
70 friend QGnomeTheme;
71
72public:
73 QGnomeThemePrivate();
74 ~QGnomeThemePrivate();
75
76 void configureFonts(const QString &gtkFontName) const;
77
78 Qt::ColorScheme colorScheme() const;
79 bool hasRequestedColorScheme() const;
80
81private:
82 mutable QFont *systemFont = nullptr;
83 mutable QFont *fixedFont = nullptr;
84
85 Qt::ColorScheme m_requestedColorScheme = Qt::ColorScheme::Unknown;
86
87#if QT_CONFIG(dbus)
88 QGnomePortalInterface m_gnomePortal;
89 QString m_themeName;
90#endif // QT_CONFIG(dbus)
91};
92
93QT_END_NAMESPACE
94#endif // QGNOMETHEME_P_H
QGnomeTheme is a theme implementation for the Gnome desktop.
Combined button and popup list for selecting options.