Skip to content

Commit

Permalink
Resize the news feed splitter if we can and grow it to 50% if it is zero
Browse files Browse the repository at this point in the history
(cherry picked from commit 2a988e8)
  • Loading branch information
timlinux authored and nyalldawson committed Sep 11, 2020
1 parent 4362353 commit bf6266d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -11129,6 +11129,8 @@ void QgisApp::showOptionsDialog( QWidget *parent, const QString &currentPage, in
double factor = mySettings.value( QStringLiteral( "qgis/magnifier_factor_default" ), 1.0 ).toDouble();
mMagnifierWidget->setDefaultFactor( factor );
mMagnifierWidget->updateMagnification( factor );

mWelcomePage->updateNewsFeedVisibility();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsoptions.cpp
Expand Up @@ -666,7 +666,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mSimplifyAlgorithmComboBox->addItem( tr( "Visvalingam" ), static_cast<int>( QgsVectorSimplifyMethod::Visvalingam ) );
mSimplifyAlgorithmComboBox->setCurrentIndex( mSimplifyAlgorithmComboBox->findData( mSettings->enumValue( QStringLiteral( "/qgis/simplifyAlgorithm" ), QgsVectorSimplifyMethod::NoSimplification ) ) );

// Slightly awkard here at the settings value is true to use QImage,
// Slightly awkward here at the settings value is true to use QImage,
// but the checkbox is true to use QPixmap
chkAddedVisibility->setChecked( mSettings->value( QStringLiteral( "/qgis/new_layers_visible" ), true ).toBool() );
cbxLegendClassifiers->setChecked( mSettings->value( QStringLiteral( "/qgis/showLegendClassifiers" ), false ).toBool() );
Expand Down
7 changes: 5 additions & 2 deletions src/app/qgswelcomepage.cpp
Expand Up @@ -438,8 +438,11 @@ void QgsWelcomePage::updateNewsFeedVisibility()
else
{
mSplitter2->restoreState( QgsSettings().value( QStringLiteral( "Windows/WelcomePage/SplitState2" ), QVariant(), QgsSettings::App ).toByteArray() );
int splitSize = mSplitter2->height() / 2;
mSplitter2->setSizes( QList< int > { splitSize, splitSize} );
if ( mSplitter2->sizes().first() == 0 )
{
int splitSize = mSplitter2->height() / 2;
mSplitter2->setSizes( QList< int > { splitSize, splitSize} );
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/app/qgswelcomepage.h
Expand Up @@ -63,6 +63,8 @@ class QgsWelcomePage : public QWidget
void showContextMenuForProjects( QPoint point );
void showContextMenuForTemplates( QPoint point );
void showContextMenuForNews( QPoint point );

public slots:
void updateNewsFeedVisibility();

private:
Expand Down

0 comments on commit bf6266d

Please sign in to comment.