From d824d04d127034c2a0b682edeab90501478d6f87 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 17 Aug 2021 08:17:44 +0200 Subject: [PATCH] try to fix problems related to errorneous saving of message list header state --- src/librssguard/gui/messagesview.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librssguard/gui/messagesview.cpp b/src/librssguard/gui/messagesview.cpp index 430611c43..c609ed4c4 100644 --- a/src/librssguard/gui/messagesview.cpp +++ b/src/librssguard/gui/messagesview.cpp @@ -89,7 +89,10 @@ void MessagesView::restoreHeaderState(const QByteArray& data) { inn >> ss; inn >> ish; - header()->swapSections(header()->visualIndex(i), vi); + if (vi < header()->count()) { + header()->swapSections(header()->visualIndex(i), vi); + } + header()->resizeSection(i, ss); header()->setSectionHidden(i, ish); } @@ -204,6 +207,7 @@ void MessagesView::setupAppearance() { setItemDelegate(new StyledItemDelegateWithoutFocus(this)); header()->setDefaultSectionSize(MESSAGES_VIEW_DEFAULT_COL); header()->setMinimumSectionSize(MESSAGES_VIEW_MINIMUM_COL); + header()->setFirstSectionMovable(true); header()->setCascadingSectionResizes(false); header()->setStretchLastSection(false); }