~ci-train-bot/webbrowser-app/webbrowser-app-ubuntu-yakkety-landing-058

« back to all changes in this revision

Viewing changes to src/Chrome.qml

  • Committer: Olivier Tilloy
  • Date: 2013-01-11 12:01:22 UTC
  • Revision ID: olivier.tilloy@canonical.com-20130111120122-5gu1sm4byakne8zh
Initial commit: very basic web browser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2013 Canonical Ltd.
 
3
 *
 
4
 * This file is part of kalossi-browser.
 
5
 *
 
6
 * kalossi-browser is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * kalossi-browser is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
import QtQuick 2.0
 
20
import Ubuntu.Components 0.1
 
21
 
 
22
Item {
 
23
    id: chrome
 
24
 
 
25
    property alias url: addressBar.text
 
26
    signal urlValidated(url url)
 
27
 
 
28
    Rectangle {
 
29
        anchors.fill: parent
 
30
        color: "white"
 
31
        opacity: 0.9
 
32
    }
 
33
 
 
34
    Row {
 
35
        id: buttons
 
36
 
 
37
        anchors.top: parent.top
 
38
        anchors.bottom: parent.bottom
 
39
        anchors.left: parent.left
 
40
        anchors.margins: units.gu(2)
 
41
        spacing: units.gu(2)
 
42
 
 
43
        Button {
 
44
            text: "⊲"
 
45
            width: units.gu(6)
 
46
        }
 
47
        Button {
 
48
            text: "⊳"
 
49
            width: units.gu(6)
 
50
        }
 
51
        Button {
 
52
            text: "✩"
 
53
            width: units.gu(6)
 
54
        }
 
55
        Button {
 
56
            text: "↻"
 
57
            width: units.gu(6)
 
58
        }
 
59
    }
 
60
 
 
61
    TextField {
 
62
        id: addressBar
 
63
 
 
64
        anchors.left: buttons.right
 
65
        anchors.right: parent.right
 
66
        anchors.top: parent.top
 
67
        anchors.bottom: parent.bottom
 
68
        anchors.margins: units.gu(2)
 
69
 
 
70
        onAccepted: chrome.urlValidated(text)
 
71
    }
 
72
}