Commit 19712a1d authored by Scott Harvey's avatar Scott Harvey
Browse files

Enlarge default window size. Use (adjusted) calculation in `SizeHint` to...

Enlarge default window size. Use (adjusted) calculation in `SizeHint` to determine minimum window width.

Call `setMinimumSize()` at each run to enforce a minimum size. Any enlarged size will be saved and restored via the customary method of saving window geometry.

BUG: 389617

Test Plan:
- Compile systemsettings with patch
- Launch system settings (systemsettings5)
- Determine that window opens at an appropriate size.
- Close System Settings and reopen; ensure size remains set

To test small or rotated screen sizes:
- Adjust display resolution to a size smaller than the standard target of 1024x700
- System settings window should launch with a margin on all sides (not monopolize entire screen space)

Reviewers: ngraham, mart, davidedmundson, hein, #plasma

Reviewed By: ngraham, davidedmundson, hein, #plasma

Subscribers: davidedmundson, cfeck, zzag, plasma-devel

Tags: #plasma

Differential Revision:
parent bf1cd7ec
......@@ -78,9 +78,12 @@ SettingsBase::~SettingsBase()
QSize SettingsBase::sizeHint() const
qreal factor = qBound(1., QGuiApplication::primaryScreen()->physicalDotsPerInch()/96., 3.);
return QSize(720*factor, 600*factor);
// on smaller or portrait-rotated screens, do not max out height and/or width
const QSize screenSize = (QGuiApplication::primaryScreen()->availableSize()*0.9);
const QSize targetSize = QSize(1024, 700);
return targetSize.boundedTo(screenSize);
void SettingsBase::initApplication()
......@@ -124,6 +127,9 @@ void SettingsBase::initApplication()
searchText->completionObject()->setIgnoreCase( true );
searchText->completionObject()->setItems( BaseData::instance()->menuItem()->keywords() );
// enforce minimum window size
......@@ -156,7 +162,6 @@ void SettingsBase::initToolBar()
// Toolbar & Configuration
helpActionMenu->setMenu( dynamic_cast<QMenu*>( factory()->container(QStringLiteral("help"), this) ) );
toolBar()->setMovable(false); // We don't allow any changes
changeToolBar( BaseMode::Search | BaseMode::Configure );
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment