-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComicSelectionPage.qml
76 lines (70 loc) · 2.1 KB
/
ComicSelectionPage.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import net.blumia.pineapple.comic.reader
Item {
anchors.fill: parent
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)
}
}
}
}
ColumnLayout {
anchors.fill: parent
RowLayout {
ToolButton {
flat: true
icon.name: "folder-open"
onClicked: function() {
drawer.open();
}
}
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
}
}
onClicked: function() {
AppController.selectedComicId = model.comicId
}
}
ScrollBar.vertical: ScrollBar { }
}
Component.onCompleted: function() {
AppController.updateComicsInFolder()
}
}
}