Skip to content

Commit

Permalink
[Style dock] Set open button as toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Apr 20, 2016
1 parent 142ce5e commit 5d0be31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -2763,9 +2763,11 @@ void QgisApp::initLayerTreeView()
connect( mLegendExpressionFilterButton, SIGNAL( toggled( bool ) ), this, SLOT( toggleFilterLegendByExpression( bool ) ) );

mActionStyleDock = new QAction( tr( "Map Styling" ), this );
mActionStyleDock->setCheckable( true );
mActionStyleDock->setToolTip( tr( "Open the map styling dock" ) );
mActionStyleDock->setIcon( QgsApplication::getThemeIcon( "propertyicons/symbology.png" ) );
connect( mActionStyleDock, SIGNAL( triggered() ), this, SLOT( mapStyleDock() ) );
connect( mActionStyleDock, SIGNAL( toggled( bool ) ), this, SLOT( mapStyleDock( bool ) ) );
connect( mMapStylingDock, SIGNAL( visibilityChanged(bool) ), mActionStyleDock, SLOT( setChecked(bool) ) );

// expand / collapse tool buttons
QAction* actionExpandAll = new QAction( tr( "Expand All" ), this );
Expand Down Expand Up @@ -5487,7 +5489,7 @@ void QgisApp::labeling()
return;
}

mapStyleDock();
mapStyleDock( true );
}

void QgisApp::setMapStyleDockLayer( QgsMapLayer* layer )
Expand All @@ -5505,9 +5507,9 @@ void QgisApp::setMapStyleDockLayer( QgsMapLayer* layer )
mMapStyleWidget->setLayer( layer );
}

void QgisApp::mapStyleDock()
void QgisApp::mapStyleDock( bool enabled )
{
mMapStylingDock->show();
mMapStylingDock->setVisible( enabled );
setMapStyleDockLayer( activeLayer() );
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.h
Expand Up @@ -1170,7 +1170,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void labeling();

//! shows the map styling dock
void mapStyleDock();
void mapStyleDock(bool enabled);

//! diagrams properties
void diagramProperties();
Expand Down

0 comments on commit 5d0be31

Please sign in to comment.