author | leseb <leseb> | 2002-04-30 08:54:28 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-04-30 08:54:28 (UTC) |
commit | 713aa4385e859c9300ee2a5b0086fbaabf3b3a33 (patch) (unidiff) | |
tree | ee835511cd9e024ccb1ceb4fa19e7be5db71ff9e /noncore | |
parent | ace7b43b1c978950ca38e8bd962f4b52d34ac307 (diff) | |
download | opie-713aa4385e859c9300ee2a5b0086fbaabf3b3a33.zip opie-713aa4385e859c9300ee2a5b0086fbaabf3b3a33.tar.gz opie-713aa4385e859c9300ee2a5b0086fbaabf3b3a33.tar.bz2 |
Clean code + fix 2 new introduced bugs
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 58 |
1 files changed, 14 insertions, 44 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 77fee98..74787e5 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -13,8 +13,6 @@ | |||
13 | 13 | ||
14 | #include "drawpad.h" | 14 | #include "drawpad.h" |
15 | 15 | ||
16 | //#include "colordialog.h" | ||
17 | //#include "colorpanel.h" | ||
18 | #include "drawpadcanvas.h" | 16 | #include "drawpadcanvas.h" |
19 | #include "ellipsetool.h" | 17 | #include "ellipsetool.h" |
20 | #include "erasetool.h" | 18 | #include "erasetool.h" |
@@ -28,13 +26,14 @@ | |||
28 | #include "rectangletool.h" | 26 | #include "rectangletool.h" |
29 | #include "texttool.h" | 27 | #include "texttool.h" |
30 | 28 | ||
29 | #include <opie/colordialog.h> | ||
30 | #include <opie/colorpopupmenu.h> | ||
31 | |||
31 | #include <qpe/applnk.h> | 32 | #include <qpe/applnk.h> |
32 | #include <qpe/global.h> | 33 | #include <qpe/global.h> |
33 | #include <qpe/qpemenubar.h> | 34 | #include <qpe/qpemenubar.h> |
34 | #include <qpe/qpetoolbar.h> | 35 | #include <qpe/qpetoolbar.h> |
35 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
36 | #include <opie/colordialog.h> | ||
37 | #include <opie/colorpopupmenu.h> | ||
38 | 37 | ||
39 | #include <qaction.h> | 38 | #include <qaction.h> |
40 | #include <qfile.h> | 39 | #include <qfile.h> |
@@ -218,55 +217,26 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
218 | m_pPenColorToolButton = new QToolButton(drawParametersToolBar); | 217 | m_pPenColorToolButton = new QToolButton(drawParametersToolBar); |
219 | m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor.png")); | 218 | m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor.png")); |
220 | 219 | ||
221 | ColorPopupMenu* colorPopupMenu = new ColorPopupMenu( Qt::black, m_pPenColorToolButton ); | 220 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, m_pPenColorToolButton); |
222 | m_pPenColorToolButton->setPopup( colorPopupMenu ); | 221 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); |
223 | m_pPenColorToolButton->setPopupDelay( 0 ); | ||
224 | QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); | ||
225 | connect( colorPopupMenu, SIGNAL( colorSelected( const QColor& ) ), this, SLOT( changePenColor( const QColor& ) ) ); | ||
226 | |||
227 | // QPopupMenu* penColorPopupMenu = new QPopupMenu(m_pPenColorToolButton); | ||
228 | |||
229 | // ColorPanel* penColorPanel = new ColorPanel(penColorPopupMenu); | ||
230 | // connect(penColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); | ||
231 | 222 | ||
232 | // penColorPopupMenu->insertItem(penColorPanel); | 223 | QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); |
233 | // penColorPopupMenu->insertSeparator(); | 224 | m_pPenColorToolButton->setPopup(penColorPopupMenu); |
234 | 225 | m_pPenColorToolButton->setPopupDelay(0); | |
235 | // QAction* choosePenColorAction = new QAction(tr("More"), tr("More..."), 0, this); | ||
236 | // connect(choosePenColorAction, SIGNAL(activated()), this, SLOT(choosePenColor())); | ||
237 | // choosePenColorAction->addTo(penColorPopupMenu); | ||
238 | |||
239 | // m_pPenColorToolButton->setPopup(colorPopupMenu); | ||
240 | // m_pPenColorToolButton->setPopupDelay(0); | ||
241 | 226 | ||
242 | // penColorPanel->buttonSelected(Qt::black); | 227 | changePenColor(Qt::black); |
243 | 228 | ||
244 | m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); | 229 | m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); |
245 | m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor.png")); | 230 | m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor.png")); |
246 | 231 | ||
232 | ColorPopupMenu* brushColorPopupMenu = new ColorPopupMenu(Qt::white, m_pBrushColorToolButton); | ||
233 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); | ||
247 | 234 | ||
248 | colorPopupMenu = new ColorPopupMenu( Qt::white, m_pBrushColorToolButton ); | ||
249 | m_pBrushColorToolButton->setPopup( colorPopupMenu ); | ||
250 | m_pBrushColorToolButton->setPopupDelay( 0 ); | ||
251 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); | 235 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); |
252 | connect( colorPopupMenu, SIGNAL( colorSelected( const QColor& ) ), this, SLOT( changeeBrushColor( const QColor& ) ) ); | 236 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); |
253 | 237 | m_pBrushColorToolButton->setPopupDelay(0); | |
254 | // QPopupMenu* brushColorPopupMenu = new QPopupMenu(m_pBrushColorToolButton); | ||
255 | |||
256 | // ColorPanel* brushColorPanel = new ColorPanel(brushColorPopupMenu); | ||
257 | // connect(brushColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); | ||
258 | |||
259 | // brushColorPopupMenu->insertItem(brushColorPanel); | ||
260 | // brushColorPopupMenu->insertSeparator(); | ||
261 | |||
262 | // QAction* chooseBrushColorAction = new QAction(tr("More"), tr("More..."), 0, this); | ||
263 | // connect(chooseBrushColorAction, SIGNAL(activated()), this, SLOT(chooseBrushColor())); | ||
264 | // chooseBrushColorAction->addTo(brushColorPopupMenu); | ||
265 | |||
266 | // m_pBrushColorToolButton->setPopup(brushColorPopupMenu); | ||
267 | // m_pBrushColorToolButton->setPopupDelay(0); | ||
268 | 238 | ||
269 | // brushColorPanel->buttonSelected(Qt::white); | 239 | changeBrushColor(Qt::white); |
270 | 240 | ||
271 | // init pages | 241 | // init pages |
272 | 242 | ||