mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
When applying column header state explicitly change section hidden for every column not just the ondevice column
This commit is contained in:
parent
478c96561d
commit
fb416ddffe
@ -561,16 +561,12 @@ class BooksView(QTableView): # {{{
|
|||||||
sz = h.sectionSizeHint(i)
|
sz = h.sectionSizeHint(i)
|
||||||
h.resizeSection(i, sz)
|
h.resizeSection(i, sz)
|
||||||
# Because of a bug in Qt 5 we have to ensure that the header is actually
|
# Because of a bug in Qt 5 we have to ensure that the header is actually
|
||||||
# relaid out by changing this value, without this sometimes the ghost
|
# relaid out by changing this value, without this sometimes ghost
|
||||||
# of the ondevice column remains visible when changing libraries
|
# columns remain visible when changing libraries
|
||||||
try:
|
for i in xrange(h.count()):
|
||||||
col = self._model.column_map.index('ondevice')
|
val = h.isSectionHidden(i)
|
||||||
except ValueError:
|
h.setSectionHidden(i, not val)
|
||||||
pass # DeviceBooksView
|
h.setSectionHidden(i, val)
|
||||||
else:
|
|
||||||
val = h.isSectionHidden(col)
|
|
||||||
h.setSectionHidden(col, not val)
|
|
||||||
h.setSectionHidden(col, val)
|
|
||||||
|
|
||||||
def get_default_state(self):
|
def get_default_state(self):
|
||||||
old_state = {
|
old_state = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user