|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
#include <theme_preview_widget.h>
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 |
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.
| void ThemePreviewWidget::setPreviewColors | ( | const QHash< ThemeManager::ThemeToken, QColor > & | colors | ) |
Replaces the preview's color table. Triggers a repaint.
| colors | token → resolved QColor map, typically obtained from ThemeManager::previewTheme(). Passing an empty hash is valid — every lookup will fall back to the live ThemeManager. |