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

#include <native_title_bar.h>

Inheritance diagram for NativeTitleBar:

Classes

struct  Style

Public Member Functions

 NativeTitleBar (QObject *parent=nullptr)
void applyToAll ()

Static Public Member Functions

static Style previewStyle (bool declaresWindow, const QColor &window, const QColor &windowText)

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override

Detailed Description

Paints the native title bar of top-level windows in the theme's window color.

Owned by ThemeManager, which creates it before any window exists. A theme that declares palette.window gets title bars in that color with readable title text; any other theme keeps the platform title bar. The style is applied when a window is shown and re-applied to every open window on ThemeManager::themeChanged.

Qt has no API for the title bar color, so the native call lives in one backend per platform: ui/qt/utils/themes/native_title_bar_mac.mm (macOS, AppKit) ui/qt/utils/themes/native_title_bar_win.cpp (Windows 11, DWM) ui/qt/utils/themes/native_title_bar_stub.cpp (all others; the window manager draws the title bar)

CMake selects exactly one of those for the build.

previewStyle() gives a preview of a theme that is not applied yet (ThemePreviewWidget) the same colors the real windows get. It shows the tint on every platform, also where the real title bar stays native.

Constructor & Destructor Documentation

◆ NativeTitleBar()

NativeTitleBar::NativeTitleBar ( QObject * parent = nullptr)
explicit

Installs the application event filter.

Member Function Documentation

◆ applyToAll()

void NativeTitleBar::applyToAll ( )

Applies the current style to every open window with a title bar.

◆ previewStyle()

NativeTitleBar::Style NativeTitleBar::previewStyle ( bool declaresWindow,
const QColor & window,
const QColor & windowText )
static

The title bar a theme preview draws for a theme that is not applied yet. Tinted when the theme declares palette.window (declaresWindow) and window is valid, on every platform: the preview shows what the theme asks for, even where the platform keeps its own title bar (Linux, Windows 10). Colors are derived exactly as for the real windows: background window, text windowText made readable against it. An invalid background means the native look. appDark is left false.


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