[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: [PATCH] Re: Right click on arrows and on KMenu
From: John Firebaugh <jfirebaugh () kde ! org>
Date: 2001-06-23 16:46:08
[Download RAW message or body]
On Friday June 22, 2001 5:37 am, Gioele Barabucci wrote:
> Kicker arrows:
> I've configured kicker to have a 1px arrow on the right and no arrow on
> the left. If I move on the rightmost pixel of kicker and use RMB I get
> the popup menu on the leftmost part of kicker, where the left arrow
> should be if I'd not removed it.
This patch should fix this. Please review.
later,
John
["popup.diff" (text/plain)]
Index: core/container_panel.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_panel.cpp,v
retrieving revision 1.11
diff -u -3 -p -r1.11 container_panel.cpp
--- core/container_panel.cpp 2001/06/23 15:06:39 1.11
+++ core/container_panel.cpp 2001/06/23 16:45:50
@@ -300,22 +300,26 @@ void PanelContainer::hideRight()
animatedHide(false);
}
-QPoint PanelContainer::getPopupPosition(QPopupMenu *menu, QPoint eventpos)
+QPoint PanelContainer::getPopupPosition(QPopupMenu *menu, QPoint globalPos)
{
QPoint p(0,0);
switch (position()) {
case Top:
- p = mapToGlobal(QPoint(eventpos.x(), height()));
+ p = mapToGlobal(QPoint(0, height()));
+ p.setX(globalPos.x());
break;
case Bottom:
- p = mapToGlobal(QPoint(eventpos.x(), 0 - menu->height()));
+ p = mapToGlobal(QPoint(0, 0 - menu->height()));
+ p.setX(globalPos.x());
break;
case Right:
- p = mapToGlobal(QPoint(0-menu->width(), eventpos.y()));
+ p = mapToGlobal(QPoint(0-menu->width(), 0));
+ p.setY(globalPos.y());
break;
case Left:
- p = mapToGlobal(QPoint(width(), eventpos.y()));
+ p = mapToGlobal(QPoint(width(), 0));
+ p.setY(globalPos.y());
break;
}
@@ -596,7 +600,7 @@ bool PanelContainer::eventFilter( QObjec
}
else if ( me->button() == RightButton )
{
- showPanelMenu( me->pos() );
+ showPanelMenu( me->globalPos() );
}
}
break;
@@ -997,11 +1001,11 @@ void PanelContainer::autoHide(bool hide)
_in_autohide = false;
}
-void PanelContainer::showPanelMenu( QPoint pos )
+void PanelContainer::showPanelMenu( QPoint globalPos )
{
if(!_opMnu)
_opMnu = new PanelOpMenu(true);
- _opMnu->exec(getPopupPosition(_opMnu, pos));
+ _opMnu->exec(getPopupPosition(_opMnu, globalPos));
}
void PanelContainer::moveMe()
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic