Lumiera
0.pre.03
»edit your freedom«
|
#include "stage/widget/element-box-widget.hpp"
A basic building block of the Lumiera UI.
Representation of an entity, with a marker icon, a menu, descriptive label and possibly a content renderer (e.g. for a video clip). Depending on the presentation intent, the widget can be set to a fixed horizontal extension, to allow presentation on a time calibrated canvas. Pre-defined styling and bindings to expand the display and to invoke a menu are provided.
Definition at line 143 of file element-box-widget.hpp.
Public Member Functions | |
template<class... QS> | |
ElementBoxWidget (Kind kind, Type type, QS ...qualifiers) | |
setup an ElementBoxWidget with suitable presentation style. More... | |
ElementBoxWidget (Config) | |
cuString | get_label () const |
cuString | getName () const |
void | set_label (cuString &s) |
redirect Gtk::Frame setters to ElementBoxWidget | |
void | setName (cuString &) |
Classes | |
class | Config |
struct | Strategy |
Private Types | |
using | _Base = Gtk::EventBox |
Private Member Functions | |
void | get_preferred_height_for_width_vfunc (int, int &, int &) const override |
void | get_preferred_height_vfunc (int &, int &) const override |
void | get_preferred_width_vfunc (int &, int &) const override |
Layout preferences are delegated through the Strategy. More... | |
Gtk::SizeRequestMode | get_request_mode_vfunc () const final |
Layout trend for ElementBoxWidget is nailed down (final ) to "height-for-width". More... | |
void | imposeSizeConstraint (int, int) |
Ensure the child widgets can be represented and possibly adjust or hide content, in case the extension of ElementBoxWidget is explicitly constrained in size. More... | |
void | on_size_allocate (Gtk::Allocation &) override |
Tap into the notification of screen space allocation to possibly enforce size constraints. More... | |
Private Attributes | |
Gtk::Frame | frame_ |
IDLabel | label_ |
Strategy | strategy_ |
actual layout strategy binding for this widget | |
|
inline |
setup an ElementBoxWidget with suitable presentation style.
widgetKind | the basic presentation intent |
type | qualify the type of data represented by this object |
qualifiers | pass further qualifiers to fine-tune the presentation |
Definition at line 302 of file element-box-widget.hpp.
Referenced by MarkerWidget::MarkerWidget().
|
finalprivate |
Layout trend for ElementBoxWidget is nailed down (final
) to "height-for-width".
The reason is, some of the use cases entail placing the element box onto a canvas with horizontal extension calibrated to time units; doing so requires us to control the extension, which is delegated through the strategy
Definition at line 241 of file element-box-widget.cpp.
|
overrideprivate |
Layout preferences are delegated through the Strategy.
Gtk::Layout
), where the calculation takes minimum_width as starting point. The returned values will always be respected, while the GTK layout engine might increase the given extensions...adjust_size_allocation
on the GTK-class, which typically delegates to gtk_widget_real_adjust_size_allocation, and the latter invokessize_allocate
VFunc, which passes through the Gtk::Widget::on_size_allocate()
and after that by default stores this allocation into the widget's private data. Definition at line 269 of file element-box-widget.cpp.
|
overrideprivate |
Definition at line 282 of file element-box-widget.cpp.
|
overrideprivate |
Tap into the notification of screen space allocation to possibly enforce size constraints.
Generally speaking, explicit size constrained widgets are not a concept supported by GTK, due to its flexible layout model and the use of CSS for styling and theming. Unfortunately we need this feature, in order to implement Clip widgets on a time calibrated canvas. Thus we use an implementation trick: we report our size constraints as "natural size" to GTK, knowing that GTK will respect those extensions (unless the widget is placed into a container with fill-alignment). However, by doing so, we have effectively lied to GTK with respect to our child widgets. Thus we now have to take on the responsibility to somehow make those child widgets fit into the limited size allocation....
Definition at line 311 of file element-box-widget.cpp.
|
private |
Ensure the child widgets can be represented and possibly adjust or hide content, in case the extension of ElementBoxWidget is explicitly constrained in size.
visible
it will respond properly to queries regarding the required extension Definition at line 328 of file element-box-widget.cpp.