author | harlekin <harlekin> | 2003-04-10 20:10:36 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-04-10 20:10:36 (UTC) |
commit | 0740e2ef7132c53ebe29cc3b548647012bc75d05 (patch) (unidiff) | |
tree | eaf9a1fbdf73324743dc1a896e813c6e2675a513 /noncore/apps/tinykate | |
parent | dbbc4f5122cae1c6d64ce3e6793f4f588075a103 (diff) | |
download | opie-0740e2ef7132c53ebe29cc3b548647012bc75d05.zip opie-0740e2ef7132c53ebe29cc3b548647012bc75d05.tar.gz opie-0740e2ef7132c53ebe29cc3b548647012bc75d05.tar.bz2 |
goodbye qpemenubar and qpetoolbar ( both are depreciated ), using qmenubar now, and also the icons are in the menubar now as qtoolbutton which as side effect gives them the nice benefit if beeing centered to the right
-rw-r--r-- | noncore/apps/tinykate/tinykate.cpp | 78 | ||||
-rw-r--r-- | noncore/apps/tinykate/tinykate.h | 12 |
2 files changed, 46 insertions, 44 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index a25f81f..694efc6 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp | |||
@@ -10,3 +10,3 @@ | |||
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free softwaSre; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
@@ -19,4 +19,4 @@ | |||
19 | #include <qlayout.h> | 19 | #include <qlayout.h> |
20 | #include <qpe/qpetoolbar.h> | 20 | #include <qtoolbutton.h> |
21 | #include <qpe/qpemenubar.h> | 21 | #include <qmenubar.h> |
22 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
@@ -43,8 +43,4 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
43 | 43 | ||
44 | setToolBarsMovable(FALSE); | 44 | QMenuBar *mb = new QMenuBar( this ); |
45 | 45 | mb->setMargin( 0 ); | |
46 | QPEToolBar *bar = new QPEToolBar( this ); | ||
47 | bar->setHorizontalStretchable( TRUE ); | ||
48 | QPEMenuBar *mb = new QPEMenuBar( bar ); | ||
49 | mb->setMargin( 0 ); | ||
50 | 46 | ||
@@ -89,25 +85,30 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
89 | // Action for cutting text | 85 | // Action for cutting text |
90 | editCut = new QAction( tr( "Cut" ), Resource::loadPixmap( "cut" ), QString::null, 0, this, 0 ); | 86 | editCut = new QToolButton( 0 ); |
91 | editCut->addTo( bar ); | 87 | editCut->setAutoRaise( true ); |
88 | editCut->setIconSet( Resource::loadPixmap( "cut" ) ); | ||
92 | 89 | ||
93 | // Action for Copying text | 90 | // Action for Copying text |
94 | editCopy = new QAction( tr( "Copy" ), Resource::loadPixmap( "copy" ), QString::null, 0, this, 0 ); | 91 | editCopy = new QToolButton( 0 ); |
95 | editCopy->addTo( bar ); | 92 | editCopy->setAutoRaise( true ); |
93 | editCopy->setIconSet( Resource::loadPixmap( "copy" ) ); | ||
96 | 94 | ||
97 | // Action for pasting text | 95 | // Action for pasting text |
98 | editPaste = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); | 96 | editPaste = new QToolButton( 0 ); |
99 | editPaste->addTo( bar ); | 97 | editPaste->setAutoRaise( true ); |
100 | 98 | editPaste->setIconSet( Resource::loadPixmap( "paste" ) ); | |
101 | 99 | ||
102 | // Action for finding / replacing text | 100 | // Action for finding / replacing text |
103 | editFindReplace = new QAction( tr( "Find/Replace" ), Resource::loadPixmap("find"), QString::null, 0, this, 0 ); | 101 | editFindReplace = new QToolButton( 0 ); |
104 | editFindReplace->addTo( bar ); | 102 | editFindReplace->setAutoRaise( true ); |
103 | editFindReplace->setIconSet( Resource::loadPixmap("find") ); | ||
105 | 104 | ||
106 | // Action for undo | 105 | // Action for undo |
107 | editUndo = new QAction( tr( "Undo" ),Resource::loadPixmap( "undo" ) , QString::null, 0, this, 0 ); | 106 | editUndo = new QToolButton( 0 ); |
108 | editUndo->addTo( bar ); | 107 | editUndo->setAutoRaise( true ); |
108 | editUndo->setIconSet( Resource::loadPixmap( "undo" ) ); | ||
109 | 109 | ||
110 | // Action for redo | 110 | // Action for redo |
111 | editRedo = new QAction( tr( "Redo" ),Resource::loadPixmap( "redo" ) , QString::null, 0, this, 0 ); | 111 | editRedo = new QToolButton( 0 ); |
112 | editRedo->addTo( bar ); | 112 | editRedo->setAutoRaise( true ); |
113 | editRedo->setIconSet( Resource::loadPixmap( "redo" ) ); | ||
113 | 114 | ||
@@ -122,8 +123,15 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
122 | 123 | ||
123 | mb->insertItem(tr("View"),popup); | 124 | mb->insertItem(tr("View"),popup); |
124 | 125 | ||
126 | popup = new QPopupMenu( this ); | ||
127 | mb->insertItem(tr("Utils"),popup); | ||
125 | 128 | ||
126 | 129 | ||
127 | popup = new QPopupMenu( this ); | 130 | mb->insertItem( editCut ); |
128 | mb->insertItem(tr("Utils"),popup); | 131 | mb->insertItem( editCopy ); |
132 | mb->insertItem( editPaste ); | ||
133 | mb->insertItem( editFindReplace ); | ||
134 | mb->insertItem( editUndo ); | ||
135 | mb->insertItem( editRedo ); | ||
136 | |||
129 | 137 | ||
@@ -188,4 +196,4 @@ void TinyKate::slotCurrentChanged( QWidget * view) | |||
188 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); | 196 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); |
189 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); | 197 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); |
190 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); | 198 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); |
191 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); | 199 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); |
@@ -196,9 +204,9 @@ void TinyKate::slotCurrentChanged( QWidget * view) | |||
196 | 204 | ||
197 | connect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); | 205 | connect(editCopy,SIGNAL(clicked()),currentView,SLOT(copy())); |
198 | connect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); | 206 | connect(editCut,SIGNAL(clicked()),currentView,SLOT(cut())); |
199 | connect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); | 207 | connect(editPaste,SIGNAL(clicked()),currentView,SLOT(paste())); |
200 | connect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); | 208 | connect(editUndo,SIGNAL(clicked()),currentView,SLOT(undo())); |
201 | connect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); | 209 | connect(editRedo,SIGNAL(clicked()),currentView,SLOT(redo())); |
202 | connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); | 210 | connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); |
203 | connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); | 211 | connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); |
204 | connect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); | 212 | connect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); |
diff --git a/noncore/apps/tinykate/tinykate.h b/noncore/apps/tinykate/tinykate.h index bb32f98..cdd8f43 100644 --- a/noncore/apps/tinykate/tinykate.h +++ b/noncore/apps/tinykate/tinykate.h | |||
@@ -25,2 +25,3 @@ | |||
25 | 25 | ||
26 | class QToolButton; | ||
26 | class QAction; | 27 | class QAction; |
@@ -51,11 +52,4 @@ private: | |||
51 | 52 | ||
52 | QAction *editCopy; | 53 | QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; |
53 | QAction *editCut; | 54 | QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; |
54 | QAction *editPaste; | ||
55 | QAction *editUndo; | ||
56 | QAction *editRedo; | ||
57 | QAction *editFindReplace; | ||
58 | QAction *viewIncFontSizes; | ||
59 | QAction *viewDecFontSizes; | ||
60 | QAction *utilSettings; | ||
61 | 55 | ||