Skip to content

Commit

Permalink
[FEATURE] Colourblind preview modes now work on OSX (#4971)
Browse files Browse the repository at this point in the history
* [FEATURE] Colourblind preview modes now work on OSX

* Enable colour picker widgets on Mac OS and colour preview modes in composer in Mac OS
  • Loading branch information
timlinux authored Aug 6, 2017
1 parent 06f9842 commit 6f7ef8a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 21 deletions.
4 changes: 0 additions & 4 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
8 changes: 0 additions & 8 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/gui/qgscolorbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
7 changes: 0 additions & 7 deletions src/gui/qgscompoundcolorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 6f7ef8a

Please sign in to comment.