![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qgtk3storage_p.h>
Classes | |
| struct | FixedSource |
| struct | Gtk3Source |
| struct | MixSources |
| struct | RecursiveSource |
| struct | Source |
| struct | TargetBrush |
Public Types | |
| enum class | SourceType { Gtk , Fixed , Modified , Mixed , Invalid } |
| This enum represents the type of a color source. More... | |
| typedef QFlatMap< TargetBrush, Source > | BrushMap |
| typedef QFlatMap< QPlatformTheme::Palette, BrushMap > | PaletteMap |
Public Member Functions | |
| QGtk3Storage () | |
| ~QGtk3Storage () | |
| const QPalette * | palette (QPlatformTheme::Palette=QPlatformTheme::SystemPalette) const |
| Return a GTK styled QPalette. | |
| QPixmap | standardPixmap (QPlatformTheme::StandardPixmap standardPixmap, const QSizeF &size) const |
| Return a GTK styled standard pixmap if available. | |
| Qt::ColorScheme | colorScheme () const |
| const QString | themeName () const |
| const QFont * | font (QPlatformTheme::Font type) const |
| Return a GTK styled font. | |
| QIcon | fileIcon (const QFileInfo &fileInfo) const |
| Returns a GTK styled file icon corresponding to. | |
| void | populateMap () |
| Populates a map with information about how to locate colors in GTK. | |
| void | handleThemeChange () |
| Handles a theme change at runtime. | |
Static Public Member Functions | |
| static QPalette | standardPalette () |
| Returns a simple, hard coded base palette. | |
Definition at line 36 of file qgtk3storage_p.h.
| typedef QFlatMap<TargetBrush, Source> QGtk3Storage::BrushMap |
Definition at line 225 of file qgtk3storage_p.h.
Definition at line 228 of file qgtk3storage_p.h.
|
strong |
This enum represents the type of a color source.
\value Gtk Color is read from a GTK widget \value Fixed A fixed brush is specified \value Modified The color is a modification of another color (fixed or read from GTK) \omitvalue Invalid
| Enumerator | |
|---|---|
| Gtk | |
| Fixed | |
| Modified | |
| Mixed | |
| Invalid | |
Definition at line 44 of file qgtk3storage_p.h.
| QT_BEGIN_NAMESPACE QGtk3Storage::QGtk3Storage | ( | ) |
Definition at line 25 of file qgtk3storage.cpp.
| QGtk3Storage::~QGtk3Storage | ( | ) |
Definition at line 34 of file qgtk3storage.cpp.
|
inline |
Definition at line 233 of file qgtk3storage_p.h.
Returns a GTK styled file icon corresponding to.
| fileInfo. |
Definition at line 281 of file qgtk3storage.cpp.
| const QFont * QGtk3Storage::font | ( | QPlatformTheme::Font | type | ) | const |
Return a GTK styled font.
Returns a QFont of
| type,styled | according to the current GTK theme. |
Definition at line 244 of file qgtk3storage.cpp.
| void QGtk3Storage::handleThemeChange | ( | ) |
Handles a theme change at runtime.
Clear all caches, re-populate with current GTK theme and notify the window system interface. This method is a callback for the theme change signal sent from GTK.
Definition at line 308 of file qgtk3storage.cpp.
References populateMap().
Referenced by QGtk3Interface::QGtk3Interface().
| const QPalette * QGtk3Storage::palette | ( | QPlatformTheme::Palette | type = QPlatformTheme::SystemPalette | ) | const |
Return a GTK styled QPalette.
Returns the pointer to a (cached) QPalette for
| type,with | its brushes populated according to the current GTK theme. |
Definition at line 184 of file qgtk3storage.cpp.
| void QGtk3Storage::populateMap | ( | ) |
Populates a map with information about how to locate colors in GTK.
This method creates a data structure to locate color information for each brush of a QPalette within GTK. The structure can hold mapping information for each QPlatformTheme::Palette enum value. If no specific mapping is stored for an enum value, the system palette is returned instead of a specific one. If no mapping is stored for the system palette, it will fall back to QGtk3Storage::standardPalette.
The method will populate the data structure with a standard mapping, covering the following palette types: \list
The method will check the environment variable {{QT_GUI_GTK_JSON_SAVE}}. If it points to a valid path with write access, it will write the standard mapping into a Json file. That Json file can be modified and/or extended. The Json syntax is
If the environment variable {{QT_GUI_GTK_JSON_HARDCODED}} contains the keyword true, all sources are converted to fixed sources. In that case, they contain the hard coded HexRGBA values read from GTK.
The method will also check the environment variable {{QT_GUI_GTK_JSON}}. If it points to a valid Json file with read access, it will be parsed instead of creating a standard mapping. Parsing errors will be printed out with qCInfo if the logging category {{qt.qpa.gtk}} is activated. In case of a parsing error, the method will fall back to creating a standard mapping.
Definition at line 362 of file qgtk3storage.cpp.
Referenced by handleThemeChange().
|
static |
Returns a simple, hard coded base palette.
Create a hard coded palette with default colors as a fallback for any color that can't be obtained from GTK.
Definition at line 161 of file qgtk3storage.cpp.
| QPixmap QGtk3Storage::standardPixmap | ( | QPlatformTheme::StandardPixmap | standardPixmap, |
| const QSizeF & | size ) const |
Return a GTK styled standard pixmap if available.
Returns a pixmap specified by
| standardPixmap | and |
| size. | Returns an empty pixmap if GTK doesn't support the requested one. |
Definition at line 260 of file qgtk3storage.cpp.
|
inline |
Definition at line 235 of file qgtk3storage_p.h.