summaryrefslogtreecommitdiff
path: root/core/applets/screenshotapplet/screenshot.cpp
Unidiff
Diffstat (limited to 'core/applets/screenshotapplet/screenshot.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/screenshotapplet/screenshot.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp
index 20e1c9b..9aa012a 100644
--- a/core/applets/screenshotapplet/screenshot.cpp
+++ b/core/applets/screenshotapplet/screenshot.cpp
@@ -18,48 +18,49 @@
18/* OPIE */ 18/* OPIE */
19#include <opie2/otaskbarapplet.h> 19#include <opie2/otaskbarapplet.h>
20#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include <qpe/applnk.h> 21#include <qpe/applnk.h>
22 22
23/* QT */ 23/* QT */
24#include <qlineedit.h> 24#include <qlineedit.h>
25#include <qdir.h> 25#include <qdir.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qpainter.h> 28#include <qpainter.h>
29#include <qspinbox.h> 29#include <qspinbox.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qcheckbox.h> 31#include <qcheckbox.h>
32#include <qmessagebox.h> 32#include <qmessagebox.h>
33 33
34/* STD */ 34/* STD */
35#include <stdlib.h> 35#include <stdlib.h>
36#include <sys/socket.h> 36#include <sys/socket.h>
37#include <netinet/in.h> 37#include <netinet/in.h>
38#include <netdb.h> 38#include <netdb.h>
39#include <unistd.h> 39#include <unistd.h>
40 40
41/* XPM */ 41/* XPM */
42using namespace Opie::Ui;
42static char * snapshot_xpm[] = { 43static char * snapshot_xpm[] = {
43"32 32 177 2", 44"32 32 177 2",
44 " c None", 45 " c None",
45 ". c #042045", 46 ". c #042045",
46 "+ c #0D2B47", 47 "+ c #0D2B47",
47 "@ c #0E325E", 48 "@ c #0E325E",
48 "# c #0D2E50", 49 "# c #0D2E50",
49 "$ c #0A1C32", 50 "$ c #0A1C32",
50 "% c #0F3A69", 51 "% c #0F3A69",
51 "& c #164680", 52 "& c #164680",
52 "* c #165EAE", 53 "* c #165EAE",
53 "= c #134D89", 54 "= c #134D89",
54 "- c #0A3A6E", 55 "- c #0A3A6E",
55 "; c #031024", 56 "; c #031024",
56 "> c #031B36", 57 "> c #031B36",
57 ", c #1A5EA3", 58 ", c #1A5EA3",
58 "' c #1862B1", 59 "' c #1862B1",
59 ") c #1866B9", 60 ") c #1866B9",
60 "! c #0F5AAC", 61 "! c #0F5AAC",
61 "~ c #0F56A8", 62 "~ c #0F56A8",
62 "{ c #0C4C96", 63 "{ c #0C4C96",
63 "] c #030918", 64 "] c #030918",
64 "^ c #060206", 65 "^ c #060206",
65 "/ c #20242C", 66 "/ c #20242C",
@@ -515,29 +516,27 @@ void ScreenshotApplet::mousePressEvent( QMouseEvent *)
515 // so we check the position against the screen width and correct the difference if needed 516 // so we check the position against the screen width and correct the difference if needed
516 517
517 int screenWidth = qApp->desktop()->width(); 518 int screenWidth = qApp->desktop()->width();
518 int windowPosX = curPos. x ( ) - ( sc-> sizeHint ( ). width ( ) - width ( )) / 2 ; 519 int windowPosX = curPos. x ( ) - ( sc-> sizeHint ( ). width ( ) - width ( )) / 2 ;
519 int ZwindowPosX, XwindowPosX; 520 int ZwindowPosX, XwindowPosX;
520 521
521 // the window would be placed beyond the screen wich doesn't look tooo good 522 // the window would be placed beyond the screen wich doesn't look tooo good
522 if ( (windowPosX + sc-> sizeHint ( ). width ( )) > screenWidth ) { 523 if ( (windowPosX + sc-> sizeHint ( ). width ( )) > screenWidth ) {
523 XwindowPosX = windowPosX + sc-> sizeHint ( ). width ( ) - screenWidth; 524 XwindowPosX = windowPosX + sc-> sizeHint ( ). width ( ) - screenWidth;
524 ZwindowPosX = windowPosX - XwindowPosX - 1; 525 ZwindowPosX = windowPosX - XwindowPosX - 1;
525 } else { 526 } else {
526 ZwindowPosX = windowPosX; 527 ZwindowPosX = windowPosX;
527 } 528 }
528 529
529 sc-> move ( ZwindowPosX, curPos. y ( ) - sc-> sizeHint ( ). height ( ) ); 530 sc-> move ( ZwindowPosX, curPos. y ( ) - sc-> sizeHint ( ). height ( ) );
530 sc-> show ( ); 531 sc-> show ( );
531} 532}
532 533
533void ScreenshotApplet::paintEvent( QPaintEvent* ) 534void ScreenshotApplet::paintEvent( QPaintEvent* )
534{ 535{
535 QPainter p ( this ); 536 QPainter p ( this );
536 p.drawPixmap( 0,0, m_icon ); 537 p.drawPixmap( 0,0, m_icon );
537} 538}
538 539
539Q_EXPORT_INTERFACE() 540
540{ 541EXPORT_OPIE_APPLET_v1( ScreenshotApplet )
541 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ScreenshotApplet> );
542}
543 542