OSDN Git Service

QmlJSDebugger: Removed the double-click feature from the color box
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Thu, 17 Mar 2011 14:28:20 +0000 (15:28 +0100)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Thu, 17 Mar 2011 14:43:10 +0000 (15:43 +0100)
It was supposed to show a color dialog, but in practice it never worked
due to using show() rather than exec(). Removed it completely since it
was judged confusing and not very useful, since it is already possible
to copy the color by using the context menu.

Task-number: QTCREATORBUG-3878
Reviewed-by: Kai Koehne
share/qtcreator/qml/qmljsdebugger/editor/toolbarcolorbox.cpp
share/qtcreator/qml/qmljsdebugger/editor/toolbarcolorbox.h
src/plugins/qmljsinspector/qmljstoolbarcolorbox.cpp
src/plugins/qmljsinspector/qmljstoolbarcolorbox.h

index d5ada6c..55ee2a6 100644 (file)
@@ -53,7 +53,7 @@ ToolBarColorBox::ToolBarColorBox(QWidget *parent) :
     QLabel(parent)
 {
     m_copyHexColor = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")),
-                                 tr("Copy"), this);
+                                 tr("Copy Color"), this);
     connect(m_copyHexColor, SIGNAL(triggered()), SLOT(copyColorToClipboard()));
     setScaledContents(false);
 }
@@ -116,12 +116,6 @@ void ToolBarColorBox::contextMenuEvent(QContextMenuEvent *ev)
     contextMenu.exec(ev->globalPos());
 }
 
-void ToolBarColorBox::mouseDoubleClickEvent(QMouseEvent *)
-{
-    QColorDialog dialog(m_color);
-    dialog.show();
-}
-
 void ToolBarColorBox::copyColorToClipboard()
 {
     QClipboard *clipboard = QApplication::clipboard();
index cea0e6e..c9ab667 100644 (file)
@@ -52,7 +52,6 @@ public:
 
 protected:
     void contextMenuEvent(QContextMenuEvent *ev);
-    void mouseDoubleClickEvent(QMouseEvent *);
     void mousePressEvent(QMouseEvent *ev);
     void mouseMoveEvent(QMouseEvent *ev);
 private slots:
index 6c15218..f83aa71 100644 (file)
@@ -124,17 +124,10 @@ void ToolBarColorBox::contextMenuEvent(QContextMenuEvent *ev)
     contextMenu.exec(ev->globalPos());
 }
 
-void ToolBarColorBox::mouseDoubleClickEvent(QMouseEvent *)
-{
-    QColorDialog dialog(m_color);
-    dialog.show();
-}
-
 void ToolBarColorBox::copyColorToClipboard()
 {
     QClipboard *clipboard = QApplication::clipboard();
     clipboard->setText(m_color.name());
 }
 
-
 } // namespace QmlJSInspector
index 16842fe..d53e28b 100644 (file)
@@ -53,7 +53,6 @@ public:
 
 protected:
     void contextMenuEvent(QContextMenuEvent *ev);
-    void mouseDoubleClickEvent(QMouseEvent *);
     void mousePressEvent(QMouseEvent *ev);
     void mouseMoveEvent(QMouseEvent *ev);
 private slots: