10#ifndef THEME_MANAGER_H
11#define THEME_MANAGER_H
119 PacketsSelectionText,
130 ConversationClientText,
132 ConversationServerText,
153 PaletteAlternateBase,
156#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
184 UpdateButtonDisabledBg,
185 UpdateButtonDisabledText,
186 UpdateDismissHoverBg,
187 UpdateDismissPressedBg,
190 HighlightColorOrange,
205 static void init(
const QString &theme = QStringLiteral(
"default"));
235 QColor
color(ThemeToken role)
const;
237 bool colorIsAvailable(ThemeToken role)
const;
258 QHash<ThemeToken, QColor>
previewTheme(
const QString &internalName,
259 bool wantDark)
const;
294 static QString
styleSheet(
const QString &name);
366 QColor graphDefaultColor()
const;
375 QFont regularFont()
const;
376 QFont monospaceFont()
const;
387 static QMutex mutex_;
392 QHash<ThemeManager::ThemeToken, ThemeColorPair> themeColors_;
393 QList<ThemeColorPair> graphColors_;
396 QFont monospace_font_;
398 QHash<QString, ThemeSectionInfo> sections_;
401 QHash<QString, ThemeToken> colorRoleCache_;
402 QHash<QString, QPalette::ColorRole> paletteRoleCache_;
424 QPalette osBaseline_;
436 QPalette baselineForBuild()
const;
444 void reapplyForSchemeChange();
451 static ThemeMode modeFromPrefs(
int gui_color_scheme);
459 void applyToStyleHints();
467 void applyApplicationStyleSheet();
477 bool loadTheme(
const QString &themeName = QStringLiteral(
"default"));
Definition system_theme_detector.h:38
Definition theme_manager.h:74
static bool isDark()
Definition theme_manager.cpp:222
static void init(const QString &theme=QStringLiteral("default"))
Definition theme_manager.cpp:174
void setMode(ThemeMode mode)
Definition theme_manager.cpp:267
QHash< ThemeToken, QColor > previewTheme(const QString &internalName, bool wantDark) const
Definition theme_manager.cpp:432
QColor graphColor(int idx) const
Returns the graph color for the given index, cycling through available graph colors if necessary.
Definition theme_manager.cpp:560
static QString styleSheet(const QString &name)
Definition theme_manager.cpp:416
QString loadStyleSheet(const QString &name) const
Definition theme_manager.cpp:411
ThemeMode
Definition theme_manager.h:87
ThemeMode mode() const
Definition theme_manager.cpp:262
qsizetype graphColorCount() const
Returns the number of graph colors defined in the theme.
Definition theme_manager.cpp:587
bool isDarkMode() const
Definition theme_manager.cpp:227
static void setValidationState(QWidget *w, const QString &state)
Definition theme_manager.cpp:421
static QList< ThemeInfo > availableThemes()
Definition theme_manager.cpp:191
ThemeInfo info() const
Definition theme_manager.cpp:186
QColor color(ThemeToken role) const
Definition theme_manager.cpp:374
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