| Wireshark 4.7.3 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
46 class AdaptiveToolButton : public QToolButton
47{
48 Q_OBJECT
49
50 public:
51 explicit AdaptiveToolButton(QWidget *parent = nullptr);
52
62 void setBaseIconSize(const QSize &size);
63
65 QSize baseIconSize() const { return base_icon_size_; }
66
74 void setIconPadding(int padding);
75
77 int iconPadding() const { return icon_padding_; }
78
80 QSize sizeHint() const override;
81
83 QSize minimumSizeHint() const override;
84
85 private:
87 void applyZoom();
88
89 QSize base_icon_size_;
90 int icon_padding_;
91};
92
93#endif // ADAPTIVE_TOOL_BUTTON_H
AdaptiveToolButton::minimumSizeHint
QSize minimumSizeHint() const override
Same as sizeHint(): the button never shrinks below its glyph.
Definition adaptive_tool_button.cpp:78
AdaptiveToolButton::sizeHint
QSize sizeHint() const override
Icon footprint plus padding; tight, ignoring style margins.
Definition adaptive_tool_button.cpp:69
AdaptiveToolButton::setBaseIconSize
void setBaseIconSize(const QSize &size)
Sets the logical icon size at zoom 1.0.
Definition adaptive_tool_button.cpp:53
AdaptiveToolButton::iconPadding
int iconPadding() const
The symmetric padding (px) around the icon.
Definition adaptive_tool_button.h:77
AdaptiveToolButton::baseIconSize
QSize baseIconSize() const
The logical icon size at zoom 1.0.
Definition adaptive_tool_button.h:65
AdaptiveToolButton::setIconPadding
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:61