From 37bc7d72ed82a9593f9fd441abad23c5de458ad0 Mon Sep 17 00:00:00 2001 From: sandman Date: Wed, 19 Jun 2002 23:05:50 +0000 Subject: Fixed position of popup and added pixmaps for cut/copy/paste --- (limited to 'core/applets/clipboardapplet') diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp index 7714f81..cd4f61c 100644 --- a/core/applets/clipboardapplet/clipboard.cpp +++ b/core/applets/clipboardapplet/clipboard.cpp @@ -131,12 +131,15 @@ void ClipboardApplet::mousePressEvent ( QMouseEvent *) { if ( !menu ) { menu = new QPopupMenu ( this ); - menu-> insertItem ( tr( "Cut" ), 0 ); - menu-> insertItem ( tr( "Copy" ), 1 ); - menu-> insertItem ( tr( "Paste" ), 2 ); + menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "cut" )), tr( "Cut" ), 0 ); + menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "copy" )), tr( "Copy" ), 1 ); + menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "paste" )), tr( "Paste" ), 2 ); connect ( menu, SIGNAL( activated ( int )), this, SLOT( action ( int ))); } - menu->popup(mapToGlobal(QPoint(0,0))); + QPoint p = mapToGlobal ( QPoint ( 0, 0 )); + QSize s = menu-> sizeHint ( ); + + menu-> popup ( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) - s. height ( ))); } void ClipboardApplet::action(int id) -- cgit v0.9.0.2