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

#include <theme_lua_code_preview.h>

Inheritance diagram for ThemeLuaCodePreview:

Signals

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

Public Member Functions

 ThemeLuaCodePreview (QWidget *parent=nullptr)
void setPreviewColors (const QHash< ThemeManager::ThemeToken, QColor > &colors)
void setPreviewFont (const QFont &monospace)
ThemePreviewPicker & picker ()

Protected Member Functions

void paintEvent (QPaintEvent *event) override
void contextMenuEvent (QContextMenuEvent *event) override
void mouseMoveEvent (QMouseEvent *event) override
void mousePressEvent (QMouseEvent *event) override
QSize minimumSizeHint () const override

Detailed Description

Static copy of the Lua Debugger script editor for the Theme Designer.

Shows the udprtt.lua example of the Lua debugger chapter of the Developer's Guide, highlighted by the debugger's own LuaSyntaxHighlighter, with a breakpoint, the line the debugger is paused on and a selection, so every color of the theme's code section is on screen. Colors come only from setPreviewColors(), so a draft can be shown without touching the application. Built only with Lua, like the debugger.

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 ThemeLuaCodePreview::childDialogClosed ( )
signal

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

◆ layerPicked

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

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

◆ picker()

ThemePreviewPicker & ThemeLuaCodePreview::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 ThemeLuaCodePreview::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.

◆ setPreviewColors()

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

Replaces the preview's color table and repaints.

Parameters
colorstoken to resolved color, typically one side of ThemeManager::resolveDraftTokens(). When the map is empty, the live theme is shown.

◆ setPreviewFont()

void ThemeLuaCodePreview::setPreviewFont ( const QFont & monospace)

Sets the monospace font of the code and the gutter; an unchanged font is ignored.


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