Added more settings
This commit is contained in:
6 files changed
+268
-74
No files matched your search
@@ -16,18 +16,20 @@ Rectangle {
|
||||
ListView {
|
||||
id: chunkListView
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 12
|
||||
anchors.topMargin: appState.verticalMargin
|
||||
anchors.bottomMargin: appState.verticalMargin
|
||||
model: bookController.hasBook ? readingModel : null
|
||||
cacheBuffer: 2000
|
||||
clip: true
|
||||
|
||||
delegate: Text {
|
||||
width: ListView.view.width - 18
|
||||
rightPadding: 2
|
||||
leftPadding: appState.horizontalMargin
|
||||
rightPadding: appState.horizontalMargin
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
textFormat: Text.RichText
|
||||
font.pixelSize: 16
|
||||
lineHeight: 1.6
|
||||
font.pixelSize: appState.fontSize
|
||||
lineHeight: appState.lineSpacing
|
||||
color: Theme.readingText
|
||||
text: model.content
|
||||
}
|
||||
@@ -76,7 +78,7 @@ Rectangle {
|
||||
interval: 50
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
readingModel.setViewportSize(chunkListView.width, chunkListView.height)
|
||||
readingModel.setViewportSize(chunkListView.width - 18 - 2 * appState.horizontalMargin, chunkListView.height)
|
||||
var idx = chunkListView.indexAt(0, chunkListView.contentY)
|
||||
if (idx >= 0) {
|
||||
var item = chunkListView.itemAtIndex(idx)
|
||||
@@ -122,7 +124,7 @@ Rectangle {
|
||||
chunkListView.positionViewAtIndex(savedScrollIndex, ListView.Beginning)
|
||||
chunkListView.contentY += savedScrollOffset
|
||||
}
|
||||
readingModel.setViewportSize(chunkListView.width, chunkListView.height)
|
||||
readingModel.setViewportSize(chunkListView.width - 18 - 2 * appState.horizontalMargin, chunkListView.height)
|
||||
if (savedScrollIndex > 0) {
|
||||
var idx = chunkListView.indexAt(0, chunkListView.contentY)
|
||||
if (idx >= 0) {
|
||||
@@ -141,7 +143,7 @@ Rectangle {
|
||||
function onChapterChanged() {
|
||||
if (!_restoring) {
|
||||
Qt.callLater(function() {
|
||||
readingModel.setViewportSize(chunkListView.width, chunkListView.height)
|
||||
readingModel.setViewportSize(chunkListView.width - 18 - 2 * appState.horizontalMargin, chunkListView.height)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user