Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
learn_card_widget.h
Go to the documentation of this file.
1
9
10#ifndef LEARN_CARD_WIDGET_H
11#define LEARN_CARD_WIDGET_H
12
13#include <QWidget>
14#include <QFrame>
15#include <QColor>
16
17class QPushButton;
18
19namespace Ui {
20class LearnCardWidget;
21}
22
26class LearnCardWidget : public QFrame
27{
28 Q_OBJECT
29
30public:
35 explicit LearnCardWidget(QWidget *parent = nullptr);
36
39
45 void setLinksCollapsed(bool collapsed);
46
51 bool isLinksCollapsed() const;
52
63 void setStyledByParent(bool styled_by_parent);
64
72 void setCardLinkColor(const QColor &color);
73
74protected:
82 bool event(QEvent *event) override;
83
84private:
88 enum ValidityType {
89 AllVersions,
90 ReleaseOnly,
91 DevOnly
92 };
93
97 struct LinkType {
98 QString url;
99 QString label;
100 QString short_label;
101 QString tooltip;
102 ValidityType validity;
103 };
104
108 struct ButtonType {
109 QString url;
110 QString label;
111 QString tooltip;
114 QString color;
115 ValidityType validity;
116 };
117
118 Ui::LearnCardWidget *ui_;
119 QList<LinkType> links_;
121 QList<ButtonType> buttons_;
122 bool links_collapsed_;
123 bool styled_by_parent_ = false;
124 QColor card_link_color_;
125
129 void loadLinksFromRessource();
130
134 void setupLinks();
135
139 void setupActionButtons();
140
146 void applyTheme();
147
152 void applyCardLinkPalette();
153
160 static QColor resolveButtonColor(const QString &spec);
161
163 void applyStyleSheet();
164};
165
166#endif //LEARN_CARD_WIDGET_H
void setCardLinkColor(const QColor &color)
Set the link color of the card (normally CardLink of the live theme). A card styled by its parent kee...
Definition learn_card_widget.cpp:188
~LearnCardWidget()
Destroy the widget and its UI form.
Definition learn_card_widget.cpp:56
void setStyledByParent(bool styled_by_parent)
Leave the card's styling to an ancestor's style sheet.
Definition learn_card_widget.cpp:283
bool isLinksCollapsed() const
Return whether the links section is currently collapsed.
Definition learn_card_widget.cpp:278
bool event(QEvent *event) override
Handle widget events, including palette and style changes.
Definition learn_card_widget.cpp:294
void setLinksCollapsed(bool collapsed)
Collapse or expand the links section.
Definition learn_card_widget.cpp:262
LearnCardWidget(QWidget *parent=nullptr)
Construct a LearnCardWidget.
Definition learn_card_widget.cpp:32