Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
ThemePreviewWidget Class Reference

#include <theme_preview_widget.h>

Inheritance diagram for ThemePreviewWidget:

Public Member Functions

 ThemePreviewWidget (QWidget *parent=nullptr)
 
void setPreviewColors (const QHash< ThemeManager::ThemeToken, QColor > &colors)
 

Protected Member Functions

void paintEvent (QPaintEvent *evt) override
 
QSize sizeHint () const override
 
QSize minimumSizeHint () const override
 

Detailed Description

Static, hand-painted 3-pane mockup of a Wireshark capture window (filter bar + packet list + details/bytes). Used by the Font and Colors preferences page to show the user what the selected theme looks like before the change is committed.

The widget never reads from the live ThemeManager except as a fallback. Callers push a token → color hash via setPreviewColors() whenever the selection changes; missing entries fall back to the live ThemeManager value so the widget always paints something.

Member Function Documentation

◆ setPreviewColors()

void ThemePreviewWidget::setPreviewColors ( const QHash< ThemeManager::ThemeToken, QColor > &  colors)

Replaces the preview's color table. Triggers a repaint.

Parameters
colorstoken → resolved QColor map, typically obtained from ThemeManager::previewTheme(). Passing an empty hash is valid — every lookup will fall back to the live ThemeManager.

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