Compare commits

...

2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
ef0065a49c MainWindow: Save tab mode immediately when changed
The sidebar mode (tabs on top, large sidebar, etc.) was only being saved
when the application exits normally. This caused the setting to be lost
if the application crashed or was force-closed, reverting to the default
"Large Sidebar" mode on next startup.

This fix connects the FancyTabWidget::ModeChanged signal to immediately
save the tab_mode setting when the user changes it via the context menu.

Fixes issue where sidebar keeps periodically reverting to Large mode.

Co-authored-by: jonaski <10343810+jonaski@users.noreply.github.com>
2026-01-03 15:34:55 +00:00
copilot-swe-agent[bot]
28fb5a863c Initial plan 2026-01-03 15:12:21 +00:00

View File

@@ -447,6 +447,14 @@ MainWindow::MainWindow(Application *app,
ui_->tabs->SetBackgroundPixmap(QPixmap(u":/pictures/sidebar-background.png"_s));
ui_->tabs->LoadSettings(QLatin1String(MainWindowSettings::kSettingsGroup));
// Save tab mode immediately when changed to avoid losing the setting
QObject::connect(ui_->tabs, &FancyTabWidget::ModeChanged, this, [this](FancyTabWidget::Mode mode) {
Settings s;
s.beginGroup(MainWindowSettings::kSettingsGroup);
s.setValue("tab_mode", static_cast<int>(mode));
s.endGroup();
});
track_position_timer_->setInterval(kTrackPositionUpdateTimeMs);
QObject::connect(track_position_timer_, &QTimer::timeout, this, &MainWindow::UpdateTrackPosition);
track_slider_timer_->setInterval(kTrackSliderUpdateTimeMs);