summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/drawpad/drawpad.cpp77
-rw-r--r--noncore/graphics/drawpad/drawpad.h2
-rw-r--r--noncore/graphics/drawpad/drawpad.pro10
3 files changed, 42 insertions, 47 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
@@ -14,6 +14,6 @@
14#include "drawpad.h" 14#include "drawpad.h"
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"
19#include "ellipsetool.h" 19#include "ellipsetool.h"
@@ -34,4 +34,6 @@
34#include <qpe/qpetoolbar.h> 34#include <qpe/qpetoolbar.h>
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36#include <opie/colordialog.h>
37#include <opie/colorpopupmenu.h>
36 38
37#include <qaction.h> 39#include <qaction.h>
@@ -217,42 +219,53 @@ DrawPad::DrawPad(QWidget* parent, const char* name)
217 m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor.png")); 219 m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor.png"));
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
237 m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); 244 m_pBrushColorToolButton = new QToolButton(drawParametersToolBar);
238 m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor.png")); 245 m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor.png"));
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
258 // init pages 271 // init pages
@@ -487,16 +500,4 @@ void DrawPad::changeBrushColor(const QColor& color)
487} 500}
488 501
489void DrawPad::choosePenColor()
490{
491 QColor newPenColor = QColorDialog::getColor(m_pen.color());
492 changePenColor(newPenColor);
493}
494
495void DrawPad::chooseBrushColor()
496{
497 QColor newBrushColor = QColorDialog::getColor(m_brush.color());
498 changeBrushColor(newBrushColor);
499}
500
501void DrawPad::updateUndoRedoToolButtons() 502void DrawPad::updateUndoRedoToolButtons()
502{ 503{
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h
index e4fd831..0dcd5c9 100644
--- a/noncore/graphics/drawpad/drawpad.h
+++ b/noncore/graphics/drawpad/drawpad.h
@@ -53,6 +53,4 @@ private slots:
53 void changePenColor(const QColor& color); 53 void changePenColor(const QColor& color);
54 void changeBrushColor(const QColor& color); 54 void changeBrushColor(const QColor& color);
55 void choosePenColor();
56 void chooseBrushColor();
57 55
58 void updateUndoRedoToolButtons(); 56 void updateUndoRedoToolButtons();
diff --git a/noncore/graphics/drawpad/drawpad.pro b/noncore/graphics/drawpad/drawpad.pro
index 00eb00d..3b120c9 100644
--- a/noncore/graphics/drawpad/drawpad.pro
+++ b/noncore/graphics/drawpad/drawpad.pro
@@ -1,7 +1,5 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 HEADERS = colordialog.h \ 3 HEADERS = drawpad.h \
4 colorpanel.h \
5 drawpad.h \
6 drawpadcanvas.h \ 4 drawpadcanvas.h \
7 ellipsetool.h \ 5 ellipsetool.h \
@@ -19,7 +17,5 @@ HEADERS = colordialog.h \
19 texttool.h \ 17 texttool.h \
20 tool.h 18 tool.h
21 SOURCES = colordialog.cpp \ 19 SOURCES = drawpad.cpp \
22 colorpanel.cpp \
23 drawpad.cpp \
24 drawpadcanvas.cpp \ 20 drawpadcanvas.cpp \
25 ellipsetool.cpp \ 21 ellipsetool.cpp \
@@ -41,5 +37,5 @@ INCLUDEPATH += $(OPIEDIR)/include \
41 $(QTDIR)/src/3rdparty/zlib 37 $(QTDIR)/src/3rdparty/zlib
42 DEPENDPATH+= $(OPIEDIR)/include 38 DEPENDPATH+= $(OPIEDIR)/include
43 LIBS += -lqpe 39 LIBS += -lqpe -lopie
44 DESTDIR = $(OPIEDIR)/bin 40 DESTDIR = $(OPIEDIR)/bin
45 TARGET = drawpad 41 TARGET = drawpad