added txt support
This commit is contained in:
1 parent
64a70bc4cf
commit
21656a3e9c
10 files changed
+441
-120
No files matched your search
@@ -8,15 +8,24 @@ Rectangle {
|
||||
GradientStop { position: 1.0; color: Theme.gradientBottom }
|
||||
}
|
||||
|
||||
Flickable {
|
||||
ListView {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 0
|
||||
anchors.bottomMargin: 0
|
||||
anchors.leftMargin: 12
|
||||
anchors.rightMargin: 0
|
||||
contentHeight: contentText.implicitHeight
|
||||
model: bookController.hasBook ? readingModel : null
|
||||
cacheBuffer: 2000
|
||||
clip: true
|
||||
|
||||
delegate: Text {
|
||||
width: ListView.view.width - 18
|
||||
rightPadding: 2
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
textFormat: Text.RichText
|
||||
font.pixelSize: 16
|
||||
lineHeight: 1.6
|
||||
color: Theme.readingText
|
||||
text: model.content
|
||||
}
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: ScrollBar.AsNeeded
|
||||
padding: 0
|
||||
@@ -31,16 +40,13 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// Placeholder when no book is open
|
||||
Text {
|
||||
id: contentText
|
||||
width: parent.width
|
||||
rightPadding: 20
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
textFormat: Text.RichText
|
||||
anchors.centerIn: parent
|
||||
visible: !bookController.hasBook
|
||||
text: "Open a book to start reading"
|
||||
font.pixelSize: 16
|
||||
lineHeight: 1.6
|
||||
color: Theme.readingText
|
||||
text: bookController.hasBook ? readingModel.chapterContent : "Open a book to start reading"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user