1/*********
2*
3* In the name of the Father, and of the Son, and of the Holy Spirit.
4*
5* This file is part of BibleTime's source code, http://www.bibletime.info/.
6*
7* Copyright 1999-2016 by the BibleTime developers.
8* The BibleTime source code is licensed under the GNU General Public License
9* version 2.0.
10*
11**********/
12
13import QtQuick 2.2
14import BibleTime 1.0
15
16Rectangle {
17    id: toolbar
18
19    color: btStyle.toolbarColor
20    z:0
21    onEnabledChanged: {
22        menuButton.visible = toolbar.enabled
23        searchIconQml.visible = toolbar.enabled
24    }
25
26    signal buttonClicked
27    signal searchClicked
28
29    BtStyle {
30        id: btStyle
31    }
32
33    Image {
34        id: logo
35
36        width: parent.height-10
37        height: parent.height-10
38        anchors.left: parent.left
39        anchors.top: parent.top
40        anchors.topMargin: 5
41        anchors.bottomMargin: 5
42        anchors.leftMargin: 10
43        source: "qrc:/share/bibletime/icons/bibletime.svg"
44    }
45
46    Text {
47        id: title
48        color: btStyle.toolbarTextColor
49        font.pointSize: btStyle.uiFontPointSize
50        anchors.left: logo.right
51        anchors.top: parent.top
52        anchors.bottom: parent.bottom
53        anchors.leftMargin: 20
54        verticalAlignment: Text.AlignVCenter
55        text: qsTranslate("MainToolbar", "BibleTime Mobile")
56    }
57
58    MenuButton {
59        id: menuButton
60
61        width: parent.height
62        height: parent.height
63        anchors.right: parent.right
64        anchors.top: parent.top
65        foreground: btStyle.toolbarTextColor
66        background: btStyle.toolbarColor
67        onButtonClicked: {
68            toolbar.buttonClicked()
69        }
70    }
71
72    SearchIcon {
73        id: searchIconQml
74
75        width: parent.height
76        height: parent.height
77        anchors.right: menuButton.left
78        anchors.top: parent.top
79        anchors.rightMargin: 0
80        strokeStyle: btStyle.toolbarTextColor
81
82        MouseArea {
83            anchors.fill: parent
84            onClicked: {
85                toolbar.searchClicked()
86            }
87        }
88    }
89}
90