summaryrefslogtreecommitdiff
path: root/kde/window-decorator
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2007-01-04 02:30:12 +0100
committerDavid Reveman <davidr@novell.com>2007-01-04 02:30:12 +0100
commit603ebd2802caf91efb39f56ac365e53f1f372268 (patch)
tree8e537de858d86a9043cb946f944ca7026e292dde /kde/window-decorator
parent222479e88bf249086f9abdabb92a00f7c1873e7b (diff)
Try to place titlebar stretch offset as far as possible to the left
but not where any button is located.
Diffstat (limited to 'kde/window-decorator')
-rw-r--r--kde/window-decorator/window.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/kde/window-decorator/window.cpp b/kde/window-decorator/window.cpp
index 9729683d..e7e4ae4b 100644
--- a/kde/window-decorator/window.cpp
+++ b/kde/window-decorator/window.cpp
@@ -1260,12 +1260,37 @@ KWD::Window::updateProperty (void)
if (mType == Normal || mType == Switcher)
{
+ int topXOffset = w / 2;
+
+ if (mDecor)
+ {
+ const QObjectList *children = mDecor->widget ()->children ();
+ QWidget *child;
+ int x;
+
+ x = w - mContext.left_space - mContext.left_corner_space;
+ if (x > topXOffset)
+ topXOffset = x;
+
+ for (QObjectListIt it(*children); it.current (); ++it)
+ {
+ if (!it.current ()->isWidgetType ())
+ continue;
+
+ child = static_cast <QWidget *> (it.current ());
+
+ x = child->x () - mBorder.left - 2;
+ if (x > w / 2 && x < topXOffset)
+ topXOffset = x;
+ }
+ }
+
nQuad = decor_set_lXrXtXbX_window_quads (quads,
&mContext,
&mLayout,
lh / 2,
rh / 2,
- w / 2,
+ topXOffset,
w / 2);
minWidth = mContext.left_corner_space + 1 + mContext.right_corner_space;