diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 733a23afc..1fa7e7f43 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -341,7 +341,16 @@ void Widget::init() //restore window state restoreGeometry(Settings::getInstance().getWindowGeometry()); restoreState(Settings::getInstance().getWindowState()); - ui->mainSplitter->restoreState(Settings::getInstance().getSplitterState()); + if (!ui->mainSplitter->restoreState(Settings::getInstance().getSplitterState())) + { + // Set the status panel (friendlist) to a reasonnable width by default/on first start + constexpr int spWidthPc = 33; + ui->mainSplitter->resize(size()); + QList sizes = ui->mainSplitter->sizes(); + sizes[0] = ui->mainSplitter->width()*spWidthPc/100; + sizes[1] = ui->mainSplitter->width() - sizes[0]; + ui->mainSplitter->setSizes(sizes); + } connect(settingsWidget, &SettingsWidget::compactToggled, contactListWidget, &FriendListWidget::onCompactChanged); connect(settingsWidget, &SettingsWidget::groupchatPositionToggled, contactListWidget, &FriendListWidget::onGroupchatPositionChanged);