diff options
author | Sebastian Geerken <devnull@localhost> | 2014-07-18 14:52:26 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-07-18 14:52:26 +0200 |
commit | 441370fa67c40a47916b7a44d4fa1d18feadb6dd (patch) | |
tree | 9da8d942ce8441d9fa114601b292abce2a4220d6 /dw | |
parent | f5aae2463edf320c69053959e53ec6ea3ef87935 (diff) |
Handling nested layouts (e. g. <button>), part 3 (finish).
Diffstat (limited to 'dw')
-rw-r--r-- | dw/layout.hh | 4 | ||||
-rw-r--r-- | dw/ui.cc | 12 | ||||
-rw-r--r-- | dw/ui.hh | 4 |
3 files changed, 17 insertions, 3 deletions
diff --git a/dw/layout.hh b/dw/layout.hh index d83aeedb..88532187 100644 --- a/dw/layout.hh +++ b/dw/layout.hh @@ -269,8 +269,6 @@ private: void enterResizeIdle () { resizeIdleCounter++; } void leaveResizeIdle () { resizeIdleCounter--; } - void containerSizeChanged (); - public: Layout (Platform *platform); ~Layout (); @@ -332,6 +330,8 @@ public: return buttonEvent (BUTTON_PRESS, view, numPressed, x, y, state, button); } + void containerSizeChanged (); + /** * \brief This function is called by a view, to delegate a button press * event. @@ -89,7 +89,7 @@ void Embed::correctExtremesOfChild (Widget *child, Extremes *extremes) void Embed::containerSizeChangedForChildren () { DBG_OBJ_ENTER0 ("resize", 0, "containerSizeChangedForChildren"); - // Nothing to do (as long as all resources return empty iterators). + resource->containerSizeChangedForChildren (); DBG_OBJ_LEAVE (); } @@ -251,6 +251,11 @@ void Resource::correctExtremesOfChild (Widget *child, Extremes *extremes) misc::assertNotReached (); } +void Resource::containerSizeChangedForChildren () +{ + // No children by default. +} + void Resource::setDisplayed (bool displayed) { } @@ -447,6 +452,11 @@ void ComplexButtonResource::correctExtremesOfChild (Widget *child, getEmbed()->correctExtremesOfChildNoRec (child, extremes); } +void ComplexButtonResource::containerSizeChangedForChildren () +{ + layout->containerSizeChanged (); +} + Iterator *ComplexButtonResource::iterator (Content::Type mask, bool atEnd) { /** @@ -363,6 +363,7 @@ public: void (*splitHeightFun) (int, int*, int*)); virtual void correctExtremesOfChild (Widget *child, Extremes *extremes); + virtual void containerSizeChangedForChildren (); virtual void setDisplayed (bool displayed); virtual void draw (View *view, Rectangle *area); @@ -431,12 +432,15 @@ public: void sizeRequest (Requisition *requisition); void getExtremes (Extremes *extremes); void sizeAllocate (Allocation *allocation); + int getAvailWidthOfChild (Widget *child, bool forceValue); int getAvailHeightOfChild (Widget *child, bool forceValue); void correctRequisitionOfChild (Widget *child, Requisition *requisition, void (*splitHeightFun) (int, int*, int*)); void correctExtremesOfChild (Widget *child, Extremes *extremes); + void containerSizeChangedForChildren (); + Iterator *iterator (Content::Type mask, bool atEnd); int getClickX () {return click_x;}; int getClickY () {return click_y;}; |