Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
token_palette.h File Reference
#include <ui/qt/utils/theme_manager.h>
#include <QApplication>
#include <QColor>
#include <QPalette>
#include <memory>
#include <optional>

Go to the source code of this file.

Typedefs

using IconPaletteRef = std::shared_ptr<std::optional<QPalette>>
 Palette override shared between an icon object and its engine, so that ThemedIcon::setPalette() / ContrastAdaptIcon::setPalette() reach the engine even though QIcon hides it. Empty means "use the application palette".

Functions

IconPaletteRef makeIconPaletteRef ()
const QPalette * iconPalettePtr (const IconPaletteRef &ref)
QColor resolveIconToken (ThemeManager::ThemeToken token, const QPalette *palette)
 Resolve a theme token for an icon engine, optionally against a caller-supplied palette.

Detailed Description

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ resolveIconToken()

QColor resolveIconToken ( ThemeManager::ThemeToken token,
const QPalette * palette )
inline

Resolve a theme token for an icon engine, optionally against a caller-supplied palette.

When palette is non-null, the Palette* tokens that mirror a QPalette role (PaletteWindow, PaletteText, ...) are read from it, so an icon can be previewed against a palette other than the application's. Every other token — and any Palette* token with no matching role — comes from the live ThemeManager. If that is also invalid the result is the palette's (or the application's) Text colour.