8#include "text_widget.hpp"
9#include "icon_widget.hpp"
11#include "../label.hpp"
77 template<
typename Label,
typename Alignment = tt::alignment,
typename TextStyle = tt::theme_text_style>
82 Alignment &&
alignment = alignment::middle_right,
83 TextStyle &&
text_style = theme_text_style::label) noexcept :
86 this->label = std::forward<Label>(
label);
87 this->alignment = std::forward<Alignment>(
alignment);
88 this->text_style = std::forward<TextStyle>(
text_style);
92 void init() noexcept override;
93 [[nodiscard]]
bool constrain(utc_nanoseconds display_time_point,
bool need_reconstrain) noexcept override;
94 [[nodiscard]]
void layout(utc_nanoseconds displayTimePoint,
bool need_layout) noexcept override;
100 decltype(
label)::callback_ptr_type _label_callback;
alignment
Vertical and horizontal alignment.
Definition alignment.hpp:47
Definition gui_window.hpp:39
A label consisting of localizable text and an icon.
Definition label.hpp:27
A value which can be observed for modifications.
Definition observable.hpp:464
Definition text_style.hpp:17
An simple GUI widget that displays an icon.
Definition icon_widget.hpp:26
The GUI widget displays and lays out text together with an icon.
Definition label_widget.hpp:32
label_widget(gui_window &window, widget *parent, Label &&label, Alignment &&alignment=alignment::middle_right, TextStyle &&text_style=theme_text_style::label) noexcept
Construct a label widget.
Definition label_widget.hpp:78
observable< label > label
The label to display.
Definition label_widget.hpp:38
A text widget.
Definition text_widget.hpp:25
An interactive graphical object as part of the user-interface.
Definition widget.hpp:37
widget *const parent
Pointer to the parent widget.
Definition widget.hpp:46
gui_window & window
Convenient reference to the Window.
Definition widget.hpp:41
widget(gui_window &window, widget *parent) noexcept