Fix scrolling not possible in margins
This commit is contained in:
3
TODO
3
TODO
@@ -41,6 +41,8 @@ TODO
|
|||||||
✓ Selectable background color for QGraphicsView
|
✓ Selectable background color for QGraphicsView
|
||||||
✓ View modes for QGraphicsView
|
✓ View modes for QGraphicsView
|
||||||
✓ View and hide toolbar actions in a list
|
✓ View and hide toolbar actions in a list
|
||||||
|
✓ Line spacing
|
||||||
|
Search document using QTextCursor?
|
||||||
Use embedded fonts
|
Use embedded fonts
|
||||||
Graphical themes
|
Graphical themes
|
||||||
Comic view keyboard shortcuts
|
Comic view keyboard shortcuts
|
||||||
@@ -50,7 +52,6 @@ TODO
|
|||||||
Record progress
|
Record progress
|
||||||
Pagination
|
Pagination
|
||||||
Set context menu for definitions and the like
|
Set context menu for definitions and the like
|
||||||
Line spacing
|
|
||||||
Scrolling: Smooth / By Line
|
Scrolling: Smooth / By Line
|
||||||
Filetypes:
|
Filetypes:
|
||||||
✓ cbz, cbr support
|
✓ cbz, cbr support
|
||||||
|
@@ -412,7 +412,6 @@ class Tab(QtWidgets.QWidget):
|
|||||||
self.contentView.loadImage(chapter_content)
|
self.contentView.loadImage(chapter_content)
|
||||||
else:
|
else:
|
||||||
self.contentView = PliantQTextBrowser(self.window(), self)
|
self.contentView = PliantQTextBrowser(self.window(), self)
|
||||||
# print(dir(self.contentView.document())) ## TODO USE this for modifying formatting and searching
|
|
||||||
|
|
||||||
relative_path_root = os.path.join(
|
relative_path_root = os.path.join(
|
||||||
self.window().temp_dir.path(), self.metadata['hash'])
|
self.window().temp_dir.path(), self.metadata['hash'])
|
||||||
@@ -529,7 +528,6 @@ class Tab(QtWidgets.QWidget):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
self.contentView.setViewportMargins(padding, 0, padding, 0)
|
|
||||||
self.contentView.setStyleSheet(
|
self.contentView.setStyleSheet(
|
||||||
"QTextEdit {{font-family: {0}; font-size: {1}px; color: {2}; background-color: {3}}}".format(
|
"QTextEdit {{font-family: {0}; font-size: {1}px; color: {2}; background-color: {3}}}".format(
|
||||||
font, font_size, foreground.name(), background.name()))
|
font, font_size, foreground.name(), background.name()))
|
||||||
@@ -542,9 +540,16 @@ class Tab(QtWidgets.QWidget):
|
|||||||
block_format.setLineHeight(
|
block_format.setLineHeight(
|
||||||
line_spacing, QtGui.QTextBlockFormat.ProportionalHeight)
|
line_spacing, QtGui.QTextBlockFormat.ProportionalHeight)
|
||||||
|
|
||||||
|
# Also for padding
|
||||||
|
# Using setViewPortMargins for this disables scrolling in the margins
|
||||||
|
block_format.setLeftMargin(padding)
|
||||||
|
block_format.setRightMargin(padding)
|
||||||
|
|
||||||
this_cursor = self.contentView.textCursor()
|
this_cursor = self.contentView.textCursor()
|
||||||
this_cursor.movePosition(QtGui.QTextCursor.Start, 0, 1)
|
this_cursor.movePosition(QtGui.QTextCursor.Start, 0, 1)
|
||||||
|
|
||||||
|
# Iterate over the entire document block by block
|
||||||
|
# The document ends when the cursor position can no longer be incremented
|
||||||
while True:
|
while True:
|
||||||
old_position = this_cursor.position()
|
old_position = this_cursor.position()
|
||||||
this_cursor.mergeBlockFormat(block_format)
|
this_cursor.mergeBlockFormat(block_format)
|
||||||
|
Reference in New Issue
Block a user