[FEATURE] Colourblind preview modes now work on OSX (#4971)

* [FEATURE] Colourblind preview modes now work on OSX

* Enable colour picker widgets on Mac OS and colour preview modes in composer in Mac OS
This commit is contained in:
Tim Sutton 2017-08-06 14:31:36 +02:00 committed by GitHub
parent 06f9842637
commit 6f7ef8ac2e
4 changed files with 1 additions and 21 deletions

View File

@ -326,16 +326,12 @@ QgsComposer::QgsComposer( QgsComposition *composition )
QShortcut *ctrlEquals = new QShortcut( QKeySequence( QStringLiteral( "Ctrl+=" ) ), this );
connect( ctrlEquals, &QShortcut::activated, mActionZoomIn, &QAction::trigger );
#ifndef Q_OS_MAC
//disabled for OSX - see #10761
//also see http://qt-project.org/forums/viewthread/3630 QGraphicsEffects are not well supported on OSX
QMenu *previewMenu = viewMenu->addMenu( QStringLiteral( "&Preview" ) );
previewMenu->addAction( mActionPreviewModeOff );
previewMenu->addAction( mActionPreviewModeGrayscale );
previewMenu->addAction( mActionPreviewModeMono );
previewMenu->addAction( mActionPreviewProtanope );
previewMenu->addAction( mActionPreviewDeuteranope );
#endif
viewMenu->addSeparator();
viewMenu->addAction( mActionZoomIn );

View File

@ -2244,14 +2244,6 @@ void QgisApp::createMenus()
mSettingsMenu->insertSeparator( before );
}
#ifdef Q_OS_MAC
//disabled for OSX - see #10761
//also see http://qt-project.org/forums/viewthread/3630 QGraphicsEffects are not well supported on OSX
mMenuPreviewMode->menuAction()->setVisible( false );
#endif
#ifdef Q_OS_MAC
// keep plugins from hijacking About and Preferences application menus

View File

@ -520,14 +520,13 @@ void QgsColorButton::prepareMenu()
mMenu->addAction( pasteColorAction );
connect( pasteColorAction, &QAction::triggered, this, &QgsColorButton::pasteColor );
#ifndef Q_OS_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" ), this );
mMenu->addAction( pickColorAction );
connect( pickColorAction, &QAction::triggered, this, &QgsColorButton::activatePicker );
#endif
QAction *chooseColorAction = new QAction( tr( "Choose color..." ), this );
mMenu->addAction( chooseColorAction );
connect( chooseColorAction, &QAction::triggered, this, &QgsColorButton::showColorDialog );

View File

@ -201,13 +201,6 @@ QgsCompoundColorWidget::QgsCompoundColorWidget( QWidget *parent, const QColor &c
int currentTab = settings.value( QStringLiteral( "Windows/ColorDialog/activeTab" ), 0 ).toInt();
mTabWidget->setCurrentIndex( currentTab );
#ifdef Q_OS_MAC
//disable color picker tab 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
mTabWidget->removeTab( 3 );
#endif
//setup connections
connect( mColorBox, &QgsColorWidget::colorChanged, this, &QgsCompoundColorWidget::setColor );
connect( mColorWheel, &QgsColorWidget::colorChanged, this, &QgsCompoundColorWidget::setColor );