Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Disable color picker under OSX, due to limitations with QWidget::grab…
- Loading branch information
Showing
with
8 additions
and
1 deletion.
-
+8
−1
src/gui/qgscolorbutton.cpp
|
@@ -312,9 +312,14 @@ void QgsColorButton::showContextMenu( QMouseEvent *event ) |
|
|
QAction* pasteColorAction = new QAction( tr( "Paste color" ), 0 ); |
|
|
pasteColorAction->setEnabled( false ); |
|
|
colorContextMenu.addAction( pasteColorAction ); |
|
|
#ifndef Q_WS_MAC |
|
|
//disabled for OSX, as it is impossible to grab the mouse under OSX |
|
|
//see note for QWidget::grabMouse() re OSX Cocoa |
|
|
//http://qt-project.org/doc/qt-4.8/qwidget.html#grabMouse |
|
|
QAction* pickColorAction = new QAction( tr( "Pick color" ), 0 ); |
|
|
colorContextMenu.addSeparator(); |
|
|
colorContextMenu.addAction( pickColorAction ); |
|
|
#endif |
|
|
|
|
|
QColor clipColor; |
|
|
if ( colorFromMimeData( QApplication::clipboard()->mimeData(), clipColor ) ) |
|
@@ -333,6 +338,7 @@ void QgsColorButton::showContextMenu( QMouseEvent *event ) |
|
|
//paste color |
|
|
setColor( clipColor ); |
|
|
} |
|
|
#ifndef Q_WS_MAC |
|
|
else if ( selectedAction == pickColorAction ) |
|
|
{ |
|
|
//pick color |
|
@@ -341,10 +347,11 @@ void QgsColorButton::showContextMenu( QMouseEvent *event ) |
|
|
grabMouse(); |
|
|
mPickingColor = true; |
|
|
} |
|
|
delete pickColorAction; |
|
|
#endif |
|
|
|
|
|
delete copyColorAction; |
|
|
delete pasteColorAction; |
|
|
delete pickColorAction; |
|
|
} |
|
|
|
|
|
void QgsColorButton::setValidColor( const QColor& newColor ) |
|
|