diff options
Diffstat (limited to 'src/mobile/qml/TreeChooser.qml')
-rw-r--r-- | src/mobile/qml/TreeChooser.qml | 70 |
1 files changed, 48 insertions, 22 deletions
diff --git a/src/mobile/qml/TreeChooser.qml b/src/mobile/qml/TreeChooser.qml index 5dc1eeb..d7eb6c9 100644 --- a/src/mobile/qml/TreeChooser.qml +++ b/src/mobile/qml/TreeChooser.qml @@ -1,4 +1,16 @@ -import QtQuick 2.1 +/********* +* +* In the name of the Father, and of the Son, and of the Holy Spirit. +* +* This file is part of BibleTime's source code, http://www.bibletime.info/. +* +* Copyright 1999-2016 by the BibleTime developers. +* The BibleTime source code is licensed under the GNU General Public License +* version 2.0. +* +**********/ + +import QtQuick 2.2 Rectangle { id: treeChooser @@ -8,22 +20,29 @@ Rectangle { property string path: "" property int pathCount: 0 - color: "white" + color: btStyle.textBackgroundColor border.width: 2 - border.color: "black" + border.color: btStyle.textColor signal back() signal next(string childText) signal select(string childText) + Keys.onReleased: { + if ((event.key == Qt.Key_Back || event.key == Qt.Key_Escape) && treeChooser.visible == true) { + event.accepted = true; + treeChooser.visible = false; + } + } + Rectangle { id: pathArea border.color: "black" border.width: 0 - color: "white" + color: btStyle.textBackgroundColor - height: {20 * pathCount } + height: btStyle.uiFontPointSize * (5 + pathCount *3); anchors.right: parent.right anchors.left: parent.left anchors.top: parent.top @@ -45,15 +64,19 @@ Rectangle { return newPath; } - ImageButton { + LeftArrow { id: backButton - icon: "leftarrow.svg" - height: 36 - width: 56 + height: { + var pixel = btStyle.pixelsPerMillimeterY * 8; + var uiFont = btStyle.uiFontPointSize * 4.5; + return Math.max(pixel, uiFont); + } + width: height anchors.verticalCenter: parent.verticalCenter anchors.right : parent.right anchors.topMargin: 2 + color: btStyle.textColor visible: true MouseArea { @@ -68,14 +91,13 @@ Rectangle { id: pathText text: pathArea.splitPath(treeChooser.path) - font.pointSize: 12 - height: parent.height -// width: parent.width - backButton.width -50 + height: btStyle.uiFontPointSize * 5; anchors.top: parent.top anchors.left: parent.left anchors.right: backButton.left anchors.leftMargin: 10 elide: Text.ElideRight + color: btStyle.textColor } } @@ -101,23 +123,26 @@ Rectangle { boundsBehavior: Flickable.StopAtBounds width: pathArea.width model: treeChooser.model - delegate: - Rectangle { + + delegate: Rectangle { id: entry property string action: "" - + color: btStyle.textBackgroundColor border.color: "#eeeeee" border.width: 1 width: parent.width - height: 40 + height: { + var pixel = btStyle.pixelsPerMillimeterY * 8; + var uiFont = btStyle.uiFontPointSize * 4.5; + return Math.max(pixel, uiFont); + } Text { id: entryText - font.pointSize: 12 -// anchors.fill: entry + font.pointSize: btStyle.uiFontPointSize anchors.top: entry.top anchors.left: entry.left anchors.right: entry.right @@ -127,17 +152,18 @@ Rectangle { anchors.topMargin: 10 text: name elide: Text.ElideRight + color: btStyle.textColor } - ImageButton { + RightArrow { id: imageButton - icon: "rightarrow.svg" - height: parent.height-4 - width: 56 + height: entry.height; + width: entry.height; anchors.right: parent.right anchors.top: parent.top anchors.topMargin: 2 + color: btStyle.textColor visible: childcount > 0 MouseArea { |