Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
native_title_bar.h
Go to the documentation of this file.
1
9
10#ifndef NATIVE_TITLE_BAR_H
11#define NATIVE_TITLE_BAR_H
12
13#include <QColor>
14#include <QObject>
15
16class QEvent;
17class QWidget;
18
42class NativeTitleBar : public QObject
43{
44 Q_OBJECT
45public:
47 struct Style {
48 QColor background;
49 QColor text;
50 bool darkBackground = false;
51 bool appDark = false;
52 };
53
55 explicit NativeTitleBar(QObject *parent = nullptr);
56
58 void applyToAll();
59
70 static Style previewStyle(bool declaresWindow, const QColor &window, const QColor &windowText);
71
72protected:
73 bool eventFilter(QObject *watched, QEvent *event) override;
74
75private:
76 static Style currentStyle();
77
84 static Style styleFor(bool tinted, const QColor &window, const QColor &windowText);
85
92 static bool isSupported();
93 static bool hasTitleBar(const QWidget *widget);
94 static void applyTo(QWidget *window, const Style &style);
95 static bool applyAndMark(QWidget *window, const Style &style);
96
103 static bool applyNative(QWidget *window, const Style &style);
104};
105
106#endif /* NATIVE_TITLE_BAR_H */
NativeTitleBar(QObject *parent=nullptr)
Definition native_title_bar_common.cpp:33
void applyToAll()
Definition native_title_bar_common.cpp:39
static Style previewStyle(bool declaresWindow, const QColor &window, const QColor &windowText)
Definition native_title_bar_common.cpp:90
Definition native_title_bar.h:47
QColor background
Title bar fill, or invalid for the native look.
Definition native_title_bar.h:48
QColor text
Title text, readable on background.
Definition native_title_bar.h:49
bool darkBackground
background is dark (light title text and buttons)
Definition native_title_bar.h:50
bool appDark
Light/dark mode of the application.
Definition native_title_bar.h:51