summaryrefslogtreecommitdiff
path: root/src/mobile/qml
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:58:34 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:58:34 -0400
commit1ea03c0fce8066c1e22188447b4a6ca4dcef1201 (patch)
tree1ad46980fdca402062502b20b7e16468b89393f8 /src/mobile/qml
parent579657c8cb4ecd8a313221e70bdbbc7267f20286 (diff)
Imported Upstream version 2.10.1
Diffstat (limited to 'src/mobile/qml')
-rw-r--r--src/mobile/qml/ContextMenu.qml62
-rw-r--r--src/mobile/qml/FontSizeSlider.qml139
-rw-r--r--src/mobile/qml/GridChooser.qml117
-rw-r--r--src/mobile/qml/GridChooserButton.qml52
-rw-r--r--src/mobile/qml/ImageButton.qml24
-rw-r--r--src/mobile/qml/InstallManagerChooser.qml153
-rw-r--r--src/mobile/qml/ListTextView.qml108
-rw-r--r--src/mobile/qml/ListWorksView.qml123
-rw-r--r--src/mobile/qml/MainToolbar.qml27
-rw-r--r--src/mobile/qml/MenuButton.qml30
-rw-r--r--src/mobile/qml/MenuView.qml28
-rw-r--r--src/mobile/qml/Menus.qml61
-rw-r--r--src/mobile/qml/ModuleChooser.qml109
-rw-r--r--src/mobile/qml/Progress.qml63
-rw-r--r--src/mobile/qml/Settings.qml93
-rw-r--r--src/mobile/qml/TreeChooser.qml167
-rw-r--r--src/mobile/qml/Window.qml178
-rw-r--r--src/mobile/qml/WindowManager.qml291
-rw-r--r--src/mobile/qml/checkmark.svg42
-rw-r--r--src/mobile/qml/leftarrow.svg83
-rw-r--r--src/mobile/qml/main.qml270
-rw-r--r--src/mobile/qml/rightarrow.svg82
-rw-r--r--src/mobile/qml/tab.pngbin0 -> 507 bytes
23 files changed, 2302 insertions, 0 deletions
diff --git a/src/mobile/qml/ContextMenu.qml b/src/mobile/qml/ContextMenu.qml
new file mode 100644
index 0000000..bf55ebf
--- /dev/null
+++ b/src/mobile/qml/ContextMenu.qml
@@ -0,0 +1,62 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: contextMenu
+
+ property alias model: menuList.model
+
+ signal accepted(string action)
+
+ color: "white"
+ border.color: "black"
+ border.width: 1
+ anchors.centerIn: parent
+ height: 250
+ width: 250
+
+ onVisibleChanged: PropertyAnimation {
+ target: settings
+ property: "opacity"
+ from: 0
+ to: 1
+ duration: 400
+ easing.type: Easing.InOutCubic
+ }
+
+ BtStyle {
+ id: btStyle
+ }
+
+ ListView {
+ id: menuList
+
+ anchors.fill: parent
+ anchors.topMargin: 100
+
+ delegate: Rectangle {
+ color: "white"
+ border.color: "black"
+ border.width: 1
+ width: parent.width
+ height: children[0].height * 2.5
+
+ Text {
+ id: menuText
+ x: 40
+ anchors.verticalCenter: parent.verticalCenter
+ text: title
+ color: "black"
+ font.pointSize: btStyle.uiFontPointSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ contextMenu.visible = false;
+ contextMenu.accepted(action);
+ }
+ }
+ }
+ }
+}
diff --git a/src/mobile/qml/FontSizeSlider.qml b/src/mobile/qml/FontSizeSlider.qml
new file mode 100644
index 0000000..6c11dc0
--- /dev/null
+++ b/src/mobile/qml/FontSizeSlider.qml
@@ -0,0 +1,139 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: fontPointSize
+
+ property string title: ""
+ property int min: 10
+ property int max: 22
+ property int current: 12
+ property int previous: 12
+
+ signal accepted(int pointSize);
+
+ color: "#f8f8f8"
+ border.color: "black"
+ border.width: 1
+ anchors.centerIn: parent
+ width: parent.width * 0.85
+ height: 140
+
+ Text {
+ text: title
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ height: 40
+ font.pointSize: btStyle.uiFontPointSize
+ }
+
+ Rectangle {
+ id: bar
+
+ color: "blue"
+ width: parent.width *.80
+ height: 3
+ anchors.centerIn: parent
+ }
+
+ Rectangle {
+ id: indicator
+
+ width: 18
+ height: 18
+ color: "red"
+ y: bar.y - height / 2
+ x: {
+ var range = fontPointSize.max - fontPointSize.min;
+ var xpos = bar.width *
+ (fontPointSize.current - fontPointSize.min) / range;
+ xpos = xpos + bar.x
+ return xpos
+ }
+ }
+
+ MouseArea {
+ property bool active: false
+ width: bar.width
+ anchors.left: bar.left
+ height: 40
+ anchors.verticalCenter: bar.verticalCenter
+
+ onPressed: {
+ active = true;
+ }
+
+ onReleased: {
+ active = false;
+ }
+
+ onMouseXChanged: {
+ if ( ! active)
+ return;
+ var range = fontPointSize.max - fontPointSize.min;
+ var currentF = mouse.x / bar.width * range + fontPointSize.min;
+ var value = Math.round(currentF);
+ if (value < fontPointSize.min)
+ value = min;
+ if (value > fontPointSize.max)
+ value = max;
+ fontPointSize.current = value;
+ accepted(value);
+ }
+
+ }
+
+ Grid {
+ id: buttons
+
+ spacing: 10
+ columns: 2
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.rightMargin: 10
+ anchors.bottomMargin: 10
+
+ Rectangle {
+ height: 40
+ width: 120
+ border.color: "black"
+ border.width: 1
+
+ Text {
+ text: "Ok"
+ anchors.centerIn: parent
+ font.pointSize: btStyle.uiFontPointSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ fontPointSize.visible = false;
+ }
+ }
+ }
+
+ Rectangle {
+ height: 40
+ width: 120
+ border.color: "black"
+ border.width: 1
+
+ Text {
+ text: "Cancel"
+ anchors.centerIn: parent
+ font.pointSize: btStyle.uiFontPointSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ accepted(previous);
+ fontPointSize.visible = false;
+ }
+ }
+ }
+ }
+
+}
diff --git a/src/mobile/qml/GridChooser.qml b/src/mobile/qml/GridChooser.qml
new file mode 100644
index 0000000..b4d1612
--- /dev/null
+++ b/src/mobile/qml/GridChooser.qml
@@ -0,0 +1,117 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: gridChooser
+
+ property int columns: 5
+ property int rows: 5
+ property int buttonWidth: 100
+ property int buttonHeight: 30
+ property int topMargin: 10
+ property int leftMargin: 10
+ property int titleHeight: 20
+ property int space:5
+ property string selected: ""
+ property string titleText: ""
+ property int maxLength: 0
+
+ signal accepted(string choosenText);
+ signal canceled();
+
+ onVisibleChanged: {
+
+ var count = gridChooserModel.length
+ if (count < 36)
+ count = 36;
+
+ calculateColumns(count);
+
+ buttonWidth = (width-50)/columns;
+ buttonHeight = Math.floor((height-(rows*5))/rows);
+
+ topMargin = (height - rows*(buttonHeight+space) + space)/2 +titleHeight;
+ leftMargin = (width - columns*(buttonWidth+space) + space)/2;
+ }
+
+ function calculateColumns(count) {
+ var aspectRatio = 0.175;
+ var columnsF = Math.sqrt(count * width * aspectRatio / height);
+ columns = Math.ceil(columnsF);
+ rows = Math.ceil((count-0.01)/columns);
+ }
+
+ function accept(value) {
+ visible = false;
+ gridChooser.accepted(value);
+ }
+
+ Text {
+ id: title
+
+ text: titleText
+ font.pointSize: btStyle.uiFontPointSize
+ height: titleHeight
+ anchors.top: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ BtStyle {
+ id: btStyle
+ }
+
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ enabled: gridChooser.opacity
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: btStyle.buttonBackground
+ }
+
+ Rectangle {
+ id: topSpace
+
+ width: leftMargin
+ height: topMargin
+ color: btStyle.buttonBackground
+ }
+
+ Grid {
+ id: grid
+
+ anchors.top: topSpace.bottom
+ anchors.bottom: bottom.top
+ anchors.left: topSpace.right
+ anchors.right: parent.right
+ columns: gridChooser.columns
+ spacing: gridChooser.space
+
+ Repeater {
+ id: repeater
+
+ model: gridChooserModel
+
+ GridChooserButton {
+ id: buttonX
+
+ text: modelData
+ textHeight: btStyle.uiFontPointSize
+ buttonWidth: gridChooser.buttonWidth
+ buttonHeight: gridChooser.buttonHeight
+ textColor: {
+ if (text == gridChooser.selected)
+ return btStyle.buttonHighlightedText
+ else
+ return btStyle.buttonTextColor
+ }
+ buttonColor: btStyle.buttonColor
+ activeButtonColor: btStyle.buttonTextColor
+ onClicked: gridChooser.accept(text)
+ }
+ }
+ }
+}
diff --git a/src/mobile/qml/GridChooserButton.qml b/src/mobile/qml/GridChooserButton.qml
new file mode 100644
index 0000000..9a65041
--- /dev/null
+++ b/src/mobile/qml/GridChooserButton.qml
@@ -0,0 +1,52 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: button
+
+ property int buttonWidth
+ property int buttonHeight
+ property int textHeight
+ property color textColor
+ property color buttonColor
+ property color activeButtonColor
+ property alias text: buttonText.text
+
+ signal clicked
+
+ width: buttonWidth
+ height: buttonHeight
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: btStyle.buttonGradient0 }
+ GradientStop { position: 0.15; color: btStyle.buttonGradient1 }
+ GradientStop { position: 0.85; color: btStyle.buttonGradient2 }
+ GradientStop { position: 1.0; color: btStyle.buttonGradient3 }
+ }
+ smooth: true
+
+ border {
+ width: 1
+ color: btStyle.buttonBorder
+ }
+
+ BtStyle {
+ id: btStyle
+ }
+
+ Text {
+ id: buttonText
+
+ width: buttonWidth-8
+ anchors.centerIn: parent
+ color: button.textColor
+ font.pointSize: parent.textHeight
+ elide: Text.ElideRight
+ }
+
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ onClicked: button.clicked()
+ }
+}
diff --git a/src/mobile/qml/ImageButton.qml b/src/mobile/qml/ImageButton.qml
new file mode 100644
index 0000000..552a9b4
--- /dev/null
+++ b/src/mobile/qml/ImageButton.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.1
+
+Rectangle {
+ id: imageButton
+
+ property bool show: true
+ property string icon: ""
+ property int corner: 6
+
+ border.width: 1
+ border.color: "gray"
+ radius: corner
+
+ Image{
+ id: nextIcon
+ anchors.fill: parent
+ fillMode: Image.PreserveAspectFit
+ source: imageButton.icon
+ height: parent.height
+ width: parent.height
+ anchors.right: parent.right
+ anchors.top: parent.top
+ }
+}
diff --git a/src/mobile/qml/InstallManagerChooser.qml b/src/mobile/qml/InstallManagerChooser.qml
new file mode 100644
index 0000000..15b6079
--- /dev/null
+++ b/src/mobile/qml/InstallManagerChooser.qml
@@ -0,0 +1,153 @@
+import QtQuick 2.1
+
+Rectangle {
+ id: installManager
+
+ property alias sourceModel: sourceView.model
+ property alias categoryModel: categoryView.model
+ property alias languageModel: languageView.model
+ property alias worksModel: worksView.model
+ property alias sourceIndex: sourceView.currentIndex
+ property alias categoryIndex: categoryView.currentIndex
+ property alias languageIndex: languageView.currentIndex
+ property int spacing: 8
+
+ objectName: "installManager"
+ color: "lightgray"
+ border.color: "black"
+ border.width: 2
+
+ signal sourceChanged(int index);
+ signal categoryChanged(int index);
+ signal languageChanged(int index);
+ signal workSelected(int index);
+ signal cancel();
+ signal installRemove();
+ signal refreshLists();
+
+ Grid {
+ id: grid
+ columns: 3
+ rows: 1
+ spacing: installManager.spacing
+ width: parent.width - installManager.spacing
+ height: installManager.height/3
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.margins: installManager.spacing
+
+ ListTextView {
+ id: sourceView
+ onItemSelected: {
+ sourceChanged(currentIndex)
+ }
+
+ title: "Source"
+ width: parent.width/3 - grid.spacing
+ height: installManager.height/3
+ }
+
+ ListTextView {
+ id: categoryView
+
+ title: "Category"
+ width: parent.width/3 - grid.spacing
+ height: installManager.height/3
+ onItemSelected: {
+ categoryChanged(currentIndex)
+ }
+ }
+
+ ListTextView {
+ id: languageView
+
+ title: "Language"
+ width: parent.width/3 - grid.spacing
+ height: installManager.height/3
+ onItemSelected: {
+ languageChanged(currentIndex)
+ }
+ }
+ }
+
+ ListWorksView {
+ id: worksView
+
+ title: "Work"
+ width: parent.width - 2 * installManager.spacing
+ anchors.top: grid.bottom
+ anchors.left: parent.left
+ anchors.bottom: installRemoveButton.top
+ anchors.margins: installManager.spacing
+ onItemSelected: {
+ workSelected(index)
+ }
+ }
+
+ Rectangle {
+ id: "refreshButton"
+ width:150
+ height: 40
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 10
+ anchors.right: installRemoveButton.left
+ anchors.rightMargin: 10
+ border.width: 1
+ border.color: "black"
+
+ Text {
+ text: "Refresh Lists"
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: installManager.refreshLists()
+ }
+ }
+
+ Rectangle {
+ id: "installRemoveButton"
+ width:150
+ height: 40
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 10
+ anchors.right: cancelButton.left
+ anchors.rightMargin: 10
+ border.width: 1
+ border.color: "black"
+
+ Text {
+ text: "Install / Remove"
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: installManager.installRemove()
+ }
+ }
+
+ Rectangle {
+ id: "cancelButton"
+ width: installRemoveButton.width
+ height: installRemoveButton.height
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 10
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ border.width: 1
+ border.color: "black"
+
+ Text {
+ text: "Cancel"
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: installManager.cancel();
+ }
+ }
+
+}
diff --git a/src/mobile/qml/ListTextView.qml b/src/mobile/qml/ListTextView.qml
new file mode 100644
index 0000000..703fe48
--- /dev/null
+++ b/src/mobile/qml/ListTextView.qml
@@ -0,0 +1,108 @@
+import QtQuick 2.1
+
+Rectangle {
+ id: top
+
+ property alias model: listView.model
+ property alias currentIndex: listView.currentIndex
+ property alias title: title.text
+ property bool highlight: true
+
+ border.color: "black"
+ border.width: 2
+
+ signal itemSelected(int index)
+
+ Rectangle {
+ id: titleRect
+
+ border.color: "black"
+ border.width: 1
+ height:25
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.leftMargin: 3
+ anchors.rightMargin: 3
+ anchors.topMargin: 3
+
+ Text {
+ id: title
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignCenter
+ verticalAlignment: Text.AlignBottom
+ style: Text.Sunken
+ font.pointSize: btStyle.uiFontPointSize
+ }
+ }
+
+ ListView {
+ id: listView
+
+ anchors.top: titleRect.bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.leftMargin: 3
+ anchors.rightMargin: 3
+ anchors.bottomMargin: 3
+ clip: true
+ highlightFollowsCurrentItem: true
+ currentIndex: 2
+
+ function selectItem(x, y) {
+ var index = listView.indexAt(x+contentX,y+contentY);
+ currentIndex = index;
+ top.itemSelected(index);
+ }
+
+ Rectangle {
+ id: scrollbar
+ anchors.right: listView.right
+ y: listView.visibleArea.yPosition * listView.height
+ width: 7
+ height: listView.visibleArea.heightRatio * listView.height
+ color: "black"
+ visible: listView.visibleArea.heightRatio < 0.99
+ }
+
+ delegate {
+ Rectangle {
+ id: entry
+
+ property bool selected: ListView.isCurrentItem ? true : false
+ objectName: "entry"
+ color: (highlight && ListView.isCurrentItem) ? "#ffeeaa" : "white"
+ border.width: 1
+ border.color: "darkgray"
+ width: parent.width
+ height: 40
+
+ Text {
+ id: entryText
+
+ anchors.top: entry.top
+ anchors.left: entry.left
+ anchors.right: entry.right
+ width: parent.width
+ anchors.leftMargin: 10
+ anchors.rightMargin: 10
+ anchors.topMargin: 10
+ text: modelText
+ font.pointSize: btStyle.uiFontPointSize
+ font.bold: highlight && entry.selected
+ }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: listView
+ onClicked: itemSelected()
+
+ function itemSelected() {
+ listView.selectItem(mouseX, mouseY);
+ }
+ }
+ }
+}
diff --git a/src/mobile/qml/ListWorksView.qml b/src/mobile/qml/ListWorksView.qml
new file mode 100644
index 0000000..6e6dd13
--- /dev/null
+++ b/src/mobile/qml/ListWorksView.qml
@@ -0,0 +1,123 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: top
+ property alias model: listView.model
+ property alias title: title.text
+
+ border.color: "black"
+ border.width: 2
+
+ signal itemSelected(int index)
+
+ Rectangle {
+ id: titleRect
+
+ border.color: "black"
+ border.width: 1
+ height:25
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.leftMargin: 3
+ anchors.rightMargin: 3
+ anchors.topMargin: 3
+
+ Text {
+ id: title
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignCenter
+ verticalAlignment: Text.AlignBottom
+ style: Text.Sunken
+ font.pointSize: btStyle.uiFontPointSize
+ }
+ }
+
+ ListView {
+ id: listView
+ clip: true
+ anchors.top: titleRect.bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: 3
+
+ function itemSelected(index) {
+ top.itemSelected(index);
+ }
+
+ Rectangle {
+ id: scrollbar
+ anchors.right: listView.right
+ y: listView.visibleArea.yPosition * listView.height
+ width: 5
+ height: listView.visibleArea.heightRatio * listView.height
+ color: "black"
+ visible: listView.visibleArea.heightRatio < 0.99
+ }
+
+ delegate {
+ Rectangle {
+ id: entry
+
+ color: "white"
+ border.width: 1
+ border.color: ListView.isCurrentItem ? "#c0c0c0" : "#a0a0a0"
+ width: parent.width
+ height: 60
+
+ Image {
+ id: installedCheckmark
+
+ source: "checkmark.svg"
+ height: entry.height - 15
+ width: 25
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.leftMargin: 5
+ anchors.topMargin: 5
+ visible: installed == 1
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {listView.itemSelected(index)}
+ }
+
+ Text {
+ anchors.top: entry.top
+ anchors.left: installedCheckmark.right
+ anchors.right: entry.right
+ width: parent.width
+ height: parent.height/2 -4
+ anchors.leftMargin: 10
+ anchors.rightMargin: 10
+ anchors.topMargin: 5
+ text: title
+ font.pointSize: btStyle.textFontPointSize
+ }
+
+ Text {
+ anchors.bottom: entry.bottom
+ anchors.left: installedCheckmark.right
+ anchors.right: entry.right
+ width: parent.width
+ height: parent.height/2 -4
+ anchors.leftMargin: 35
+ anchors.rightMargin: 10
+ anchors.topMargin: 25
+ text: desc
+ elide: Text.ElideMiddle
+ font.pointSize: btStyle.textFontPointSize
+ }
+ }
+ }
+
+ BtStyle {
+ id: btStyle
+ }
+ }
+}
+
diff --git a/src/mobile/qml/MainToolbar.qml b/src/mobile/qml/MainToolbar.qml
new file mode 100644
index 0000000..66513b2
--- /dev/null
+++ b/src/mobile/qml/MainToolbar.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: toolbar
+
+ signal buttonClicked
+
+ BtStyle {
+ id: btStyle
+ }
+
+ color: btStyle.toolbarColor
+ z:0
+
+ MenuButton {
+ id: menuButton
+
+ width: parent.height
+ height: parent.height
+ anchors.right: parent.right
+ anchors.top: parent.top
+ onButtonClicked: {
+ toolbar.buttonClicked()
+ }
+ }
+}
diff --git a/src/mobile/qml/MenuButton.qml b/src/mobile/qml/MenuButton.qml
new file mode 100644
index 0000000..b3ba458
--- /dev/null
+++ b/src/mobile/qml/MenuButton.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: menuButton
+
+ signal buttonClicked
+
+ color: "black"
+
+ BtStyle {
+ id: btStyle
+ }
+
+ Column {
+ spacing:3
+
+ Rectangle { color: "white"; width:2; height:2 }
+ Rectangle { color: "white"; width:2; height:2 }
+ Rectangle { color: "white"; width:2; height:2 }
+
+ anchors.centerIn: parent
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ menuButton.buttonClicked()
+ }
+ }
+}
diff --git a/src/mobile/qml/MenuView.qml b/src/mobile/qml/MenuView.qml
new file mode 100644
index 0000000..01b5142
--- /dev/null
+++ b/src/mobile/qml/MenuView.qml
@@ -0,0 +1,28 @@
+import QtQuick 2.1
+
+Column {
+ id: menus
+
+ width:120
+ height:20 * listModel.count
+ anchors.top: mainToolbar.bottom
+ anchors.right: mainToolbar.right
+ z: 100
+ visible: false
+
+ Repeater {
+ model: listModel
+ delegate: Rectangle {
+ width:parent.width
+ height:24
+ color: btStyle.menu
+ border.color: btStyle.menuBorder
+ border.width: 1
+ Text {
+ anchors.centerIn: parent
+ text: title
+ color: btStyle.menuText
+ }
+ }
+ }
+}
diff --git a/src/mobile/qml/Menus.qml b/src/mobile/qml/Menus.qml
new file mode 100644
index 0000000..1a9e53b
--- /dev/null
+++ b/src/mobile/qml/Menus.qml
@@ -0,0 +1,61 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: menu
+
+ property alias model: menusRepeater.model
+ property int fontPointSize: 15
+ property int menuHeight: 70
+ property int topMenuMargin: 150
+ property int leftMenuMargin: 50
+
+ signal menuSelected(string action)
+
+ visible: false
+ anchors.fill: parent
+ color: "#f0f0f0"
+
+ BtStyle {
+ id: btStyle
+ }
+
+ Component {
+ id: eachMenu
+
+ Rectangle {
+ width: menu.width
+ height: menuHeight
+ color: "white"
+ border.color: "#f0f0f0"
+ border.width: 2
+
+ Text {
+ text: title
+ font.pointSize: btStyle.uiFontPointSize
+ color: "black"
+ anchors.fill: parent
+ anchors.leftMargin: leftMenuMargin
+ verticalAlignment: Text.AlignVCenter
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ menu.menuSelected(action);
+ }
+ }
+ }
+ }
+ }
+
+ ListView {
+ id: menusRepeater
+
+ delegate: eachMenu
+ width: parent.width
+ anchors.fill: parent
+ anchors.topMargin: topMenuMargin
+
+ }
+}
+
diff --git a/src/mobile/qml/ModuleChooser.qml b/src/mobile/qml/ModuleChooser.qml
new file mode 100644
index 0000000..49d19d1
--- /dev/null
+++ b/src/mobile/qml/ModuleChooser.qml
@@ -0,0 +1,109 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: moduleChooser
+
+ property alias categoryModel: categoryView.model
+ property alias languageModel: languageView.model
+ property alias worksModel: worksView.model
+ property alias categoryIndex: categoryView.currentIndex
+ property alias languageIndex: languageView.currentIndex
+ property alias moduleIndex: worksView.currentIndex
+ property int lastCategoryIndex: 0
+ property int lastLanguageIndex: 0
+ property int spacing: 5
+ property string selectedModule: ""
+ property string selectedCategory: ""
+
+ objectName: "moduleChooser"
+ color: "lightgray"
+ border.color: "black"
+ border.width: 2
+
+ onVisibleChanged: {
+ if (visible == true) {
+ moduleInterface.updateCategoryAndLanguageModels();
+ categoryIndex = lastCategoryIndex;
+ languageIndex = lastLanguageIndex;
+ }
+ }
+
+ onCategoryIndexChanged: {
+ if (visible == true) {
+ moduleInterface.updateWorksModel();
+ }
+ }
+
+ onLanguageIndexChanged: {
+ if (visible == true) {
+ moduleInterface.updateWorksModel();
+ }
+ }
+
+ signal categoryChanged(int index);
+ signal languageChanged(int index);
+ signal moduleSelected();
+
+ ModuleInterface {
+ id: moduleInterface
+ }
+
+ Grid {
+ id: grid
+ columns: 2
+ rows: 1
+ spacing: parent.spacing
+ width: parent.width - moduleChooser.spacing
+ height: parent.height/2.5
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.margins: parent.spacing
+
+ ListTextView {
+ id: categoryView
+
+ title: "Category"
+ width: grid.width/2 - grid.spacing
+ height: grid.height
+ onItemSelected: {
+ categoryChanged(currentIndex)
+ }
+ }
+
+ ListTextView {
+ id: languageView
+
+ title: "Language"
+ width: grid.width/2 - grid.spacing
+ height: grid.height
+ onItemSelected: {
+ languageChanged(currentIndex);
+ }
+ }
+ }
+
+ ListTextView {
+ id: worksView
+
+ title: "Work"
+ width: parent.width - 2 * parent.spacing
+ anchors.top: grid.bottom
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ anchors.margins: moduleChooser.spacing
+ highlight: false
+ onItemSelected: {
+ selectedModule = moduleInterface.module(index);
+ selectedCategory = moduleInterface.category(index);
+ moduleSelected();
+ moduleChooser.visible = false;
+ }
+ }
+
+// MouseArea {
+// anchors.fill: parent
+// onClicked: moduleChooser.cancel();
+// }
+}
+
diff --git a/src/mobile/qml/Progress.qml b/src/mobile/qml/Progress.qml
new file mode 100644
index 0000000..e5f75b3
--- /dev/null
+++ b/src/mobile/qml/Progress.qml
@@ -0,0 +1,63 @@
+import QtQuick 2.1
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+import BibleTime 1.0
+
+Rectangle {
+ id: installProgress
+
+ property alias minimumValue: progressBar.minimumValue
+ property alias value: progressBar.value
+ property alias maximumValue: progressBar.maximumValue
+ property alias text: label.text
+
+ color: btStyle.buttonBackground
+ border.color: "black"
+ border.width: 5
+
+ signal cancel()
+
+ BtStyle {
+ id: btStyle
+ }
+
+ Text {
+ id: label
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: progressBar.top
+ anchors.bottomMargin: 20
+ }
+
+ ProgressBar {
+ id: progressBar
+
+ anchors.centerIn: parent
+ width: parent.width - 100
+ height: 16
+ }
+
+ Rectangle {
+ color: "white"
+ border.color: "black"
+ border.width: 1
+ width: 100
+ height:30
+ anchors.top: progressBar.bottom
+ anchors.topMargin: 20
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Text {
+ anchors.centerIn: parent
+ text: "Cancel"
+
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ cancel();
+ }
+ }
+ }
+}
diff --git a/src/mobile/qml/Settings.qml b/src/mobile/qml/Settings.qml
new file mode 100644
index 0000000..391ce4c
--- /dev/null
+++ b/src/mobile/qml/Settings.qml
@@ -0,0 +1,93 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: settings
+
+ property int finalHeight: 300
+
+ color: "white"
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: parent.height
+
+ onVisibleChanged: PropertyAnimation {
+ target: settings
+ property: "opacity"
+ from: 0
+ to: 1
+ duration: 200
+ easing.type: Easing.InOutCubic
+ }
+
+ BtStyle {
+ id: btStyle
+ }
+
+ ListModel {
+ id: settingsModel
+
+ ListElement { title: "Ui Font Size"; action: "uiSize" }
+ ListElement { title: "Window Arrangement"; action: "arrangement" }
+ }
+
+ ListView {
+ id: settingsList
+
+ anchors.fill: parent
+ anchors.topMargin: 100
+ model: settingsModel
+
+ delegate: Rectangle {
+ color: "white"
+ border.color: "lightgray"
+ border.width: 1
+ width: parent.width
+ height: children[0].height * 2.5
+
+ Text {
+ id: menuText
+ x: 40
+ anchors.verticalCenter: parent.verticalCenter
+ text: title
+ color: "black"
+ font.pointSize: btStyle.uiFontPointSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (action == "arrangement") {
+ windowArrangementMenus.visible = true;
+ settings.visible = false;
+ }
+ else if (action == "uiSize") {
+ uiFontPointSize.visible = true;
+ settings.visible = false;
+ console.log("y")
+ }
+ }
+ }
+ }
+ }
+
+ ImageButton {
+ id: backButton
+
+ icon: "leftarrow.svg"
+ height: 36
+ width: 56
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottomMargin: 8
+ visible: true
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ settings.visible = false;
+ }
+ }
+ }
+}
diff --git a/src/mobile/qml/TreeChooser.qml b/src/mobile/qml/TreeChooser.qml
new file mode 100644
index 0000000..5dc1eeb
--- /dev/null
+++ b/src/mobile/qml/TreeChooser.qml
@@ -0,0 +1,167 @@
+import QtQuick 2.1
+
+Rectangle {
+ id: treeChooser
+
+ property ListModel model: ListModel {
+ }
+ property string path: ""
+ property int pathCount: 0
+
+ color: "white"
+ border.width: 2
+ border.color: "black"
+
+ signal back()
+ signal next(string childText)
+ signal select(string childText)
+
+ Rectangle {
+ id: pathArea
+
+ border.color: "black"
+ border.width: 0
+ color: "white"
+
+ height: {20 * pathCount }
+ anchors.right: parent.right
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.margins: 4
+ visible: path.length > 0
+
+ function splitPath(path) {
+ var pathList = path.split("/");
+ var newPath = "";
+ var space = "";
+ var count = pathList.length;
+ treeChooser.pathCount = count;
+ // pathList[0] is empty
+ for (var i=1; i< count; ++i) {
+ var pathI = pathList[i];
+ newPath += space + pathI + "\n";
+ space += " ";
+ }
+ return newPath;
+ }
+
+ ImageButton {
+ id: backButton
+
+ icon: "leftarrow.svg"
+ height: 36
+ width: 56
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right : parent.right
+ anchors.topMargin: 2
+ visible: true
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ treeChooser.back();
+ }
+ }
+ }
+
+ Text {
+ id: pathText
+
+ text: pathArea.splitPath(treeChooser.path)
+ font.pointSize: 12
+ height: parent.height
+// width: parent.width - backButton.width -50
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: backButton.left
+ anchors.leftMargin: 10
+ elide: Text.ElideRight
+ }
+ }
+
+ ListView {
+ id: listView
+
+ function next(index, name) {
+ treeChooser.next(name);
+ }
+
+ function select(index, name) {
+ treeChooser.select(name);
+ }
+
+ anchors.top: pathArea.bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.topMargin: 30
+ anchors.leftMargin: 4
+ anchors.rightMargin: 4
+ anchors.bottomMargin: 4
+ boundsBehavior: Flickable.StopAtBounds
+ width: pathArea.width
+ model: treeChooser.model
+ delegate:
+ Rectangle {
+ id: entry
+
+ property string action: ""
+
+
+ border.color: "#eeeeee"
+ border.width: 1
+ width: parent.width
+ height: 40
+
+ Text {
+ id: entryText
+
+ font.pointSize: 12
+// anchors.fill: entry
+ anchors.top: entry.top
+ anchors.left: entry.left
+ anchors.right: entry.right
+ width: 340
+ anchors.leftMargin: 10
+ anchors.rightMargin: 10
+ anchors.topMargin: 10
+ text: name
+ elide: Text.ElideRight
+ }
+
+ ImageButton {
+ id: imageButton
+ icon: "rightarrow.svg"
+
+ height: parent.height-4
+ width: 56
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.topMargin: 2
+ visible: childcount > 0
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ listView.currentIndex = index
+ listView.next(index, name)
+ }
+ }
+ }
+
+ MouseArea {
+ anchors.left: parent.left
+ anchors.right: imageButton.left
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ onClicked: {
+ listView.currentIndex = index
+ listView.select(index, name)
+ }
+ }
+ }
+
+ snapMode: ListView.SnapToItem
+ focus: true
+ }
+}
diff --git a/src/mobile/qml/Window.qml b/src/mobile/qml/Window.qml
new file mode 100644
index 0000000..a14131f
--- /dev/null
+++ b/src/mobile/qml/Window.qml
@@ -0,0 +1,178 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: windowView
+
+ property string title: toolbar.title
+
+ function setModule(module) {
+ btWindowInterface.moduleName = module;
+ }
+
+ function contextMenus() {
+// contextMenu.visible = true;
+ }
+
+ color: "black"
+
+ BtWindowInterface {
+ id: btWindowInterface
+ }
+
+ BtStyle {
+ id:btStyle
+ }
+
+ Rectangle {
+ id: toolbar
+
+ property string title: btWindowInterface.moduleName + " (" + btWindowInterface.reference + ")"
+
+ width: parent.width
+ height: 36
+ color: btStyle.toolbarColor
+ border.width: 1
+ border.color: "black"
+
+ Rectangle {
+ id: moduleDisplay
+
+ width: text.width +10
+ radius:btStyle.buttonRadius
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.topMargin: 4
+ anchors.leftMargin: 5
+ anchors.bottomMargin: 4
+ color: btStyle.toolbarButton
+ border.color: btStyle.buttonBorder
+ border.width: 1
+
+ Text {
+ id: text
+
+ anchors.centerIn: parent
+ anchors.leftMargin: 4
+ anchors.rightMargin: 4
+ font.pointSize: btStyle.uiFontPointSize
+ elide: Text.ElideMiddle
+ color: btStyle.toolbarButtonText
+ text: btWindowInterface.moduleName
+ }
+
+ MouseArea {
+ id: moduleMouseArea
+
+ anchors.fill: parent
+ onClicked: {
+ btWindowInterface.changeModule();
+ }
+ }
+ }
+
+
+ Rectangle {
+ id: referenceDisplay
+
+ width: {
+ var w1 = 300
+ var w2 = toolbar.width - moduleDisplay.width;
+ var w = Math.min(w1,w2);
+ return w - 15;
+ }
+ radius: btStyle.buttonRadius
+ anchors.left: moduleDisplay.right
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.topMargin: 4
+ anchors.bottomMargin: 4
+ anchors.leftMargin: 5
+ color: btStyle.toolbarButton
+ border.color: btStyle.buttonBorder
+ border.width: 1
+
+ Text {
+ id: referenceText
+ anchors.centerIn: parent
+ anchors.leftMargin: 6
+ anchors.rightMargin: 4
+ width: referenceDisplay.width - 4
+ font.pointSize: btStyle.uiFontPointSize
+ elide: Text.ElideMiddle
+ color: btStyle.toolbarButtonText
+ text: btWindowInterface.reference
+ }
+
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ onClicked: {
+ btWindowInterface.changeReference();
+ }
+ }
+ }
+
+ }
+
+ Rectangle {
+ id: mainTextView
+
+ color: "white"
+ anchors.top: toolbar.bottom
+ anchors.left: windowView.left
+ anchors.right: windowView.right
+ anchors.bottom: windowView.bottom
+
+ ListView {
+ id: listView
+
+ clip: true
+ anchors.fill: parent
+ anchors.leftMargin: 8
+ anchors.rightMargin: 8
+ model: btWindowInterface.textModel
+ currentIndex: btWindowInterface.currentModelIndex
+ delegate: Text {
+ text: "<font color=\"blue\">" + ref + "</font> " + line
+ width: parent.width
+ color: "black"
+ font.pointSize: btStyle.textFontPointSize
+ wrapMode: Text.WordWrap
+ }
+
+ MouseArea {
+
+ anchors.fill: parent
+ onDoubleClicked: {
+ windowView.contextMenus();
+ }
+
+ onPressAndHold: {
+ windowView.contextMenus();
+
+ }
+ }
+ }
+ }
+
+ ListModel {
+ id: contextMenuModel
+
+ ListElement { title: "Text Font Size"; action: "textSize" }
+ }
+
+ ContextMenu {
+ id: contextMenu
+
+ function doAction(action) {
+ }
+
+ model: contextMenuModel
+ visible: false
+ Component.onCompleted: contextMenu.accepted.connect(contextMenu.doAction)
+ }
+
+}
diff --git a/src/mobile/qml/WindowManager.qml b/src/mobile/qml/WindowManager.qml
new file mode 100644
index 0000000..3a66219
--- /dev/null
+++ b/src/mobile/qml/WindowManager.qml
@@ -0,0 +1,291 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+
+Rectangle {
+ id: windowArea
+
+ property var windows: []
+ property int single: 0
+ property int tabLayout: 1
+ property int autoTile: 2
+ property int autoTileHor: 3
+ property int autoTileVer: 4
+ property int windowLayout: single
+
+ function setCurrentTabbedWindow(index) {
+ tabbedWindows.current = index;
+ }
+
+ function setWindowArrangement(arrangement) {
+ if (arrangement < single || arrangement > autoTileVer)
+ return;
+ windowLayout = arrangement;
+ layoutWindows();
+ }
+
+ function createWindowMenus() {
+ windowsModel.clear();
+ for (var i=0; i<windows.length; ++i) {
+ var window = windows[i];
+ windowsModel.append (
+ { title: window.title, action: i.toString() }
+ )
+ }
+ windowTitlesMenus.model = windowsModel
+ windowTitlesMenus.visible = true;
+ }
+
+
+ function newWindow() {
+ moduleChooser.moduleSelected.connect(openWindowSlot);
+ moduleChooser.visible = true;
+ }
+
+ function openWindowSlot() {
+ moduleChooser.moduleSelected.disconnect(openWindowSlot);
+ openWindow(moduleChooser.selectedCategory, moduleChooser.selectedModule)
+ }
+
+ function openWindow(category, module) {
+ if (category == "Bibles")
+ component = Qt.createComponent("Window.qml");
+ else if (category == "Commentaries")
+ component = Qt.createComponent("Window.qml");
+ else if (category == "Books")
+ component = Qt.createComponent("Window.qml");
+ else {
+ console.log(category, " are not yet supported.");
+ return;
+ }
+
+ window = component.createObject(null, {"width": 250, "height": 200});
+ window.setModule(module);
+
+ if (window == null) {
+ // Error Handling
+ console.log("Error creating object");
+ }
+ else {
+ windows.push(window)
+ layoutWindows();
+ var curWindow = windows.length -1;
+ selectWindow(curWindow);
+ }
+ }
+
+ function layoutTiles(rows, columns)
+ {
+ gridWindows.columns = columns;
+ gridWindows.rows = rows;
+ var width = gridWindows.width/columns -2;
+ var height = gridWindows.height/rows -2;
+
+ for (var i=0; i<windows.length; ++i) {
+ var window = windows[i];
+ window.anchors.fill = undefined
+ window.height = height;
+ window.width = width;
+ window.parent = gridWindows;
+ }
+ }
+
+ function arrangeSingleWindow() {
+ tabbedWindows.z = 1;
+ tabbedWindows.tabVisible = false;
+ for (var i=0; i<windows.length; ++i) {
+ var window = windows[i];
+ window.parent = tabbedWindowsStack;
+ window.anchors.fill = tabbedWindowsStack
+ }
+ }
+
+ function arrangeTabbedWindows() {
+ tabbedWindows.z = 1;
+ tabbedWindows.tabVisible = true;
+ for (var i=0; i<windows.length; ++i) {
+ var window = windows[i];
+ window.parent = tabbedWindowsStack;
+ window.anchors.fill = tabbedWindowsStack
+ }
+ }
+
+ function arrangeTiledWindows() {
+ gridWindows.z = 1;
+ var columns = 1;
+ var rows = 1;
+ var count = windows.length;
+
+ if (windowLayout == autoTile) {
+ if (count > 1) {
+ columns = 2
+ rows = Math.floor((count+1)/2);
+ }
+ }
+ else if (windowLayout == autoTileHor)
+ {
+ rows = count;
+ }
+ else if (windowLayout == autoTileVer)
+ {
+ columns = count;
+ }
+ layoutTiles(rows, columns);
+ }
+
+ function layoutWindows() {
+ tabbedWindows.z = -2;
+ gridWindows.z = -3;
+
+ if (windowLayout == single) {
+ arrangeSingleWindow();
+ }
+ else if (windowLayout == tabLayout) {
+ arrangeTabbedWindows();
+ }
+ else {
+ arrangeTiledWindows();
+ }
+ }
+
+ function selectWindow(n) {
+ if (windowLayout == tabLayout || windowLayout == single) {
+ tabbedWindows.current = n;
+ }
+ }
+
+// anchors.top: spacer.bottom
+// anchors.left: parent.left
+// anchors.right: parent.right
+// anchors.bottom: parent.bottom
+// color: "#646464"
+
+ Grid {
+ id: gridWindows
+
+ objectName: "gridWindows"
+ anchors.fill: parent
+ columns: 2
+ spacing: 2
+ z: 2
+ }
+
+ Item {
+ id: tabbedWindows
+
+ default property alias content: tabbedWindowsStack.children
+ property bool tabVisible: true
+ property int current: 0
+
+ function changeTabs() {
+ setOpacities();
+ }
+
+ function setOpacities() {
+ for (var i = 0; i < tabbedWindowsStack.children.length; ++i) {
+ tabbedWindowsStack.children[i].z = (i == current ? 1 : 0)
+ }
+ }
+
+ objectName: "tabbedWindows"
+ anchors.fill: parent
+ onCurrentChanged: changeTabs()
+ Component.onCompleted: changeTabs()
+
+ Row {
+ id: header
+
+ objectName: "header"
+
+ Repeater {
+ id: tabRepeater
+
+ function setColors() {
+ if (tabbedWindows.current == tabbedWindowsStack.index) {
+ tabImage.color = btStyle.windowTabSelected
+ tabText.color = btStyle.windowTabTextSelected
+ }
+ else {
+ tabImage.color = btStyle.windowTab
+ tabText.color = btStyle.windowTabText
+ }
+ }
+
+ model: tabbedWindowsStack.children.length
+ delegate: Rectangle {
+ id: tab
+
+ function calculateTabWidth() {
+ var tabWidth = (tabbedWindows.width) / tabbedWindowsStack.children.length;
+ return tabWidth;
+ }
+
+ visible: tabbedWindows.tabVisible
+ //width: (tabbedWindows.width) / tabbedWindowsStack.children.length;
+ width: {
+ calculateTabWidth()
+ }
+ height: 36
+
+ Rectangle {
+ id: tabBorder
+ width: parent.width; height: 1
+ anchors { bottom: parent.bottom; bottomMargin: 1 }
+ color: "#acb2c2"
+ }
+
+ Rectangle {
+ id: tabImage
+
+ anchors { fill: parent; leftMargin: 8; topMargin: 4; rightMargin: 8 }
+ color: {
+ if (tabbedWindows.current == index)
+ return btStyle.windowTabSelected
+ else
+ return btStyle.windowTab
+ }
+ border.color: btStyle.windowTab
+ border.width: 2
+
+ Text {
+ id: tabText
+
+ horizontalAlignment: Qt.AlignHCenter;
+ verticalAlignment: Qt.AlignVCenter
+ anchors.fill: parent
+ anchors.topMargin: 6
+ font.pointSize: btStyle.uiFontPointSize -3
+ text: tabbedWindowsStack.children[index].title
+ elide: Text.ElideLeft
+ color: {
+ if (tabbedWindows.current == index)
+ return btStyle.windowTabTextSelected
+ else
+ return btStyle.windowTabText
+ }
+ }
+ }
+
+ MouseArea {
+ id: tabMouseArea
+
+ anchors.fill: parent
+ onClicked: {
+ tabbedWindows.current = index
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ id: tabbedWindowsStack
+
+ objectName: "tabbedWindowsStack"
+ width: parent.width
+ anchors.top: header.bottom;
+ anchors.bottom: tabbedWindows.bottom
+ }
+ }
+
+}
diff --git a/src/mobile/qml/checkmark.svg b/src/mobile/qml/checkmark.svg
new file mode 100644
index 0000000..07a3ad8
--- /dev/null
+++ b/src/mobile/qml/checkmark.svg
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="450" height="400" viewBox="85 145 450 400"
+ sodipodi:version="0.32"
+ inkscape:version="0.45"
+ sodipodi:docname="checkmark.svg">
+ <metadata>
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <path
+ style="fill:#5fd35f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 508.74477,226.99015 C 459.42189,193.17234 436.08559,163.59563 436.08559,163.59563 C 344.99984,217.26626 248.26757,407.83719 248.26757,407.83719 C 202.93454,344.01939 157.35384,326.21932 157.35384,326.21932 C 136.86236,353.60112 101.54091,390.09316 101.54091,390.09316 C 183.924,412.28062 253.07323,493.70015 253.07323,493.70015 C 402.5571,259.01322 508.74477,226.99015 508.74477,226.99015 z "
+ sodipodi:nodetypes="ccccccc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.2;fill:#999999;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0"
+ sodipodi:cx="238.57143"
+ sodipodi:cy="529.50507"
+ sodipodi:rx="64.285713"
+ sodipodi:ry="7.1428571"
+ d="M 302.03011,528.36301 A 64.285713,7.1428571 0 1 1 301.97855,528.32818"
+ sodipodi:start="6.1226078"
+ sodipodi:end="12.400852"
+ sodipodi:open="true"
+ transform="translate(8.5714285,-11.428571)" />
+ <path
+ style="opacity:0.27777782;fill:#5fd35f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 518.74479,227.27587 C 469.42191,193.45806 446.08561,163.88135 446.08561,163.88135 C 354.99986,217.55198 258.26759,408.12291 258.26759,408.12291 C 212.93456,344.30511 167.35386,326.50504 167.35386,326.50504 C 146.86238,353.88684 111.54093,390.37888 111.54093,390.37888 C 193.92402,412.56634 263.07325,493.98587 263.07325,493.98587 C 412.55712,259.29894 518.74479,227.27587 518.74479,227.27587 z "
+ sodipodi:nodetypes="ccccccc" />
+</svg>
diff --git a/src/mobile/qml/leftarrow.svg b/src/mobile/qml/leftarrow.svg
new file mode 100644
index 0000000..6143c87
--- /dev/null
+++ b/src/mobile/qml/leftarrow.svg
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="900"
+ height="900"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="rightarrow.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.74333333"
+ inkscape:cx="450"
+ inkscape:cy="450"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="in"
+ inkscape:window-width="1600"
+ inkscape:window-height="868"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2985"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-152.3622)">
+ <path
+ sodipodi:type="star"
+ style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path2995"
+ sodipodi:sides="3"
+ sodipodi:cx="460"
+ sodipodi:cy="420"
+ sodipodi:r1="380.52594"
+ sodipodi:r2="190.26299"
+ sodipodi:arg1="0"
+ sodipodi:arg2="1.0471976"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 840.52594,420 -570.78891,329.54513 0,-659.090261 z"
+ transform="matrix(-1,0,0,-1,1014.9543,1026.7074)"
+ inkscape:transform-center-y="-2.9985352e-05"
+ inkscape:transform-center-x="95.131485" />
+ </g>
+</svg>
diff --git a/src/mobile/qml/main.qml b/src/mobile/qml/main.qml
new file mode 100644
index 0000000..d7597b1
--- /dev/null
+++ b/src/mobile/qml/main.qml
@@ -0,0 +1,270 @@
+import QtQuick 2.1
+import BibleTime 1.0
+
+Rectangle {
+ id: root
+
+ property int opacitypopup: 0
+ property QtObject component: null;
+ property Item window: null;
+
+ ListModel {
+ id: windowsModel
+
+ ListElement { title: ""; action: "" }
+ }
+
+ function installModules() {
+ installManager.openChooser();
+ }
+
+// width: 1280 // Nexus 7 (2012)
+// height: 800
+
+ width: 480 // Phone
+ height: 800
+
+ rotation: 0
+
+ MainToolbar {
+ id: mainToolbar
+
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.right: parent.right
+ height: 30
+ onButtonClicked: {
+ mainMenus.visible = ! mainMenus.visible;
+ }
+ }
+
+ Rectangle {
+ id: spacer
+
+ anchors.top: mainToolbar.bottom
+ height:2
+ width: parent.width
+ color: "#646464"
+ }
+
+ WindowManager {
+ id: windowManager
+
+ anchors.top: spacer.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ color: "#646464"
+
+ }
+
+ Settings {
+ id: settings
+
+ visible: false;
+ }
+
+ GridChooser {
+ id: gridChooser
+
+ objectName: "gridChooser"
+ width: parent.width
+ height: parent.height
+ visible: false
+ }
+
+ BtStyle {
+ id: btStyle
+ }
+
+ ModuleChooser {
+ id: moduleChooser
+
+ objectName: "moduleChooser"
+ visible: false
+ width: Math.min(parent.height, parent.width);
+ height: parent.height
+ anchors.centerIn: parent
+ }
+
+ TreeChooser {
+ id: treeChooser
+
+ objectName: "treeChooser"
+ width:480
+ height: parent.height
+ anchors.top: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ path: ""
+ visible: false
+ z: 100
+ }
+
+ InstallManager {
+ id: installManager
+ }
+
+ InstallManagerChooser {
+ id: installManagerChooser
+
+ objectName: "installManagerChooser"
+ width: Math.min(parent.height, parent.width);
+ height: parent.height
+ anchors.centerIn: parent
+ anchors.top: parent.top
+ visible: false
+ }
+
+ Progress {
+ id: progress
+
+ objectName: "progress"
+ value: 0.25
+ minimumValue: 0
+ maximumValue: 1
+ width:550
+ height: 200
+ anchors.centerIn: parent
+ anchors.top: parent.top
+ visible: false
+ }
+
+ ListModel {
+ id: mainMenusModel
+
+ ListElement { title: QT_TR_NOOP("New Window"); action: "newWindow" }
+ ListElement { title: QT_TR_NOOP("View Window"); action: "windows" }
+ ListElement { title: QT_TR_NOOP("Text Font Size"); action: "textFontSize"}
+ ListElement { title: QT_TR_NOOP("User Interface Font Size");action: "uiFontSize"}
+
+ //ListElement { title: QT_TR_NOOP("Settings"); action: "settings" }
+ ListElement { title: QT_TR_NOOP("Bookshelf Manager"); action: "install" }
+ // ListElement { title: QT_TR_NOOP("Gnome Style"); action: "gnomeStyle" }
+ // ListElement { title: QT_TR_NOOP("Android Style"); action: "androidStyle" }
+ }
+
+ Menus {
+ id: mainMenus
+
+ Component.onCompleted: menuSelected.connect(mainMenus.doAction)
+
+ function doAction(action) {
+ mainMenus.visible = false;
+ if (action == "newWindow") {
+ windowManager.newWindow();
+ }
+ else if (action == "windows") {
+ windowManager.createWindowMenus();
+ }
+ else if (action == "gnomeStyle") {
+ btStyle.setStyle(1)
+ }
+ else if (action == "androidStyle") {
+ btStyle.setStyle(2)
+ }
+ else if (action == "install") {
+ installModules();
+ }
+ else if (action == "settings") {
+ settings.visible = true;
+ }
+ else if (action == "textFontSize") {
+ textFontPointSize.visible = true;
+ }
+ else if (action == "uiFontSize") {
+ uiFontPointSize.visible = true;
+ }
+
+ }
+
+ model: mainMenusModel
+ topMenuMargin: 100
+ }
+
+ ListModel {
+ id: windowArrangementModel
+
+ ListElement { title: QT_TR_NOOP("Single"); action: "single" }
+ ListElement { title: QT_TR_NOOP("Tabbed"); action: "tabbed" }
+ ListElement { title: QT_TR_NOOP("Auto-tile"); action: "autoTile" }
+ ListElement { title: QT_TR_NOOP("Auto-tile horizontally"); action: "autoTileHor" }
+ ListElement { title: QT_TR_NOOP("Auto-tile vertically"); action: "autoTileVer" }
+ }
+
+ Menus {
+ id: windowArrangementMenus
+
+ Component.onCompleted: menuSelected.connect(windowArrangementMenus.doAction)
+
+ function doAction(action) {
+ windowArrangementMenus.visible = false;
+ if (action == "single") {
+ windowManager.setWindowArrangement(windowManager.single);
+ }
+ else if (action == "tabbed") {
+ windowManager.setWindowArrangement(windowManager.tabLayout);
+ }
+ else if (action == "autoTile") {
+ windowManager.setWindowArrangement(windowManager.autoTile);
+ }
+ else if (action == "autoTileHor") {
+ windowManager.setWindowArrangement(windowManager.autoTileHor);
+ }
+ else if (action == "autoTileVer") {
+ windowManager.setWindowArrangement(windowManager.autoTileVer);
+ }
+ }
+
+ model: windowArrangementModel
+ }
+
+ Menus {
+ id: windowTitlesMenus
+
+ model: windowsModel
+ visible: false
+ Component.onCompleted: menuSelected.connect(windowTitlesMenus.doAction)
+
+ function doAction(action) {
+ windowTitlesMenus.visible = false;
+ var index = Number(action)
+ windowManager.setCurrentTabbedWindow(index);
+ }
+ }
+
+ FontSizeSlider {
+ id: uiFontPointSize
+ visible: false
+ title: "User Interface Font Size"
+
+ onVisibleChanged: {
+ if (visible)
+ {
+ uiFontPointSize.current = btStyle.uiFontPointSize;
+ uiFontPointSize.previous = btStyle.uiFontPointSize;
+ }
+ }
+
+ onAccepted: {
+ btStyle.uiFontPointSize = pointSize
+ }
+ }
+
+ FontSizeSlider {
+ id: textFontPointSize
+ visible: false
+ title: "Text Font Size"
+
+ onVisibleChanged: {
+ if (visible)
+ {
+ textFontPointSize.current = btStyle.textFontPointSize;
+ textFontPointSize.previous = btStyle.textFontPointSize;
+ }
+ }
+
+ onAccepted: {
+ btStyle.textFontPointSize = pointSize;
+ }
+ }
+}
diff --git a/src/mobile/qml/rightarrow.svg b/src/mobile/qml/rightarrow.svg
new file mode 100644
index 0000000..e9fd5d1
--- /dev/null
+++ b/src/mobile/qml/rightarrow.svg
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="900"
+ height="900"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="New document 1">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.49497475"
+ inkscape:cx="21.09998"
+ inkscape:cy="433.47351"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="in"
+ inkscape:window-width="1600"
+ inkscape:window-height="868"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2985"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-152.3622)">
+ <path
+ sodipodi:type="star"
+ style="fill:#4d4d4d;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+ id="path2995"
+ sodipodi:sides="3"
+ sodipodi:cx="460"
+ sodipodi:cy="420"
+ sodipodi:r1="380.52594"
+ sodipodi:r2="190.26299"
+ sodipodi:arg1="0"
+ sodipodi:arg2="1.0471976"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 840.52594,420 -570.78891,329.54513 0,-659.090261 z"
+ transform="translate(-101.01525,164.48403)"
+ inkscape:transform-center-x="-95.131488" />
+ </g>
+</svg>
diff --git a/src/mobile/qml/tab.png b/src/mobile/qml/tab.png
new file mode 100644
index 0000000..ad80216
--- /dev/null
+++ b/src/mobile/qml/tab.png
Binary files differ