61 friend class HoverButtonIconWatch;
76 Button(QWidget* parent =
nullptr);
77 Button(ButtonState state, QWidget* parent =
nullptr);
79 Button(
const std::function<
void(
Button*)>& on_click, QWidget* parent =
nullptr);
84 void paintEvent(QPaintEvent *event)
override;
85 void setAlignment(Qt::Alignment m_alignment);
92 int styleDefaultIconSize()
const;
93 int scaledIconSize()
const;
95 void setToolTip(
const QString& tip);
96 void setButtonState(ButtonState state);
97 void showPopupMenu(QWidget* widget,
bool is_popup =
true);
98 bool requestButtonState(ButtonState state);
99 void requestFixedState(
bool fixed_state);
105 void leaveEvent(QEvent* e)
override;
106 void setMargin(
uint04 margin);
107 void setIconSize(
int size);
108 void setProgressPercent(
fltp04 progress);
109 bool event(QEvent* e)
override;
110 void setIconSizeMultiplier(
fltp04 icon_size_multiplier);
111 void setHoverIconSizeMultiplier(
fltp04 icon_size_multiplier);
113 void setText(
const QString &text);
115 const String& iconName()
const;
116 void setIconName(
const String& icon);
117 void setIcon(
const QIcon& icon);
118 void setHoverIconName(
const String& icon);
119 void setCheckedIconName(
const String& icon);
120 bool eventFilter(QObject* watched, QEvent* event)
override;
124 void setFlat(
bool is_flat);
126 void setSound(
const String& sound);
128 void copyButtonFrom(
Button* button);
129 void setBackgroundOpacity(
fltp04 background_opacity);
130 void setMenuDialog(QWidget* widget);
131 void setIconColor(
const RGBColor& color);
132 void setBackgroundColor(
const RGBColor& color,
bool update_foreground =
true);
133 void clearBackgroundColor();
134 void setFocusOnPress(
bool focus_on_press);
135 void setAutoDefault(
bool is_auto_default);
136 void setDefault(
bool is_default);
137 void setCheckable(
bool checkable);
138 void setChecked(
bool checked);
139 QSize sizeHint()
const override;
140 QSize minimumSizeHint()
const override;
141 void virtualMouseEvent(QEvent::Type event);
142 void setFontMultiplier(
fltp04 font_multiplier);
143 void setBold(
bool is_bold);
144 void setMenu(QMenu* menu);
145 void setClickCooldown(
const TimeSpan& span);
148 void onButtonClickSlot();
149 void onButtonPressSlot();
150 void onButtonReleaseSlot();
152 QString autoWrapText(
const QFontMetrics& metrics);
153 void updateTooltip();
155 void mouseReleaseEvent(QMouseEvent*)
override;
156 void mousePressEvent(QMouseEvent*)
override;
157 bool ignorePress()
const;
159 void _setIcon(
const String & icon,
bool force =
false);
161 void _defaultRender(QStylePainter* p, QStyleOptionToolButton* tool_button, QIcon::State state, QIcon::Mode mode,
bool draw_backgound,
bool is_default);
163 std::function<void(
Button*)> m_on_click =
nullptr;
164 std::function<void(
Button*,
bool hovering)> m_on_hover =
nullptr;
165 std::function<void(
Button*,
bool pressing)> m_on_press =
nullptr;
168 QPointer<QWidget> m_menu_dialog =
nullptr;
185 bool m_ignore_clicks =
false;
186 bool m_fixed_state_requested =
false;
187 bool m_has_custom_background_color =
false;
188 bool m_focus_on_press =
true;
192 QPushButton* m_push_button =
nullptr;
193 bool m_is_default_button =
false;
194 bool m_is_auto_default_button =
false;
196 bool m_is_bold =
false;
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120