Skip to content

Commit 6f7ef8a

Browse files
authored
[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
1 parent 06f9842 commit 6f7ef8a

File tree

4 files changed

+1
-21
lines changed

4 files changed

+1
-21
lines changed

src/app/composer/qgscomposer.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,12 @@ QgsComposer::QgsComposer( QgsComposition *composition )
326326
QShortcut *ctrlEquals = new QShortcut( QKeySequence( QStringLiteral( "Ctrl+=" ) ), this );
327327
connect( ctrlEquals, &QShortcut::activated, mActionZoomIn, &QAction::trigger );
328328

329-
#ifndef Q_OS_MAC
330-
//disabled for OSX - see #10761
331-
//also see http://qt-project.org/forums/viewthread/3630 QGraphicsEffects are not well supported on OSX
332329
QMenu *previewMenu = viewMenu->addMenu( QStringLiteral( "&Preview" ) );
333330
previewMenu->addAction( mActionPreviewModeOff );
334331
previewMenu->addAction( mActionPreviewModeGrayscale );
335332
previewMenu->addAction( mActionPreviewModeMono );
336333
previewMenu->addAction( mActionPreviewProtanope );
337334
previewMenu->addAction( mActionPreviewDeuteranope );
338-
#endif
339335

340336
viewMenu->addSeparator();
341337
viewMenu->addAction( mActionZoomIn );

src/app/qgisapp.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,14 +2244,6 @@ void QgisApp::createMenus()
22442244
mSettingsMenu->insertSeparator( before );
22452245
}
22462246

2247-
2248-
#ifdef Q_OS_MAC
2249-
//disabled for OSX - see #10761
2250-
//also see http://qt-project.org/forums/viewthread/3630 QGraphicsEffects are not well supported on OSX
2251-
mMenuPreviewMode->menuAction()->setVisible( false );
2252-
#endif
2253-
2254-
22552247
#ifdef Q_OS_MAC
22562248

22572249
// keep plugins from hijacking About and Preferences application menus

src/gui/qgscolorbutton.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,14 +520,13 @@ void QgsColorButton::prepareMenu()
520520
mMenu->addAction( pasteColorAction );
521521
connect( pasteColorAction, &QAction::triggered, this, &QgsColorButton::pasteColor );
522522

523-
#ifndef Q_OS_MAC
524523
//disabled for OSX, as it is impossible to grab the mouse under OSX
525524
//see note for QWidget::grabMouse() re OSX Cocoa
526525
//http://qt-project.org/doc/qt-4.8/qwidget.html#grabMouse
527526
QAction *pickColorAction = new QAction( tr( "Pick color" ), this );
528527
mMenu->addAction( pickColorAction );
529528
connect( pickColorAction, &QAction::triggered, this, &QgsColorButton::activatePicker );
530-
#endif
529+
531530
QAction *chooseColorAction = new QAction( tr( "Choose color..." ), this );
532531
mMenu->addAction( chooseColorAction );
533532
connect( chooseColorAction, &QAction::triggered, this, &QgsColorButton::showColorDialog );

src/gui/qgscompoundcolorwidget.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,6 @@ QgsCompoundColorWidget::QgsCompoundColorWidget( QWidget *parent, const QColor &c
201201
int currentTab = settings.value( QStringLiteral( "Windows/ColorDialog/activeTab" ), 0 ).toInt();
202202
mTabWidget->setCurrentIndex( currentTab );
203203

204-
#ifdef Q_OS_MAC
205-
//disable color picker tab for OSX, as it is impossible to grab the mouse under OSX
206-
//see note for QWidget::grabMouse() re OSX Cocoa
207-
//http://qt-project.org/doc/qt-4.8/qwidget.html#grabMouse
208-
mTabWidget->removeTab( 3 );
209-
#endif
210-
211204
//setup connections
212205
connect( mColorBox, &QgsColorWidget::colorChanged, this, &QgsCompoundColorWidget::setColor );
213206
connect( mColorWheel, &QgsColorWidget::colorChanged, this, &QgsCompoundColorWidget::setColor );

0 commit comments

Comments
 (0)