53 #ifndef STAGE_MODEL_EXPANDER_REVEALER_H 54 #define STAGE_MODEL_EXPANDER_REVEALER_H 79 using ProbeFun = std::function<bool(void)>;
80 using ChangeFun = std::function<void(bool)>;
84 ChangeFun changeState_;
88 Expander(ProbeFun detectCurrExpansionState, ChangeFun expand_collapse)
89 : probeState_{move (detectCurrExpansionState)}
90 , changeState_{move (expand_collapse)}
98 return bool{probeState_}
99 and
bool{changeState_};
103 operator bool()
const 105 REQUIRE (canExpand());
106 return probeState_();
110 operator() (
bool shallExpand)
112 REQUIRE (canExpand());
113 bool currState = probeState_();
114 if (currState != shallExpand)
115 changeState_(shallExpand);
121 expand (
bool yes =
true)
123 return this->operator() (yes);
129 return expand (
false);
150 using RevealeItFun = std::function<void()>;
153 RevealeItFun revealIt_;
157 Revealer(RevealeItFun how_to_uncover_the_element)
158 : revealIt_{move (how_to_uncover_the_element)}
160 ENSURE (canReveal());
166 return bool{revealIt_};
172 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.