10#ifndef THEME_MANAGER_H
11#define THEME_MANAGER_H
141 PacketsSelectionText,
152 ConversationClientText,
154 ConversationServerText,
176 FilterBookmarkCapture,
197 PaletteAlternateBase,
205 PaletteHighlightedText,
206#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
249 UpdateButtonDisabledBg,
250 UpdateButtonDisabledText,
251 UpdateDismissHoverBg,
252 UpdateDismissPressedBg,
255 HighlightColorOrange,
323 static void init(
const QString &theme = QString());
330 ThemeInfo
info()
const;
353 QColor
color(ThemeToken role)
const;
355 bool colorIsAvailable(ThemeToken role)
const;
380 QHash<ThemeToken, QColor>
previewTheme(
const QString &internalName,
432 static QString
styleSheet(
const QString &name);
504 QColor graphDefaultColor()
const;
522 static QMutex mutex_;
527 QHash<ThemeManager::ThemeToken, ThemeColorPair> themeColors_;
528 QList<ThemeColorPair> graphColors_;
530 QHash<QString, ThemeSectionInfo> sections_;
533 QHash<QString, ThemeToken> colorRoleCache_;
534 QHash<QString, QPalette::ColorRole> paletteRoleCache_;
542 SystemThemeDetector *detector_ =
nullptr;
556 QPalette osBaseline_;
568 QPalette baselineForBuild()
const;
576 void reapplyForSchemeChange();
583 static ThemeMode modeFromPrefs(
int gui_color_scheme);
591 void applyToStyleHints();
599 void applyApplicationStyleSheet();
614 bool loadTheme(
const QString &themeName = QString());
Definition system_theme_detector.h:38
static bool isDark()
Definition theme_manager.cpp:366
static void init(const QString &theme=QString())
Definition theme_manager.cpp:256
void setMode(ThemeMode mode)
Definition theme_manager.cpp:411
QColor graphColor(int idx) const
Returns the graph color for the given index, cycling through available graph colors if necessary.
Definition theme_manager.cpp:805
static QString styleSheet(const QString &name)
Definition theme_manager.cpp:604
PreviewScheme
Definition theme_manager.h:109
QString loadStyleSheet(const QString &name) const
Definition theme_manager.cpp:596
ThemeMode
Definition theme_manager.h:87
ThemeMode mode() const
Definition theme_manager.cpp:406
static QString defaultThemeName()
Definition theme_manager.cpp:228
QHash< ThemeToken, QColor > previewTheme(const QString &internalName, PreviewScheme scheme) const
Definition theme_manager.cpp:620
qsizetype graphColorCount() const
Returns the number of graph colors defined in the theme.
Definition theme_manager.cpp:832
bool isDarkMode() const
Definition theme_manager.cpp:371
static void setValidationState(QWidget *w, const QString &state)
Definition theme_manager.cpp:609
static QList< ThemeInfo > availableThemes()
Definition theme_manager.cpp:292
static QString resolveThemeName(const QString &name)
Definition theme_manager.cpp:244
bool validateThemeFile(const QString &filePath) const
Definition theme_manager.cpp:707
ThemeManager(QObject *parent=nullptr)
Definition theme_manager.cpp:88
ThemeInfo info() const
Definition theme_manager.cpp:287
QColor color(ThemeToken role) const
Definition theme_manager.cpp:518
Definition theme_manager.h:39
Definition theme_manager.h:26
int version
Schema version (currently 1).
Definition theme_manager.h:29
QString name
Display name, e.g. "Wireshark Default".
Definition theme_manager.h:27
QString author
Theme author or organization.
Definition theme_manager.h:31
QString description
One-line description shown in preferences.
Definition theme_manager.h:30
QString internalName
Internal name, e.g. "default".
Definition theme_manager.h:28
Definition theme_manager.h:34