old render cleanup part 2
This commit is contained in:
40 files changed
+329
-3643
No files matched your search
@@ -118,70 +118,4 @@ Rectangle {
|
||||
onClicked: sidebar.navigateTo("settings")
|
||||
}
|
||||
}
|
||||
|
||||
// TOC section — shown when the current book has a table of contents
|
||||
Item {
|
||||
visible: book.hasBook && book.toc.length > 0
|
||||
anchors.top: navColumn.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width
|
||||
|
||||
Rectangle {
|
||||
id: tocDivider
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: ThemeManager.currentTheme.divider
|
||||
}
|
||||
|
||||
Text {
|
||||
id: tocLabel
|
||||
anchors.top: tocDivider.bottom
|
||||
anchors.topMargin: 8
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 16
|
||||
text: "Contents"
|
||||
font.pixelSize: 10
|
||||
font.bold: true
|
||||
color: ThemeManager.currentTheme.dimText
|
||||
font.letterSpacing: 1
|
||||
}
|
||||
|
||||
ListView {
|
||||
anchors.top: tocLabel.bottom
|
||||
anchors.topMargin: 4
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width
|
||||
clip: true
|
||||
model: book.toc
|
||||
|
||||
delegate: Rectangle {
|
||||
width: ListView.view.width
|
||||
height: tocEntryText.implicitHeight + 10
|
||||
color: readingModel.currentChapter === modelData.chapterIndex
|
||||
? Qt.rgba(1, 1, 1, 0.05)
|
||||
: "transparent"
|
||||
|
||||
Text {
|
||||
id: tocEntryText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
x: 16 + modelData.depth * 12
|
||||
width: parent.width - x - 8
|
||||
text: modelData.title
|
||||
font.pixelSize: 13
|
||||
color: readingModel.currentChapter === modelData.chapterIndex
|
||||
? ThemeManager.currentTheme.sidebarButtonText
|
||||
: ThemeManager.currentTheme.uiText
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
readingModel.goToChapter(modelData.chapterIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user