mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Cleanup code
This commit is contained in:
parent
b2d0fb5cf7
commit
cd085fc844
@ -1339,18 +1339,15 @@ class BooksView(QTableView): # {{{
|
|||||||
h = (viewport_height // 2) if pos == 'center' else viewport_height
|
h = (viewport_height // 2) if pos == 'center' else viewport_height
|
||||||
y = cell_height
|
y = cell_height
|
||||||
while vertical_index > 0:
|
while vertical_index > 0:
|
||||||
r = vh.logicalIndex(vertical_index - 1)
|
y += vh.sectionSize(vh.logicalIndex(vertical_index -1))
|
||||||
y += vh.sectionSize(r)
|
|
||||||
if y > h:
|
if y > h:
|
||||||
break
|
break
|
||||||
vertical_index -= 1
|
vertical_index -= 1
|
||||||
hidden_sections = 0
|
|
||||||
if vh.sectionsHidden():
|
if vh.sectionsHidden():
|
||||||
for s in range(vertical_index - 1, -1, -1):
|
for s in range(vertical_index - 1, -1, -1):
|
||||||
r = vh.logicalIndex(s)
|
if vh.isSectionHidden(vh.logicalIndex(s)):
|
||||||
if vh.isSectionHidden(r):
|
vertical_index -= 1
|
||||||
hidden_sections += 1
|
vsb.setValue(vertical_index)
|
||||||
vsb.setValue(vertical_index - hidden_sections)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_book(self):
|
def current_book(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user