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

#include <theme_welcome_preview.h>

Inheritance diagram for ThemeWelcomePreview:

Signals

void layerPicked (const ThemePreviewPick::Layer &layer)
void pickMenuRequested (QMenu *menu, QAction *before, const QList< ThemePreviewPick::Layer > &layers)
void childDialogClosed ()

Public Member Functions

 ThemeWelcomePreview (QWidget *parent=nullptr)
void setTheme (const QHash< ThemeManager::ThemeToken, ThemeColorPair > &tokens, bool dark, const QPalette &palette)
void setPreviewFont (const QFont &regular)
ThemePreviewPicker & picker ()

Protected Member Functions

void mouseMoveEvent (QMouseEvent *event) override
void mousePressEvent (QMouseEvent *event) override
void contextMenuEvent (QContextMenuEvent *event) override

Detailed Description

Compact, static copy of the Welcome Page for the Theme Designer.

The widget tree reuses the object names of the real welcome widgets and styles itself from the real welcome style sheets, resolved against a draft token map instead of the live theme. The widget never reads the live theme: colors and palette come only from setTheme(), so the draft can be shown without touching the application. The learn card is the real LearnCardWidget, told to leave its styling to this widget's sheet.

With picking enabled (picker()) a click names the theme color that paints the spot, found with ThemePreviewPick's key render of a hidden copy of this widget.

Member Function Documentation

◆ childDialogClosed

void ThemeWelcomePreview::childDialogClosed ( )
signal

A dialog opened from this widget (Save Image As) was closed.

◆ layerPicked

void ThemeWelcomePreview::layerPicked ( const ThemePreviewPick::Layer & layer)
signal

A left click while picking; layer has token NoRole on a spot without theme color.

◆ picker()

ThemePreviewPicker & ThemeWelcomePreview::picker ( )
inline

Click-to-pick support, off by default. While on, a pickable spot shows a hand cursor, a left click emits layerPicked() and the context menu offers the colors of the spot.

◆ pickMenuRequested

void ThemeWelcomePreview::pickMenuRequested ( QMenu * menu,
QAction * before,
const QList< ThemePreviewPick::Layer > & layers )
signal

Emitted synchronously before the context menu opens, only while picking is enabled. Receivers insert color actions before before.

◆ setPreviewFont()

void ThemeWelcomePreview::setPreviewFont ( const QFont & regular)

Sets the regular (proportional) font used for all preview text; an unchanged font is ignored.

◆ setTheme()

void ThemeWelcomePreview::setTheme ( const QHash< ThemeManager::ThemeToken, ThemeColorPair > & tokens,
bool dark,
const QPalette & palette )

Applies a draft to the preview.

Parameters
tokensdraft token map (both sides of every color pair)
darkwhich side of the pairs to show
palettepalette for the preview (the draft's Palette* tokens)

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