author | drw <drw> | 2002-04-26 00:51:19 (UTC) |
---|---|---|
committer | drw <drw> | 2002-04-26 00:51:19 (UTC) |
commit | 97e07ec8e7345d90913791edba813d4b72aa33a9 (patch) (unidiff) | |
tree | 468906df1cbe3db449c771071482d9a79d3f39f0 /noncore/graphics/drawpad/drawpad.cpp | |
parent | a111f57eedcf27623e9bff2816c83d3287272aff (diff) | |
download | opie-97e07ec8e7345d90913791edba813d4b72aa33a9.zip opie-97e07ec8e7345d90913791edba813d4b72aa33a9.tar.gz opie-97e07ec8e7345d90913791edba813d4b72aa33a9.tar.bz2 |
Use new ColorPopupMenu and ColorDialog found in libopie
Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 7e6fc53..77fee98 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -15,4 +15,4 @@ | |||
15 | 15 | ||
16 | #include "colordialog.h" | 16 | //#include "colordialog.h" |
17 | #include "colorpanel.h" | 17 | //#include "colorpanel.h" |
18 | #include "drawpadcanvas.h" | 18 | #include "drawpadcanvas.h" |
@@ -35,2 +35,4 @@ | |||
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
36 | #include <opie/colordialog.h> | ||
37 | #include <opie/colorpopupmenu.h> | ||
36 | 38 | ||
@@ -218,19 +220,24 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
218 | 220 | ||
219 | QPopupMenu* penColorPopupMenu = new QPopupMenu(m_pPenColorToolButton); | 221 | ColorPopupMenu* colorPopupMenu = new ColorPopupMenu( Qt::black, m_pPenColorToolButton ); |
222 | m_pPenColorToolButton->setPopup( colorPopupMenu ); | ||
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& ) ) ); | ||
220 | 226 | ||
221 | ColorPanel* penColorPanel = new ColorPanel(penColorPopupMenu); | 227 | // QPopupMenu* penColorPopupMenu = new QPopupMenu(m_pPenColorToolButton); |
222 | connect(penColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); | ||
223 | 228 | ||
224 | penColorPopupMenu->insertItem(penColorPanel); | 229 | // ColorPanel* penColorPanel = new ColorPanel(penColorPopupMenu); |
225 | penColorPopupMenu->insertSeparator(); | 230 | // connect(penColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); |
226 | 231 | ||
227 | QAction* choosePenColorAction = new QAction(tr("More"), tr("More..."), 0, this); | 232 | // penColorPopupMenu->insertItem(penColorPanel); |
228 | connect(choosePenColorAction, SIGNAL(activated()), this, SLOT(choosePenColor())); | 233 | // penColorPopupMenu->insertSeparator(); |
229 | choosePenColorAction->addTo(penColorPopupMenu); | ||
230 | 234 | ||
231 | QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); | 235 | // QAction* choosePenColorAction = new QAction(tr("More"), tr("More..."), 0, this); |
232 | m_pPenColorToolButton->setPopup(penColorPopupMenu); | 236 | // connect(choosePenColorAction, SIGNAL(activated()), this, SLOT(choosePenColor())); |
233 | m_pPenColorToolButton->setPopupDelay(0); | 237 | // choosePenColorAction->addTo(penColorPopupMenu); |
238 | |||
239 | // m_pPenColorToolButton->setPopup(colorPopupMenu); | ||
240 | // m_pPenColorToolButton->setPopupDelay(0); | ||
234 | 241 | ||
235 | penColorPanel->buttonSelected(Qt::black); | 242 | // penColorPanel->buttonSelected(Qt::black); |
236 | 243 | ||
@@ -239,19 +246,25 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
239 | 246 | ||
240 | QPopupMenu* brushColorPopupMenu = new QPopupMenu(m_pBrushColorToolButton); | ||
241 | 247 | ||
242 | ColorPanel* brushColorPanel = new ColorPanel(brushColorPopupMenu); | 248 | colorPopupMenu = new ColorPopupMenu( Qt::white, m_pBrushColorToolButton ); |
243 | connect(brushColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); | 249 | m_pBrushColorToolButton->setPopup( colorPopupMenu ); |
250 | m_pBrushColorToolButton->setPopupDelay( 0 ); | ||
251 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); | ||
252 | connect( colorPopupMenu, SIGNAL( colorSelected( const QColor& ) ), this, SLOT( changeeBrushColor( const QColor& ) ) ); | ||
244 | 253 | ||
245 | brushColorPopupMenu->insertItem(brushColorPanel); | 254 | // QPopupMenu* brushColorPopupMenu = new QPopupMenu(m_pBrushColorToolButton); |
246 | brushColorPopupMenu->insertSeparator(); | ||
247 | 255 | ||
248 | QAction* chooseBrushColorAction = new QAction(tr("More"), tr("More..."), 0, this); | 256 | // ColorPanel* brushColorPanel = new ColorPanel(brushColorPopupMenu); |
249 | connect(chooseBrushColorAction, SIGNAL(activated()), this, SLOT(chooseBrushColor())); | 257 | // connect(brushColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); |
250 | chooseBrushColorAction->addTo(brushColorPopupMenu); | ||
251 | 258 | ||
252 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); | 259 | // brushColorPopupMenu->insertItem(brushColorPanel); |
253 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); | 260 | // brushColorPopupMenu->insertSeparator(); |
254 | m_pBrushColorToolButton->setPopupDelay(0); | ||
255 | 261 | ||
256 | brushColorPanel->buttonSelected(Qt::white); | 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 | |||
269 | // brushColorPanel->buttonSelected(Qt::white); | ||
257 | 270 | ||
@@ -488,14 +501,2 @@ void DrawPad::changeBrushColor(const QColor& color) | |||
488 | 501 | ||
489 | void DrawPad::choosePenColor() | ||
490 | { | ||
491 | QColor newPenColor = QColorDialog::getColor(m_pen.color()); | ||
492 | changePenColor(newPenColor); | ||
493 | } | ||
494 | |||
495 | void DrawPad::chooseBrushColor() | ||
496 | { | ||
497 | QColor newBrushColor = QColorDialog::getColor(m_brush.color()); | ||
498 | changeBrushColor(newBrushColor); | ||
499 | } | ||
500 | |||
501 | void DrawPad::updateUndoRedoToolButtons() | 502 | void DrawPad::updateUndoRedoToolButtons() |