aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-05-30 15:08:16 +0200
committerSebastian Geerken <devnull@localhost>2014-05-30 15:08:16 +0200
commit1a3983870885abaf0cb73cc72e46a43f7f289a10 (patch)
treefb61296259f5e0a8d5e60f7b3c38420b9e57ce49
parentdbb857df40f41a11a46622c2c561400bd029994c (diff)
Added Widget::extraSpace (not used yet).
-rw-r--r--dw/style.hh16
-rw-r--r--dw/widget.cc2
-rw-r--r--dw/widget.hh17
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);