Bug 128622

Summary: Menu arrows invisible or misplaced in vertical panels
Product: [Plasma] kicker Reporter: Maxilys <maxilys>
Component: generalAssignee: Aaron J. Seigo <aseigo>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Patch for kicker/libkicker/panelbutton.cpp
Bugfree patch for kicker/libkicker/panelbutton.cpp

Description Maxilys 2006-06-04 16:11:59 UTC
Version:           3.5.2 (using KDE 3.5.3 Level "a" , unofficial build of SUSE )
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.16.13-4-default

I have a panel on the left with quick browsers (i.e. icons with popup menus). No arrow ever appears.

If I put the panel on the right of the screen, the arrows appear centered above the icons.

I looked at the sources and I saw that the arrow is moved out of icon rectangle when the panel is on the left and not moved at all when the panel is on the right. The result is what I get.

By the way, to center the arrow is nice but I don't think that to make them appear/disappear was such a good idea. I miss them.
Comment 1 Maxilys 2006-06-04 16:19:34 UTC
Created attachment 16471 [details]
Patch for kicker/libkicker/panelbutton.cpp

Since the menu arrows are now centered, this patch sets them so whatever side
the popup must appear.
Comment 2 Maxilys 2006-06-04 18:58:21 UTC
Created attachment 16477 [details]
Bugfree patch for kicker/libkicker/panelbutton.cpp

Oops! I was already compiling KDElibs and I couldn't test what I was writing.
Now, I'm sure it works as I can see on my screen.
Comment 3 Aaron J. Seigo 2006-06-05 16:49:24 UTC
SVN commit 548428 by aseigo:

fix arrow locations on vert panels
patch by Maxilys <maxilys@tele2.fr>
BUGS:128622,128561


 M  +8 -3      panelbutton.cpp  


--- branches/KDE/3.5/kdebase/kicker/libkicker/panelbutton.cpp #548427:548428
@@ -631,7 +631,8 @@
     if (m_drawArrow && (m_highlight || active))
     {
         QStyle::PrimitiveElement e = QStyle::PE_ArrowUp;
-        QRect r(width() / 2 - 4, 0, 8, 8);
+        int arrowSize = style().pixelMetric(QStyle::PM_MenuButtonIndicator);
+        QRect r((width() - arrowSize)/2, 0, arrowSize, arrowSize);
 
         switch (m_arrowDirection)
         {
@@ -640,27 +641,31 @@
                 break;
             case KPanelExtension::Bottom:
                 e = QStyle::PE_ArrowDown;
-                r.moveBy(0, height() - 8);
+                r.moveBy(0, height() - arrowSize);
                 break;
             case KPanelExtension::Right:
                 e = QStyle::PE_ArrowRight;
-                r.moveBy(width() - 8 , 0);
+                r = QRect(width() - arrowSize, (height() - arrowSize)/2, arrowSize, arrowSize);
                 break;
             case KPanelExtension::Left:
                 e = QStyle::PE_ArrowLeft;
+                r = QRect(0, (height() - arrowSize)/2, arrowSize, arrowSize);
                 break;
             case KPanelExtension::Floating:
                 if (orientation() == Horizontal)
                 {
                     e = QStyle::PE_ArrowDown;
+                    r.moveBy(0, height() - arrowSize);
                 }
                 else if (QApplication::reverseLayout())
                 {
                     e = QStyle::PE_ArrowLeft;
+                    r = QRect(0, (height() - arrowSize)/2, arrowSize, arrowSize);
                 }
                 else
                 {
                     e = QStyle::PE_ArrowRight;
+                    r = QRect(width() - arrowSize, (height() - arrowSize)/2, arrowSize, arrowSize);
                 }
                 break;
         }