Ugly black line in completion popup (was: kdelibs/kdefx)

Ingo Klöcker kloecker at kde.org
Fri Jan 2 16:39:38 GMT 2004


Hi,

the below commit is responsible for the ugly black line that you see in 
the attached screenshot. Please fix or revert.

FWIW, I'm using Keramik style (i.e. the default style) and Qt 3.2.3 
(which is the preferred Qt version for KDE 3.2 AFAIK).

Regards,
Ingo

----------  Forwarded Message  ----------

Subject: kdelibs/kdefx
Date: Monday 22 December 2003 20:31
From: Fredrik Höglund <fredrik at kde.org>
To: kde-cvs at kde.org

CVS commit by fredrik:

- Use the filled frame workaround for all QFrames that use the
 menubar/toolbar panel shapes, and not just for menubars and toolbars.

- Put 3 pixels of extra spacing between menubar items in all styles by
 default. (Needs Qt 3.3)

Reviewed by Maksim.


  M +44 -41    kstyle.cpp   1.45


--- kdelibs/kdefx/kstyle.cpp  #1.44:1.45
@@ -240,9 +240,10 @@ void KStyle::polish( QWidget* widget )
         if ( d->useFilledFrameWorkaround )
         {
-                if (widget->inherits("QToolBar"))
-                        widget->installEventFilter(this);
-                if (widget->inherits("QMenuBar"))
+                if ( QFrame *frame = ::qt_cast< QFrame* >( widget ) )
 { +                        QFrame::Shape shape = frame->frameShape();
 +                        if (shape == QFrame::ToolBarPanel || shape ==
 QFrame::MenuBarPanel) widget->installEventFilter(this);
         }
+        }
 }

@@ -252,9 +253,10 @@ void KStyle::unPolish( QWidget* widget )
         if ( d->useFilledFrameWorkaround )
         {
-                if (widget->inherits("QMenuBar"))
-                        widget->removeEventFilter(this);
-                if (widget->inherits("QToolBar"))
+                if ( QFrame *frame = ::qt_cast< QFrame* >( widget ) )
 { +                        QFrame::Shape shape = frame->frameShape();
 +                        if (shape == QFrame::ToolBarPanel || shape ==
 QFrame::MenuBarPanel) widget->removeEventFilter(this);
         }
+        }
 }

@@ -970,4 +972,12 @@ int KStyle::pixelMetric(PixelMetric m, c
                         return -1;

+#if QT_VERSION >= 0x030300
+                case PM_MenuBarItemSpacing:
+                        return 3;
+
+                case PM_ToolBarItemSpacing:
+                        return 0;
+#endif
+
                 default:
                         return QCommonStyle::pixelMetric( m, widget );
@@ -1760,17 +1770,11 @@ bool KStyle::eventFilter( QObject* objec
                 // filled frames in all QMenuBars and QToolBars.
                 // -- Karol.
-                if (event->type() == QEvent::Paint)
-                {
-                        QMenuBar* menubar = 0;
-                        QToolBar* toolbar = 0;
-                        if (object->inherits("QMenuBar"))
-                                menubar =
 static_cast<QMenuBar*>(object); -                        else if
 (object->inherits("QToolBar")) -                               
 toolbar = static_cast<QToolBar*>(object); -                        if
 ( menubar || toolbar )
+                QFrame *frame = 0;
+                if ( event->type() == QEvent::Paint
+                                && (frame =
 ::qt_cast<QFrame*>(object)) ) {
                                 bool horizontal = true;
                                 QPaintEvent* pe = (QPaintEvent*)event;
-                                QFrame* frame   = (QFrame*)object;
+                        QToolBar *toolbar = ::qt_cast< QToolBar *>(
 frame ); QRect r = pe->rect();

@@ -1798,5 +1802,4 @@ bool KStyle::eventFilter( QObject* objec
                         }
                 }
-        }

         return false;

-------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keramik-bug.png
Type: image/png
Size: 2448 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040102/72c87dea/attachment.png>


More information about the kde-core-devel mailing list