12#include "../macros.hpp"
15hi_export_module(hikogui.widgets.toolbar_button_widget);
17hi_export
namespace hi {
inline namespace v1 {
28 template<button_widget_attribute...
Attributes>
39 template<button_widget_attribute...
Attributes>
45 [[
nodiscard]] std::stop_token get_stop_token()
const noexcept
47 return _stop_source.get_token();
50 template<
typename Awaiter>
53 co_await std::forward<Awaiter>(
awaiter);
54 set_value(widget_value::off);
60 _label_constraints = super::update_constraints();
63 auto const extra_size =
extent2{theme().margin<
float>() * 2.0f, theme().margin<
float>() * 2.0f};
65 auto constraints = _label_constraints +
extra_size;
66 constraints.margins = 0;
74 _on_label_shape = _off_label_shape = _other_label_shape =
86 [[
nodiscard]]
bool accepts_keyboard_focus(keyboard_focus_group group)
const noexcept override
93 std::stop_source _stop_source;
97 auto const border_color = focus() ? focus_color() : color::transparent();
Defines abstract_button_widget.
@ rectangle
The gui_event has rectangle data.
@ partial
A widget is partially enabled.
@ invisible
The widget is invisible.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
@ inside
The border is drawn inside the edge of a quad.
bool compare_store(T &lhs, U &&rhs) noexcept
Compare then store if there was a change.
Definition misc.hpp:53
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:33
Horizontal/Vertical alignment combination.
Definition alignment.hpp:244
A high-level geometric extent.
Definition extent2.hpp:32
Draw context for drawing using the HikoGUI shaders.
Definition draw_context_intf.hpp:209
widget_layout const & layout() const noexcept
Get the current layout for this widget.
Definition widget_intf.hpp:206
widget_intf * parent
Pointer to the parent widget.
Definition widget_intf.hpp:35
The layout of a widget.
Definition widget_layout.hpp:56
2D constraints.
Definition box_constraints.hpp:25
Definition box_shape.hpp:18
Definition not_null.hpp:22
Base class for implementing button widgets.
Definition abstract_button_widget.hpp:36
std::shared_ptr< delegate_type > delegate
The delegate that controls the button widget.
Definition abstract_button_widget.hpp:43
A button delegate controls the state of a button widget.
Definition button_delegate.hpp:28
A momentary button used as a child in the toolbar.
Definition toolbar_button_widget.hpp:23
An interactive graphical object as part of the user-interface.
Definition widget.hpp:37