From 713aa4385e859c9300ee2a5b0086fbaabf3b3a33 Mon Sep 17 00:00:00 2001 From: leseb Date: Tue, 30 Apr 2002 08:54:28 +0000 Subject: Clean code + fix 2 new introduced bugs --- (limited to 'noncore/graphics/drawpad') 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 @@ #include "drawpad.h" -//#include "colordialog.h" -//#include "colorpanel.h" #include "drawpadcanvas.h" #include "ellipsetool.h" #include "erasetool.h" @@ -28,13 +26,14 @@ #include "rectangletool.h" #include "texttool.h" +#include +#include + #include #include #include #include #include -#include -#include #include #include @@ -218,55 +217,26 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pPenColorToolButton = new QToolButton(drawParametersToolBar); m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor.png")); - 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& ) ) ); - -// QPopupMenu* penColorPopupMenu = new QPopupMenu(m_pPenColorToolButton); - -// ColorPanel* penColorPanel = new ColorPanel(penColorPopupMenu); -// connect(penColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); + ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, m_pPenColorToolButton); + connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); -// penColorPopupMenu->insertItem(penColorPanel); -// penColorPopupMenu->insertSeparator(); - -// QAction* choosePenColorAction = new QAction(tr("More"), tr("More..."), 0, this); -// connect(choosePenColorAction, SIGNAL(activated()), this, SLOT(choosePenColor())); -// choosePenColorAction->addTo(penColorPopupMenu); - -// m_pPenColorToolButton->setPopup(colorPopupMenu); -// m_pPenColorToolButton->setPopupDelay(0); + QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); + m_pPenColorToolButton->setPopup(penColorPopupMenu); + m_pPenColorToolButton->setPopupDelay(0); -// penColorPanel->buttonSelected(Qt::black); + changePenColor(Qt::black); m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor.png")); + ColorPopupMenu* brushColorPopupMenu = new ColorPopupMenu(Qt::white, m_pBrushColorToolButton); + connect(brushColorPopupMenu, 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& ) ) ); - -// QPopupMenu* brushColorPopupMenu = new QPopupMenu(m_pBrushColorToolButton); - -// ColorPanel* brushColorPanel = new ColorPanel(brushColorPopupMenu); -// connect(brushColorPanel, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); - -// 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); + m_pBrushColorToolButton->setPopup(brushColorPopupMenu); + m_pBrushColorToolButton->setPopupDelay(0); -// brushColorPanel->buttonSelected(Qt::white); + changeBrushColor(Qt::white); // init pages -- cgit v0.9.0.2