mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-27 08:43:42 +02:00
Get the ghost ondevice column fix to also work on windows
This commit is contained in:
parent
e6b883e212
commit
5cd4b3930f
1 changed files with 7 additions and 4 deletions
|
|
@ -457,10 +457,6 @@ def multisort(self, fields, reset=True, only_if_different=False):
|
|||
# Ondevice column {{{
|
||||
def set_ondevice_column_visibility(self):
|
||||
col, h = self._model.column_map.index('ondevice'), self.column_header
|
||||
# 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
|
||||
# of the ondevice column remains visible when changing libraries
|
||||
h.setSectionHidden(col, not h.isSectionHidden(col))
|
||||
h.setSectionHidden(col, not self._model.device_connected)
|
||||
|
||||
def set_device_connected(self, is_connected):
|
||||
|
|
@ -564,6 +560,13 @@ def apply_state(self, state, max_sort_levels=3):
|
|||
if not h.isSectionHidden(i) and h.sectionSize(i) < 3:
|
||||
sz = h.sectionSizeHint(i)
|
||||
h.resizeSection(i, sz)
|
||||
# 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
|
||||
# of the ondevice column remains visible when changing libraries
|
||||
col = self._model.column_map.index('ondevice')
|
||||
val = h.isSectionHidden(col)
|
||||
h.setSectionHidden(col, not val)
|
||||
h.setSectionHidden(col, val)
|
||||
|
||||
def get_default_state(self):
|
||||
old_state = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue