Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
adaptive_tool_button.h
Go to the documentation of this file.
1
9
10#ifndef ADAPTIVE_TOOL_BUTTON_H
11#define ADAPTIVE_TOOL_BUTTON_H
12
13#include <QToolButton>
14#include <QSize>
15
48class AdaptiveToolButton : public QToolButton
49{
50 Q_OBJECT
51
52public:
53 explicit AdaptiveToolButton(QWidget *parent = nullptr);
54
66 void setBaseIconSize(const QSize &size);
67
72 QSize baseIconSize() const { return base_icon_size_; }
73
81 void setIconPadding(int padding);
82
84 int iconPadding() const { return icon_padding_; }
85
87 QSize sizeHint() const override;
88
90 QSize minimumSizeHint() const override;
91
92private:
94 void applyZoom();
95
96 QSize base_icon_size_;
98 int icon_padding_;
99};
100
101#endif // ADAPTIVE_TOOL_BUTTON_H
QSize minimumSizeHint() const override
Same as sizeHint(): the button never shrinks below its glyph.
Definition adaptive_tool_button.cpp:75
QSize sizeHint() const override
Icon footprint plus padding; tight, ignoring style margins.
Definition adaptive_tool_button.cpp:66
void setBaseIconSize(const QSize &size)
Sets the logical icon size at Normal Size (zoom level 0).
Definition adaptive_tool_button.cpp:50
int iconPadding() const
The symmetric padding (px) around the icon.
Definition adaptive_tool_button.h:84
QSize baseIconSize() const
The logical icon size at Normal Size set by setBaseIconSize(), or an invalid QSize when the button fo...
Definition adaptive_tool_button.h:72
void setIconPadding(int padding)
Sets the symmetric padding (px) added around the icon in the size hint. Not zoom-scaled,...
Definition adaptive_tool_button.cpp:58