added txt support

This commit is contained in:
Agel committed 2026-03-15 21:33:18 +01:00
1 parent 3c0037cfc9
commit 64a70bc4cf
22 files changed
+800 -186

No files matched your search

+1 -9
View File
@@ -1,6 +1,5 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import Asteria
ApplicationWindow {
@@ -32,7 +31,7 @@ ApplicationWindow {
window.sidebarOpen = false
}
onOpenFile: {
fileDialog.open()
bookController.browseAndOpen()
window.sidebarOpen = false
}
}
@@ -91,13 +90,6 @@ ApplicationWindow {
z: 3000
}
FileDialog {
id: fileDialog
title: "Open Book"
nameFilters: ["Book files (*.txt *.fb2 *.epub *.pdf *.doc *.rtf *.html *.htm *.docx *.djvu *.odt *.chm)", "All files (*)"]
onAccepted: bookController.openBook(selectedFile)
}
Connections {
target: bookController
function onBookReady() {
+13
View File
@@ -22,4 +22,17 @@ Rectangle {
font.bold: true
color: Theme.dimText
}
Text {
anchors.right: parent.right
anchors.rightMargin: 16
anchors.verticalCenter: parent.verticalCenter
visible: bookController.hasBook
text: bookController.hasBook
? (readingModel.currentChapter + 1) + "/" + readingModel.totalChapters
: ""
font.pixelSize: 11
font.bold: true
color: Theme.counterText
}
}
-10
View File
@@ -71,15 +71,5 @@ Rectangle {
}
}
Text {
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 12
font.bold: true
color: Theme.counterText
visible: header.currentPage === "reader" && bookController.hasBook
text: bookController.hasBook
? (readingModel.currentChapter + 1) + "/" + readingModel.totalChapters
: ""
}
}
}
+6 -1
View File
@@ -10,12 +10,16 @@ Rectangle {
Flickable {
anchors.fill: parent
anchors.margins: 12
anchors.topMargin: 0
anchors.bottomMargin: 0
anchors.leftMargin: 12
anchors.rightMargin: 0
contentHeight: contentText.implicitHeight
clip: true
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AsNeeded
padding: 0
contentItem: Rectangle {
implicitWidth: 18
radius: 3
@@ -30,6 +34,7 @@ Rectangle {
Text {
id: contentText
width: parent.width
rightPadding: 20
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
textFormat: Text.RichText
font.pixelSize: 16