Skip to content
Permalink
Browse files

[Style dock] Move layer label inside widget

  • Loading branch information
NathanW2 committed Apr 20, 2016
1 parent 57d4dbf commit 1e5c99206f89dc60fb6fa5efee9f62433256049e
Showing with 11 additions and 2 deletions.
  1. +0 −2 src/app/qgisapp.cpp
  2. +9 −0 src/app/qgsmapstylingwidget.cpp
  3. +2 −0 src/app/qgsmapstylingwidget.h
@@ -5503,8 +5503,6 @@ void QgisApp::setMapStyleDockLayer( QgsMapLayer* layer )
// the extra work if it's not needed
if ( mMapStylingDock->isVisible() )
mMapStyleWidget->setLayer( layer );

mMapStylingDock->setWindowTitle( tr( "Map Styling - %1" ).arg( layer->name() ) );
}

void QgisApp::mapStyleDock()
@@ -23,6 +23,9 @@ QgsMapStylingWidget::QgsMapStylingWidget( QgsMapCanvas* canvas, QWidget *parent
mNotSupportedPage = mStackedWidget->addWidget( new QLabel( "Not supported currently" ) );
mVectorPage = mStackedWidget->addWidget( mMapStyleTabs );

mLayerTitleLabel = new QLabel();
mLayerTitleLabel->setAlignment( Qt::AlignHCenter );
layout->addWidget( mLayerTitleLabel );
layout->addWidget( mStackedWidget );
mButtonBox = new QDialogButtonBox( QDialogButtonBox::Reset | QDialogButtonBox::Apply );
mLiveApplyCheck = new QCheckBox( "Live update" );
@@ -58,10 +61,16 @@ QgsMapStylingWidget::QgsMapStylingWidget( QgsMapCanvas* canvas, QWidget *parent
void QgsMapStylingWidget::setLayer( QgsMapLayer *layer )
{
if ( !layer )
{
mLayerTitleLabel->setText( "" );
mStackedWidget->setCurrentIndex( mNotSupportedPage );
return;
}

mBlockAutoApply = true;

mLayerTitleLabel->setText( layer->name() );

mCurrentLayer = layer;

if ( layer->type() == QgsMapLayer::VectorLayer )
@@ -2,6 +2,7 @@
#define QGSMAPSTYLESDOCK_H

#include <QWidget>
#include <QLabel>
#include <QTabWidget>
#include <QStackedWidget>
#include <QDialogButtonBox>
@@ -34,6 +35,7 @@ class APP_EXPORT QgsMapStylingWidget : public QWidget
int mLabelTabIndex;
QgsMapCanvas* mMapCanvas;
bool mBlockAutoApply;
QLabel* mLayerTitleLabel;
QgsMapLayer* mCurrentLayer;
QStackedWidget* mStackedWidget;
QTabWidget *mMapStyleTabs;

0 comments on commit 1e5c992

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