-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 77 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.h | 4 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.pro | 10 |
3 files changed, 43 insertions, 48 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 @@ -#include "colordialog.h" -#include "colorpanel.h" +//#include "colordialog.h" +//#include "colorpanel.h" #include "drawpadcanvas.h" @@ -35,2 +35,4 @@ #include <qpe/resource.h> +#include <opie/colordialog.h> +#include <opie/colorpopupmenu.h> @@ -218,19 +220,24 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - QPopupMenu* penColorPopupMenu = new QPopupMenu(m_pPenColorToolButton); + ColorPopupMenu* colorPopupMenu = new ColorPopupMenu( Qt::black, m_pPenColorToolButton ); + m_pPenColorToolButton->setPopup( colorPopupMenu ); + m_pPenColorToolButton->setPopupDelay( 0 ); + QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); + connect( colorPopupMenu, SIGNAL( colorSelected( const QColor& ) ), this, SLOT( changePenColor( const QColor& ) ) ); - ColorPanel* penColorPanel = new ColorPanel(penColorPopupMenu); - connect(penColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); +// QPopupMenu* penColorPopupMenu = new QPopupMenu(m_pPenColorToolButton); - penColorPopupMenu->insertItem(penColorPanel); - penColorPopupMenu->insertSeparator(); +// ColorPanel* penColorPanel = new ColorPanel(penColorPopupMenu); +// connect(penColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); - QAction* choosePenColorAction = new QAction(tr("More"), tr("More..."), 0, this); - connect(choosePenColorAction, SIGNAL(activated()), this, SLOT(choosePenColor())); - choosePenColorAction->addTo(penColorPopupMenu); +// penColorPopupMenu->insertItem(penColorPanel); +// penColorPopupMenu->insertSeparator(); - QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); - m_pPenColorToolButton->setPopup(penColorPopupMenu); - m_pPenColorToolButton->setPopupDelay(0); +// QAction* choosePenColorAction = new QAction(tr("More"), tr("More..."), 0, this); +// connect(choosePenColorAction, SIGNAL(activated()), this, SLOT(choosePenColor())); +// choosePenColorAction->addTo(penColorPopupMenu); - penColorPanel->buttonSelected(Qt::black); +// m_pPenColorToolButton->setPopup(colorPopupMenu); +// m_pPenColorToolButton->setPopupDelay(0); + +// penColorPanel->buttonSelected(Qt::black); @@ -239,19 +246,25 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - QPopupMenu* brushColorPopupMenu = new QPopupMenu(m_pBrushColorToolButton); - ColorPanel* brushColorPanel = new ColorPanel(brushColorPopupMenu); - connect(brushColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); + colorPopupMenu = new ColorPopupMenu( Qt::white, m_pBrushColorToolButton ); + m_pBrushColorToolButton->setPopup( colorPopupMenu ); + m_pBrushColorToolButton->setPopupDelay( 0 ); + QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); + connect( colorPopupMenu, SIGNAL( colorSelected( const QColor& ) ), this, SLOT( changeeBrushColor( const QColor& ) ) ); - brushColorPopupMenu->insertItem(brushColorPanel); - brushColorPopupMenu->insertSeparator(); +// QPopupMenu* brushColorPopupMenu = new QPopupMenu(m_pBrushColorToolButton); - QAction* chooseBrushColorAction = new QAction(tr("More"), tr("More..."), 0, this); - connect(chooseBrushColorAction, SIGNAL(activated()), this, SLOT(chooseBrushColor())); - chooseBrushColorAction->addTo(brushColorPopupMenu); +// ColorPanel* brushColorPanel = new ColorPanel(brushColorPopupMenu); +// connect(brushColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); - QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); - m_pBrushColorToolButton->setPopup(brushColorPopupMenu); - m_pBrushColorToolButton->setPopupDelay(0); +// brushColorPopupMenu->insertItem(brushColorPanel); +// brushColorPopupMenu->insertSeparator(); + +// QAction* chooseBrushColorAction = new QAction(tr("More"), tr("More..."), 0, this); +// connect(chooseBrushColorAction, SIGNAL(activated()), this, SLOT(chooseBrushColor())); +// chooseBrushColorAction->addTo(brushColorPopupMenu); + +// m_pBrushColorToolButton->setPopup(brushColorPopupMenu); +// m_pBrushColorToolButton->setPopupDelay(0); - brushColorPanel->buttonSelected(Qt::white); +// brushColorPanel->buttonSelected(Qt::white); @@ -488,14 +501,2 @@ void DrawPad::changeBrushColor(const QColor& color) -void DrawPad::choosePenColor() -{ - QColor newPenColor = QColorDialog::getColor(m_pen.color()); - changePenColor(newPenColor); -} - -void DrawPad::chooseBrushColor() -{ - QColor newBrushColor = QColorDialog::getColor(m_brush.color()); - changeBrushColor(newBrushColor); -} - void DrawPad::updateUndoRedoToolButtons() 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 @@ -29,3 +29,3 @@ class QWidgetStack; class DrawPad : public QMainWindow -{ +{ Q_OBJECT @@ -54,4 +54,2 @@ private slots: void changeBrushColor(const QColor& color); - void choosePenColor(); - void chooseBrushColor(); 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 @@ -2,5 +2,3 @@ TEMPLATE = app CONFIG = qt warn_on release -HEADERS = colordialog.h \ - colorpanel.h \ - drawpad.h \ +HEADERS = drawpad.h \ drawpadcanvas.h \ @@ -20,5 +18,3 @@ HEADERS = colordialog.h \ tool.h -SOURCES = colordialog.cpp \ - colorpanel.cpp \ - drawpad.cpp \ +SOURCES = drawpad.cpp \ drawpadcanvas.cpp \ @@ -42,3 +38,3 @@ INCLUDEPATH += $(OPIEDIR)/include \ DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe +LIBS += -lqpe -lopie DESTDIR = $(OPIEDIR)/bin |