Skip to content
Permalink
Browse files

Fix 3d tab is not activated when reopening vector layer properties

Fixes #35011
  • Loading branch information
nyalldawson committed Jun 9, 2020
1 parent 0f3525d commit 3c0ecbfd79e1924cd01143324cdc26fe4a68f748
@@ -64,6 +64,13 @@ Restore the base ui.
Sometimes useful to do at end of subclass's constructor.

:param title: the window title (it does not need to be defined if previously given to initOptionsBase();
%End

void restoreLastPage();
%Docstring
Refocus the active tab from the last time the dialog was shown.

.. versionadded:: 3.14
%End

void resizeAlltabs( int index );

if ( !page.isEmpty() )
vectorLayerPropertiesDialog->setCurrentPage( page );
else
vectorLayerPropertiesDialog->restoreLastPage();

mMapStyleWidget->blockUpdates( true );
if ( vectorLayerPropertiesDialog->exec() )
@@ -182,6 +182,15 @@ void QgsOptionsDialogBase::restoreOptionsBaseUi( const QString &title )
mOptListWidget->setMaximumWidth(
mSettings->value( QStringLiteral( "/Windows/%1/splitState" ).arg( mOptsKey ) ).isNull() ? 150 : 16777215 );
mOptSplitter->restoreState( mSettings->value( QStringLiteral( "/Windows/%1/splitState" ).arg( mOptsKey ) ).toByteArray() );

restoreLastPage();

// get rid of annoying outer focus rect on Mac
mOptListWidget->setAttribute( Qt::WA_MacShowFocusRect, false );
}

void QgsOptionsDialogBase::restoreLastPage()
{
int curIndx = mSettings->value( QStringLiteral( "/Windows/%1/tab" ).arg( mOptsKey ), 0 ).toInt();

// if the last used tab is out of range or not enabled display the first enabled one
@@ -204,9 +213,6 @@ void QgsOptionsDialogBase::restoreOptionsBaseUi( const QString &title )
mOptStackedWidget->setCurrentIndex( curIndx );
mOptListWidget->setCurrentRow( curIndx );
}

// get rid of annoying outer focus rect on Mac
mOptListWidget->setAttribute( Qt::WA_MacShowFocusRect, false );
}

void QgsOptionsDialogBase::resizeAlltabs( int index )
@@ -91,6 +91,13 @@ class GUI_EXPORT QgsOptionsDialogBase : public QDialog
*/
void restoreOptionsBaseUi( const QString &title = QString() );

/**
* Refocus the active tab from the last time the dialog was shown.
*
* \since QGIS 3.14
*/
void restoreLastPage();

/**
* Resizes all tabs when the dialog is resized
* \param index current tab index

0 comments on commit 3c0ecbf

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