62 #ifndef STAGE_MODEL_EXPANDER_REVEALER_H 63 #define STAGE_MODEL_EXPANDER_REVEALER_H 88 using ProbeFun = std::function<bool(void)>;
89 using ChangeFun = std::function<void(bool)>;
93 ChangeFun changeState_;
97 Expander(ProbeFun detectCurrExpansionState, ChangeFun expand_collapse)
98 : probeState_{move (detectCurrExpansionState)}
99 , changeState_{move (expand_collapse)}
101 ENSURE (canExpand());
107 return bool{probeState_}
108 and
bool{changeState_};
112 operator bool()
const 114 REQUIRE (canExpand());
115 return probeState_();
119 operator() (
bool shallExpand)
121 REQUIRE (canExpand());
122 bool currState = probeState_();
123 if (currState != shallExpand)
124 changeState_(shallExpand);
130 expand (
bool yes =
true)
132 return this->operator() (yes);
138 return expand (
false);
159 using RevealeItFun = std::function<void()>;
162 RevealeItFun revealIt_;
166 Revealer(RevealeItFun how_to_uncover_the_element)
167 : revealIt_{move (how_to_uncover_the_element)}
169 ENSURE (canReveal());
175 return bool{revealIt_};
181 REQUIRE (canReveal());
Functor component to support the default implementation of revealing an UI-Element.
Lumiera GTK UI implementation root.
Lumiera error handling (C++ interface).
Functor component to support the default implementation of expanding/collapsing.