Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
ThemeColorEditor Class Reference

#include <theme_color_editor.h>

Inheritance diagram for ThemeColorEditor:

Signals

void draftChanged ()
void childDialogClosed ()

Public Member Functions

 ThemeColorEditor (QWidget *parent=nullptr)
void setDrafts (const ThemeDraft &base, const ThemeDraft &draft)
const ThemeDraft & draft () const
void setDarkSide (bool dark)
int editedCount () const
int changedCount () const
int invalidCount () const
QString firstInvalidPath () const
bool selectToken (ThemeManager::ThemeToken token, bool *filter_cleared=nullptr)
QString tokenLabel (ThemeManager::ThemeToken token) const
QIcon tokenSwatch (ThemeManager::ThemeToken token) const

Static Public Member Functions

static QString editedMarkHtml ()

Detailed Description

Color list and detail panel of the Theme Designer.

Lists every color a theme file can set, the graph color cycle and, read-only, every derived color. Each row is marked "edited" when the draft input differs from the base theme, "changed" when only its resolved value differs (a consequence of another edit), "required" for the brand and accent inputs, or shows the derived value in italics when the key is not set. The detail panel below the list edits both sides of the selected color.

Text that is not a color is kept per field and reported through invalidCount() and firstInvalidPath(); the draft keeps the last valid value.

Member Function Documentation

◆ changedCount()

int ThemeColorEditor::changedCount ( ) const

Rows marked "changed" (resolved value differs, input unchanged).

◆ childDialogClosed

void ThemeColorEditor::childDialogClosed ( )
signal

The color dialog was closed, with or without a choice.

◆ draft()

const ThemeDraft & ThemeColorEditor::draft ( ) const
inline

The draft with every valid edit applied.

◆ draftChanged

void ThemeColorEditor::draftChanged ( )
signal

Any input change, including a change of invalidCount().

◆ editedCount()

int ThemeColorEditor::editedCount ( ) const

Rows marked "edited", including graph slots removed from the base.

◆ editedMarkHtml()

QString ThemeColorEditor::editedMarkHtml ( )
static

The bold " edited" mark appended to a title, in the theme's edit color. Shared so every title in the designer marks edits the same way.

◆ firstInvalidPath()

QString ThemeColorEditor::firstInvalidPath ( ) const

JSON path of the first field in list order that holds text that is not a color, e.g. "packets.marked.dark"; empty when there is none.

◆ invalidCount()

int ThemeColorEditor::invalidCount ( ) const
inline

Fields that hold text that is not a color.

◆ selectToken()

bool ThemeColorEditor::selectToken ( ThemeManager::ThemeToken token,
bool * filter_cleared = nullptr )

Selects and centers the row of token. Color and derived rows share the token-valued row id, so either kind is found. A row hidden by the filter text or the "changed only" check box gets both cleared first.

Parameters
tokenthe color to show.
filter_clearedset to true when a filter had to be cleared.
Returns
false when token has no row.

◆ setDarkSide()

void ThemeColorEditor::setDarkSide ( bool dark)

Selects the side the list values and swatches show.

◆ setDrafts()

void ThemeColorEditor::setDrafts ( const ThemeDraft & base,
const ThemeDraft & draft )

Replaces the base theme the marks compare against and the draft being edited. The selected row is kept when it still exists. Text that is not a color is dropped when another theme or other colors come in.

Parameters
basethe saved theme the draft was loaded from.
draftthe draft to edit.

◆ tokenLabel()

QString ThemeColorEditor::tokenLabel ( ThemeManager::ThemeToken token) const

The label the list shows for token, or its name when it has no row.

◆ tokenSwatch()

QIcon ThemeColorEditor::tokenSwatch ( ThemeManager::ThemeToken token) const

A swatch of the resolved value of token on the shown side.


The documentation for this class was generated from the following files: