diff --git a/CHANGELOG.md b/CHANGELOG.md index 95ffa8fb..cb0cbb27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ Version counting is based on semantic versioning (Major.Feature.Patch) +## 9.16.3 (WIP) + +### YACReaderLibrary +* Fix table view last section stretch. Before it was only working randomly. + ## 9.16.2 ### YACReaderLibrary diff --git a/YACReaderLibrary/classic_comics_view.cpp b/YACReaderLibrary/classic_comics_view.cpp index 82494b0e..ec92c8e6 100644 --- a/YACReaderLibrary/classic_comics_view.cpp +++ b/YACReaderLibrary/classic_comics_view.cpp @@ -46,8 +46,8 @@ ClassicComicsView::ClassicComicsView(QWidget *parent) stack->addWidget(searchingIcon); sVertical->addWidget(stack); - comics = new QWidget; - auto comicsLayout = new QVBoxLayout; + comics = new QWidget(this); + auto comicsLayout = new QVBoxLayout(this); comicsLayout->setSpacing(0); comicsLayout->setContentsMargins(0, 0, 0, 0); // TODO ComicsView:(set toolbar) comicsLayout->addWidget(editInfoToolBar); @@ -143,6 +143,8 @@ void ClassicComicsView::setModel(ComicModel *model) connect(model, &ComicModel::resortedIndexes, comicFlow, &ComicFlowWidget::resortCovers, Qt::UniqueConnection); connect(model, &ComicModel::newSelectedIndex, this, &ClassicComicsView::setCurrentIndex, Qt::UniqueConnection); + tableView->horizontalHeader()->blockSignals(true); + tableView->setModel(model); if (model->rowCount() > 0) tableView->setCurrentIndex(model->index(0, 0)); @@ -151,15 +153,12 @@ void ClassicComicsView::setModel(ComicModel *model) comicFlow->setImagePaths(paths); comicFlow->setMarks(model->getReadList()); - bool loadDefaults = false; + bool loadDefaults = true; if (settings->contains(COMICS_VIEW_HEADERS)) { try { loadDefaults = !tableView->horizontalHeader()->restoreState(settings->value(COMICS_VIEW_HEADERS).toByteArray()); } catch (...) { - loadDefaults = true; } - } else { - loadDefaults = true; } if (loadDefaults) { @@ -190,10 +189,17 @@ void ClassicComicsView::setModel(ComicModel *model) } } - tableView->resizeColumnsToContents(); tableView->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); tableView->horizontalHeader()->setSectionsMovable(true); tableView->horizontalHeader()->setStretchLastSection(true); + + for (int i = 0; i < tableView->horizontalHeader()->count() - 1; i++) { + if (!tableView->horizontalHeader()->isSectionHidden(i)) { + tableView->resizeColumnToContents(i); + } + } + + tableView->horizontalHeader()->blockSignals(false); } } diff --git a/common/yacreader_global.h b/common/yacreader_global.h index 04c158f8..36b1f5d7 100644 --- a/common/yacreader_global.h +++ b/common/yacreader_global.h @@ -9,7 +9,7 @@ class QLibrary; -#define VERSION "9.16.2" +#define VERSION "9.16.3" // Used to check if the database needs to be updated, the version is stored in the database. // This value is only incremented when the database structure changes. diff --git a/custom_widgets/whats_new_dialog.cpp b/custom_widgets/whats_new_dialog.cpp index d0ec925c..614dceca 100644 --- a/custom_widgets/whats_new_dialog.cpp +++ b/custom_widgets/whats_new_dialog.cpp @@ -71,6 +71,7 @@ YACReader::WhatsNewDialog::WhatsNewDialog(QWidget *parent) " • Added a customizable User Agent string to use it with Comic Vine. It can be set in YACReaderLibrary.ini in the [ComicVine] section using the COMIC_VINE_USER_AGENT key (new in 9.16.2)
" " • Prevent crash when opening the folders context menu if a folder is not selected. (new in 9.16.2)
" " • Fix crash when using the `Set type` menu on libraries. (new in 9.16.2)
" + " • Fix table view last section stretch. Before it was only working randomly. (new in 9.16.3)
" "
" "YACReaderLibraryServer
" " • Log libraries validation when the app starts
"