Small fixes
This commit is contained in:
2
TODO
2
TODO
@@ -92,8 +92,10 @@ TODO
|
||||
Deselecting all directories in the settings dialog also filters out manually added books
|
||||
Last line in QTextBrowser should never be cut off
|
||||
Does image alignment need to be centered?
|
||||
Bookmark name for a page that's not on the TOC or has nothing before
|
||||
|
||||
Secondary:
|
||||
The cover page needs to be marked separately
|
||||
Graphical themes
|
||||
Change focus rectangle dimensions
|
||||
Universal Ctrl + Tab
|
||||
|
@@ -719,6 +719,10 @@ class PliantWidgetsCommonFunctions:
|
||||
current_tab = self.pw.parent
|
||||
current_position = current_tab.metadata['position']['current_chapter']
|
||||
|
||||
# Prevent scrolling below page 1
|
||||
if current_position == 1 and direction == -1:
|
||||
return
|
||||
|
||||
# Special cases for double page view
|
||||
# Page limits are taken care of by the set_content method
|
||||
def get_modifier():
|
||||
|
@@ -92,16 +92,18 @@ class FB2:
|
||||
self.book['cover'] = None
|
||||
|
||||
def parse_chapters(self, temp_dir):
|
||||
# There's no need to parse the TOC separately because
|
||||
# everything is linear
|
||||
for i in self.xml.find_all('section'):
|
||||
this_title = '<No title>'
|
||||
for j in i:
|
||||
if j.name == 'title':
|
||||
this_title = j.getText(separator=' ')
|
||||
this_title = this_title.replace('\n', '').strip()
|
||||
# This comes later because the tag is changed in place
|
||||
title_xml = j.unwrap()
|
||||
break
|
||||
|
||||
self.book['book_list'].append(
|
||||
[this_title, str(i)])
|
||||
[this_title, str(title_xml) + str(i)])
|
||||
|
||||
# Extract all images to the temp_dir
|
||||
for i in self.xml.find_all('binary'):
|
||||
|
@@ -423,11 +423,6 @@ class Tab(QtWidgets.QWidget):
|
||||
# This function will decide how to relate
|
||||
# entries in the toc to the actual content
|
||||
|
||||
# Do not allow cycling below page 1
|
||||
# Required position goes to -1 in double page view
|
||||
if required_position <= 0:
|
||||
return
|
||||
|
||||
# Set the required page to the corresponding index
|
||||
# For images this is simply a page number
|
||||
# For text based books, this is the entire text of the chapter
|
||||
@@ -526,8 +521,11 @@ class Tab(QtWidgets.QWidget):
|
||||
'center': QtCore.Qt.AlignCenter,
|
||||
'justify': QtCore.Qt.AlignJustify}
|
||||
|
||||
current_index = self.main_window.bookToolBar.tocBox.currentIndex()
|
||||
if current_index == 0:
|
||||
# Adjusted for books without covers
|
||||
current_position = self.metadata['position']['current_chapter']
|
||||
chapter_name = self.metadata['toc'][current_position - 1][1]
|
||||
|
||||
if current_position == 1 and chapter_name == 'Cover':
|
||||
block_format.setAlignment(
|
||||
QtCore.Qt.AlignVCenter | QtCore.Qt.AlignHCenter)
|
||||
else:
|
||||
|
Reference in New Issue
Block a user