-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGenericOptions.qml
More file actions
146 lines (126 loc) · 4.4 KB
/
GenericOptions.qml
File metadata and controls
146 lines (126 loc) · 4.4 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import QtWebEngine 1.5
Page
{
id: page
property url lessonOptionsUrl: ""
property url lessonDescriptionUrl: ""
property alias optionsControl: concreteLessonOptionsLoader.item
onLessonOptionsUrlChanged: {
console.log(lessonOptionsUrl)
}
header: TabBar {
id: tabBar
currentIndex: 0
TabButton {
text: "Opcje"
}
TabButton {
text: "Opis"
}
}
SwipeView
{
id: swipeView
currentIndex: tabBar.currentIndex
anchors.fill: parent
interactive: false
clip: true
Item {
id: optionsPage
Rectangle {
anchors.fill: parent
color: "#cfcfcf"
}
Flickable {
id: optionsFlickable
anchors.fill: optionsPage
boundsBehavior: Flickable.StopAtBounds
contentWidth: concreteLessonOptionsLoader.width
contentHeight: concreteLessonOptionsLoader.height
clip: true
ScrollBar.vertical: ScrollBar {
id: verticalScrollbar
parent: optionsFlickable.parent
anchors.top: optionsFlickable.top
anchors.bottom: optionsFlickable.bottom
anchors.right: optionsFlickable.right
anchors.bottomMargin: scrollbarCorner.visible? scrollbarCorner.height : 0
visible: optionsFlickable.contentHeight > optionsFlickable.height
background: Rectangle {
anchors.fill: parent
color: "#202020"
}
contentItem: Rectangle {
implicitWidth: 6
implicitHeight: 100
radius: width / 2
color: verticalScrollbar.pressed? "#6e6e6e" : (verticalScrollbar.hovered? "#8c8c8c" : "#aaaaaa")
}
}
ScrollBar.horizontal: ScrollBar {
id: horizontalScrollbar
parent: optionsFlickable.parent
anchors.left: optionsFlickable.left
anchors.right: optionsFlickable.right
anchors.bottom: optionsFlickable.bottom
anchors.rightMargin: scrollbarCorner.visible? scrollbarCorner.width : 0
visible: optionsFlickable.contentWidth > optionsFlickable.width
background: Rectangle {
anchors.fill: parent
color: "#202020"
}
contentItem: Rectangle {
implicitWidth: 100
implicitHeight: 6
radius: height / 2
color: horizontalScrollbar.pressed? "#6e6e6e" : (horizontalScrollbar.hovered? "#8c8c8c" : "#aaaaaa")
}
}
Loader {
id: concreteLessonOptionsLoader
source: lessonOptionsUrl
}
}
Rectangle {
id: scrollbarCorner
anchors.right: parent.right
anchors.bottom: parent.bottom
width: Math.max(horizontalScrollbar.height, verticalScrollbar.width)
height: width
visible: horizontalScrollbar.visible && verticalScrollbar.visible
color: "#202020"
}
}
Item {
id: descriptionPage
implicitHeight: page.height - header.height
WebEngineView {
id: webEngineView
anchors.fill: parent
url: lessonDescriptionUrl
}
}
}
// property int flag: 0
// footer: Button {
// text: "Button"
// onClicked: {
// flag = (flag + 1) % 3
// switch(flag)
// {
// case 0:
// lessonOptionsUrl = "Lesson1Options.qml"
// break
// case 1:
// lessonOptionsUrl = "Lesson2Options.qml"
// break
// case 2:
// lessonOptionsUrl = ""
// break
// }
// }
// }
}