Lumiera  0.pre.03
»edit your freedom«
stage::widget::anonymous_namespace{element-box-widget.cpp} Namespace Reference

Functions

void initIconSizeHeuristic (Gtk::Widget const &icon)
 
template<class FUN >
bool maybeShow (Gtk::Button &icon, int w, int h, FUN &reCheck)
 attempt to use available space to show more content More...
 
template<class FUN >
bool maybeShow (Gtk::Label &label, int w, int h, FUN &reCheck)
 
int queryNaturalHeight (Gtk::Widget const &widget)
 
void queryNaturalSize (Gtk::Widget const &widget, Gtk::Requisition &natSize)
 Helper to retrieve what GTK effectively uses as minimal extension of a widget. More...
 
int queryNaturalWidth (Gtk::Widget const &widget)
 
int reduce (Gtk::Button &icon)
 attempt to reduce space consumption More...
 
int reduce (Gtk::Label &label, int goal)
 

Variables

const double HYSTERESIS = 1.6
 excess factor used to prevent "layout flickering" More...
 
Gtk::Requisition ICON_SIZ {}
 point of reference for layout computations
 

Function Documentation

◆ queryNaturalSize()

void stage::widget::anonymous_namespace{element-box-widget.cpp}::queryNaturalSize ( Gtk::Widget const &  widget,
Gtk::Requisition &  natSize 
)
inline

Helper to retrieve what GTK effectively uses as minimal extension of a widget.

Remarks
in fact this is the so called "preferred natural size", since GTK always allocates at least this amount of screen extension. Judging from the GTK 3.24 code (as of 9/2022), the minimal size setting and the "size_request" are in most cases just used for consistency checks, while the natural size is determined in accordance to the layout preference (height-for-width or width-for-hight) and then only ever increased to fit further CSS settings (border, margin) and to handle fill-layout.
Warning
however note that Gtk::Layout (which we use as foundation for our Timeline canvas) indeed starts its calculation from the minimal width of the attached child widget. Thus, as far as implementing the VFuncs, both cases should be treated symmetrically.

Definition at line 79 of file element-box-widget.cpp.

◆ reduce() [1/2]

int stage::widget::anonymous_namespace{element-box-widget.cpp}::reduce ( Gtk::Button &  icon)
inline

attempt to reduce space consumption

Returns
achieved width reduction in pixels

Definition at line 356 of file element-box-widget.cpp.

Referenced by IterExplorer< SRC >::count(), TestChainLoad< maxFan >::getHash(), IterExplorer< SRC >::resultSum(), and IterExplorer_test::verify_reduceVal().

+ Here is the caller graph for this function:

◆ reduce() [2/2]

int stage::widget::anonymous_namespace{element-box-widget.cpp}::reduce ( Gtk::Label &  label,
int  goal 
)
inline
Todo:
10/22 also attempt to shorten the label... ///////////////////TICKET #1242 : adjust size of the ID caption

Definition at line 369 of file element-box-widget.cpp.

◆ maybeShow()

bool stage::widget::anonymous_namespace{element-box-widget.cpp}::maybeShow ( Gtk::Button &  icon,
int  w,
int  h,
FUN &  reCheck 
)
inline

attempt to use available space to show more content

Parameters
iconwidget to possibly expand
wadditional width available
hvertical headroom available
reCheckfunction to update and verify success
Returns
if hidden content could successfully be expanded

Definition at line 397 of file element-box-widget.cpp.

Variable Documentation

◆ HYSTERESIS

const double HYSTERESIS = 1.6

excess factor used to prevent "layout flickering"

Remarks
once hidden, an element will only be re-shown when some excess headroom is available

Definition at line 107 of file element-box-widget.cpp.