Skip to content
Permalink
Browse files

[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
  • Loading branch information
timlinux committed Aug 6, 2017
1 parent 06f9842 commit 6f7ef8ac2ec63b7313e3e85b2911cdd7ba699cd9
Showing with 1 addition and 21 deletions.
  1. +0 −4 src/app/composer/qgscomposer.cpp
  2. +0 −8 src/app/qgisapp.cpp
  3. +1 −2 src/gui/qgscolorbutton.cpp
  4. +0 −7 src/gui/qgscompoundcolorwidget.cpp
@@ -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 );
@@ -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
@@ -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 );
@@ -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 );

0 comments on commit 6f7ef8a

Please sign in to comment.
You can’t perform that action at this time.