From f1d68a4d30333aac40790fe910f44698f9052a17 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Tue, 30 Jan 2024 19:49:29 +0100 Subject: [PATCH] #2950 fix: try to fix automatic resizing --- CHANGELOG.md | 3 +++ src/dialogs/settingsdialog.cpp | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54ca6f5224..6f2654b108 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # QOwnNotes Changelog ## 24.1.5 +- an attempt was made to fix the issue that shortcut settings table columns + didn't get resized to fit the containing text on some computers + (for [#2950](https://github.com/pbek/QOwnNotes/issues/2950)) - the Snap version of QOwnNotes is now able to use git (for [#1306](https://github.com/pbek/QOwnNotes/issues/1306)) diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index d64ec1b747..6d8be0883b 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -1612,10 +1612,6 @@ void SettingsDialog::loadShortcutSettings() { menuItem->setExpanded(true); } } - - ui->shortcutTreeWidget->resizeColumnToContents(0); - ui->shortcutTreeWidget->resizeColumnToContents(1); - ui->shortcutTreeWidget->resizeColumnToContents(2); } /** @@ -3264,8 +3260,15 @@ void SettingsDialog::on_settingsTreeWidget_currentItemChanged(QTreeWidgetItem *c ui->settingsStackedWidget->setCurrentIndex(currentIndex); - if (currentIndex == SettingsPages::LayoutPage) { - ui->layoutWidget->resizeLayoutImage(); + switch (currentIndex) { + case SettingsPages::LayoutPage: + ui->layoutWidget->resizeLayoutImage(); + break; + case SettingsPages::ShortcutPage: + ui->shortcutTreeWidget->resizeColumnToContents(0); + ui->shortcutTreeWidget->resizeColumnToContents(1); + ui->shortcutTreeWidget->resizeColumnToContents(2); + break; } }