author | sandman <sandman> | 2002-06-19 23:05:50 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-06-19 23:05:50 (UTC) |
commit | 37bc7d72ed82a9593f9fd441abad23c5de458ad0 (patch) (unidiff) | |
tree | 8ed79d1e316af3b888db63ddc6045b419cc7f269 | |
parent | ce6d4880d3d78fb569322c14e425654785de980d (diff) | |
download | opie-37bc7d72ed82a9593f9fd441abad23c5de458ad0.zip opie-37bc7d72ed82a9593f9fd441abad23c5de458ad0.tar.gz opie-37bc7d72ed82a9593f9fd441abad23c5de458ad0.tar.bz2 |
Fixed position of popup and added pixmaps for cut/copy/paste
-rw-r--r-- | core/applets/clipboardapplet/clipboard.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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 *) | |||
131 | { | 131 | { |
132 | if ( !menu ) { | 132 | if ( !menu ) { |
133 | menu = new QPopupMenu ( this ); | 133 | menu = new QPopupMenu ( this ); |
134 | menu-> insertItem ( tr( "Cut" ), 0 ); | 134 | menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "cut" )), tr( "Cut" ), 0 ); |
135 | menu-> insertItem ( tr( "Copy" ), 1 ); | 135 | menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "copy" )), tr( "Copy" ), 1 ); |
136 | menu-> insertItem ( tr( "Paste" ), 2 ); | 136 | menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "paste" )), tr( "Paste" ), 2 ); |
137 | connect ( menu, SIGNAL( activated ( int )), this, SLOT( action ( int ))); | 137 | connect ( menu, SIGNAL( activated ( int )), this, SLOT( action ( int ))); |
138 | } | 138 | } |
139 | menu->popup(mapToGlobal(QPoint(0,0))); | 139 | QPoint p = mapToGlobal ( QPoint ( 0, 0 )); |
140 | QSize s = menu-> sizeHint ( ); | ||
141 | |||
142 | menu-> popup ( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) - s. height ( ))); | ||
140 | } | 143 | } |
141 | 144 | ||
142 | void ClipboardApplet::action(int id) | 145 | void ClipboardApplet::action(int id) |