diff options
author | Sebastian Geerken <devnull@localhost> | 2014-05-30 15:08:16 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-05-30 15:08:16 +0200 |
commit | 1a3983870885abaf0cb73cc72e46a43f7f289a10 (patch) | |
tree | fb61296259f5e0a8d5e60f7b3c38420b9e57ce49 | |
parent | dbb857df40f41a11a46622c2c561400bd029994c (diff) |
Added Widget::extraSpace (not used yet).
-rw-r--r-- | dw/style.hh | 16 | ||||
-rw-r--r-- | dw/widget.cc | 2 | ||||
-rw-r--r-- | dw/widget.hh | 17 |
3 files changed, 23 insertions, 12 deletions
diff --git a/dw/style.hh b/dw/style.hh index 2cc258bf..da214ca1 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -564,22 +564,14 @@ public: = borderStyle.left = val; } inline int boxOffsetX () - { - return margin.left + borderWidth.left + padding.left; - } + { return margin.left + borderWidth.left + padding.left; } inline int boxRestWidth () - { - return margin.right + borderWidth.right + padding.right; - } + { return margin.right + borderWidth.right + padding.right; } inline int boxDiffWidth () { return boxOffsetX () + boxRestWidth (); } inline int boxOffsetY () - { - return margin.top + borderWidth.top + padding.top; - } + { return margin.top + borderWidth.top + padding.top; } inline int boxRestHeight () - { - return margin.bottom + borderWidth.bottom + padding.bottom; - } + { return margin.bottom + borderWidth.bottom + padding.bottom; } inline int boxDiffHeight () { return boxOffsetY () + boxRestHeight (); } inline bool hasBackground () diff --git a/dw/widget.cc b/dw/widget.cc index 79b94120..0f656463 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -81,6 +81,8 @@ Widget::Widget () allocation.ascent = 1; allocation.descent = 0; + extraSpace.top = extraSpace.right = extraSpace.bottom = extraSpace.left = 0; + style = NULL; bgColor = NULL; buttonSensitive = true; diff --git a/dw/widget.hh b/dw/widget.hh index 5abbf89a..3d8cdbd6 100644 --- a/dw/widget.hh +++ b/dw/widget.hh @@ -193,6 +193,12 @@ protected: Layout *layout; + /** + * \brief Space around the margin box. Allocation is extraSpace + + * margin + border + padding + contents; + */ + style::Box extraSpace; + /*inline void printFlags () { DBG_IF_RTFL { char buf[10 * 3 - 1 + 1]; @@ -404,6 +410,17 @@ public: /** \todo I do not like this. */ inline Allocation *getAllocation () { return &allocation; } + inline int boxOffsetX () + { return extraSpace.left + getStyle()->boxOffsetX (); } + inline int boxRestWidth () + { return extraSpace.right + getStyle()->boxRestWidth (); } + inline int boxDiffWidth () { return boxOffsetX () + boxRestWidth (); } + inline int boxOffsetY () + { return extraSpace.top + getStyle()->boxOffsetY (); } + inline int boxRestHeight () + { return extraSpace.bottom + getStyle()->boxRestHeight (); } + inline int boxDiffHeight () { return boxOffsetY () + boxRestHeight (); } + void sizeRequest (Requisition *requisition); void getExtremes (Extremes *extremes); void sizeAllocate (Allocation *allocation); |