summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp40
1 files changed, 5 insertions, 35 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index b3e72a7..d06672a 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -21,12 +21,13 @@
21#include <qpe/filemanager.h> 21#include <qpe/filemanager.h>
22#include <qpe/qpeapplication.h> 22#include <qpe/qpeapplication.h>
23#include <qpe/timestring.h> 23#include <qpe/timestring.h>
24#include <qpe/applnk.h> 24#include <qpe/applnk.h>
25#include <qpe/ir.h> 25#include <qpe/ir.h>
26#include <qpe/config.h> 26#include <qpe/config.h>
27#include <qpe/resource.h>
27using namespace Opie::Core; 28using namespace Opie::Core;
28using namespace Opie::Ui; 29using namespace Opie::Ui;
29 30
30/* QT */ 31/* QT */
31#include <qmultilineedit.h> 32#include <qmultilineedit.h>
32#include <qlistbox.h> 33#include <qlistbox.h>
@@ -45,44 +46,12 @@ using namespace Opie::Ui;
45#include <qstringlist.h> 46#include <qstringlist.h>
46#include <qtimer.h> 47#include <qtimer.h>
47 48
48/* STD */ 49/* STD */
49#include <stdlib.h> 50#include <stdlib.h>
50 51
51/* XPM */
52static char * notes_xpm[] = {
53"16 16 11 1",
54" c None",
55". c #000000",
56"+ c #7F7F7F",
57"@ c #BFBFBF",
58"# c #BFC1FF",
59"$ c #FF0000",
60"% c #FFFFFF",
61"& c #00037F",
62"* c #0006FF",
63"= c #0005BF",
64"- c #7F0000",
65" .. ",
66" .. ",
67" ... ",
68" .+ ",
69" .@. ",
70" . .+ ",
71" ..#.@. ",
72" ..###.+.. ",
73" ..###$...##.. ",
74"..###$$$%+$$##&.",
75".*=####$-###&=&.",
76".=**=###==&=&=..",
77" ..=**=#&=&=.. ",
78" ..=*=&=.. ",
79" ..=.. ",
80" . "};
81
82
83NotesControl::NotesControl( QWidget *, const char * ) 52NotesControl::NotesControl( QWidget *, const char * )
84 : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop ) 53 : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop )
85// : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) 54// : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup )
86{ 55{
87 QDir d( QDir::homeDirPath()+"/notes"); 56 QDir d( QDir::homeDirPath()+"/notes");
88 if( !d.exists()) { 57 if( !d.exists()) {
@@ -458,14 +427,15 @@ void NotesControl::slotSearch() {
458// } 427// }
459 428
460//=========================================================================== 429//===========================================================================
461 430
462NotesApplet::NotesApplet( QWidget *parent, const char *name ) 431NotesApplet::NotesApplet( QWidget *parent, const char *name )
463 : QWidget( parent, name ) { 432 : QWidget( parent, name ) {
464 setFixedHeight( 18 ); 433 setFixedHeight( AppLnk::smallIconSize() );
465 setFixedWidth( 14 ); 434 setFixedWidth( AppLnk::smallIconSize() );
435 notesPixmap.convertFromImage( Resource::loadImage( "edit" ).smoothScale( height(), width() ) );
466 vc = new NotesControl; 436 vc = new NotesControl;
467} 437}
468 438
469NotesApplet::~NotesApplet() { 439NotesApplet::~NotesApplet() {
470 delete vc; 440 delete vc;
471} 441}
@@ -505,12 +475,12 @@ void NotesApplet::mousePressEvent( QMouseEvent *) {
505 vc->view->setFocus(); 475 vc->view->setFocus();
506 } 476 }
507} 477}
508 478
509void NotesApplet::paintEvent( QPaintEvent* ) { 479void NotesApplet::paintEvent( QPaintEvent* ) {
510 QPainter p(this); 480 QPainter p(this);
511 p.drawPixmap( 0, 1, ( const char** ) notes_xpm ); 481 p.drawPixmap( 0, 2, notesPixmap );
512} 482}
513 483
514 484
515EXPORT_OPIE_APPLET_v1( NotesApplet ) 485EXPORT_OPIE_APPLET_v1( NotesApplet )
516 486