[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    the docker race condition
From:       Casper Boemann <cbr () boemann ! dk>
Date:       2006-10-30 22:14:43
Message-ID: 200610302314.43724.cbr () boemann ! dk
[Download RAW message or body]

Hi

I have solved the issue with race condition when dockers are tabbed in current 
kdelibs trunk

to get it to look nice you need to aplly the attached patch to qt

I'll submit the patch to TT

-- 
best regards / venlig hilsen
Casper Boemann

["docker.diff" (text/x-diff)]

Index: qdockwidget.cpp
===================================================================
--- qdockwidget.cpp	(revision 599967)
+++ qdockwidget.cpp	(working copy)
@@ -189,13 +189,30 @@
     updateButtons();
 }
 
+/*
+  internal: makes a descriptive text from a text suited for a menu entry
+ */
+static QString qt_strippedText(QString s)
+{
+    int i = 0;
+    while (i < s.size()) {
+        ++i;
+        if (s.at(i-1) != QLatin1Char('&'))
+            continue;
+        if (i < s.size() && s.at(i) == QLatin1Char('&'))
+            ++i;
+        s.remove(i-1,1);
+    }
+    return s.trimmed();
+};
+
 QStyleOptionDockWidget QDockWidgetPrivate::getStyleOption()
 {
     Q_Q(QDockWidget);
     QStyleOptionDockWidget opt;
     opt.init(q);
     opt.rect = titleArea;
-    opt.title = q->windowTitle();
+    opt.title = qt_strippedText(q->windowTitle());
     opt.closable = hasFeature(q, QDockWidget::DockWidgetClosable);
     opt.movable = hasFeature(q, QDockWidget::DockWidgetMovable);
     opt.floatable = hasFeature(q, QDockWidget::DockWidgetFloatable);
@@ -265,7 +282,7 @@
     QSize closeSize = closeButton ? closeButton->sizeHint() : QSize(0,0);
     QSize floatSize = floatButton ? floatButton->sizeHint() : QSize(0,0);
 
-    int minWidth  = q->fontMetrics().width(q->windowTitle()) + 2 * fw + 2 * mw;
+    int minWidth  = q->fontMetrics().width(qt_strippedText(q->windowTitle())) + 2 * fw + 2 * mw;
     int minHeight = qMax(closeSize.width(), closeSize.height());
     minHeight = qMax(minHeight, qMax(floatSize.width(), floatSize.height()));
 #ifdef Q_WS_MAC


_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic