diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 7f6edd1b3d..eb9ffe6258 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -75,6 +75,9 @@ class BooksView(QTableView): # {{{ h.setSectionHidden(idx, True) elif action == 'show': h.setSectionHidden(idx, False) + if h.sectionSize(idx) < 3: + sz = h.sectionSizeHint(idx) + h.resizeSection(idx, sz) elif action == 'ascending': self.sortByColumn(idx, Qt.AscendingOrder) elif action == 'descending': @@ -257,6 +260,11 @@ class BooksView(QTableView): # {{{ for col, alignment in state.get('column_alignment', {}).items(): self._model.change_alignment(col, alignment) + for i in range(h.count()): + if not h.isSectionHidden(i) and h.sectionSize(i) < 3: + sz = h.sectionSizeHint(i) + h.resizeSection(i, sz) + def get_default_state(self): old_state = { 'hidden_columns': [],