feat(browser): support display subfolders
This commit is contained in:
@@ -1,42 +1,76 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import net.blumia.pineapple.comic.reader
|
||||
|
||||
ColumnLayout {
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
Label {
|
||||
text: "Comics"
|
||||
font.pixelSize: 20
|
||||
}
|
||||
GridView {
|
||||
id: gridView
|
||||
clip: true
|
||||
cellHeight: cellWidth * 3 / 2
|
||||
cellWidth: width / Math.max(Math.floor(width / (65 * 2)), 1)
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
model: AppController.comicsModel
|
||||
delegate: Button {
|
||||
width: GridView.view.cellWidth
|
||||
height: GridView.view.cellHeight
|
||||
Column {
|
||||
Image {
|
||||
source: AppController.coverImageSource(model.hash)
|
||||
width: gridView.cellWidth
|
||||
height: gridView.cellHeight
|
||||
fillMode: Image.PreserveAspectFit
|
||||
retainWhileLoading: true
|
||||
|
||||
Drawer {
|
||||
id: drawer
|
||||
width: Math.min(0.66 * parent.width, 320)
|
||||
height: parent.height
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
clip: true
|
||||
anchors.fill: parent
|
||||
model: AppController.foldersModel
|
||||
delegate: ItemDelegate {
|
||||
text: model.display
|
||||
width: listView.width
|
||||
onClicked: function() {
|
||||
AppController.updateComicsInFolder(model.folderId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: function() {
|
||||
AppController.selectedComicId = model.comicId
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
RowLayout {
|
||||
ToolButton {
|
||||
flat: true
|
||||
icon.name: "folder-open"
|
||||
onClicked: function() {
|
||||
drawer.open();
|
||||
}
|
||||
}
|
||||
Label {
|
||||
text: "Comics"
|
||||
font.pixelSize: 20
|
||||
}
|
||||
}
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
}
|
||||
GridView {
|
||||
id: gridView
|
||||
clip: true
|
||||
cellHeight: cellWidth * 3 / 2
|
||||
cellWidth: width / Math.max(Math.floor(width / (65 * 2)), 1)
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
model: AppController.comicsModel
|
||||
delegate: Button {
|
||||
width: GridView.view.cellWidth
|
||||
height: GridView.view.cellHeight
|
||||
Column {
|
||||
Image {
|
||||
source: AppController.coverImageSource(model.hash)
|
||||
width: gridView.cellWidth
|
||||
height: gridView.cellHeight
|
||||
fillMode: Image.PreserveAspectFit
|
||||
retainWhileLoading: true
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: function() {
|
||||
AppController.updateComicsInFolder()
|
||||
onClicked: function() {
|
||||
AppController.selectedComicId = model.comicId
|
||||
}
|
||||
}
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
}
|
||||
|
||||
Component.onCompleted: function() {
|
||||
AppController.updateComicsInFolder()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user