~osomon/ubuntu-ui-extras/revert-changed-tests

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/Extras/Browser/ActivityView.qml

  • Committer: Ugo Riboni
  • Date: 2013-06-25 13:51:18 UTC
  • Revision ID: ugo.riboni@canonical.com-20130625135118-scs2wpej1kyg3fc1
Merge changes to Browser.qml related to tabs support, except autopilot tests.

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 webbrowser-app.
 
5
 *
 
6
 * webbrowser-app 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
 * webbrowser-app 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
    property alias tabsModel: tabsList.model
 
24
 
 
25
    signal newTabRequested()
 
26
    signal switchToTabRequested(int index)
 
27
    signal closeTabRequested(int index)
 
28
 
 
29
    MouseArea {
 
30
        // Prevent mouse/touch events from propagating to the webview below.
 
31
        anchors.fill: parent
 
32
        hoverEnabled: true
 
33
        onWheel: {}
 
34
    }
 
35
 
 
36
    Header {
 
37
        id: header
 
38
        title: tabs.selectedTab.title
 
39
    }
 
40
 
 
41
    Tabs {
 
42
        id: tabs
 
43
 
 
44
        anchors {
 
45
            fill: undefined
 
46
            top: header.bottom
 
47
            topMargin: units.dp(-1)
 
48
            left: parent.left
 
49
            right: parent.right
 
50
            bottom: parent.bottom
 
51
        }
 
52
 
 
53
        Tab {
 
54
            title: i18n.tr("Activity")
 
55
 
 
56
            visible: true
 
57
 
 
58
            Item {
 
59
                anchors.fill: parent
 
60
                opacity: 0.95
 
61
 
 
62
                Rectangle {
 
63
                    color: "white"
 
64
                    anchors {
 
65
                        top: parent.top
 
66
                        left: parent.left
 
67
                        right: parent.right
 
68
                        bottom: tabsList.top
 
69
                    }
 
70
                }
 
71
 
 
72
                TabsList {
 
73
                    id: tabsList
 
74
 
 
75
                    anchors {
 
76
                        left: parent.left
 
77
                        right: parent.right
 
78
                        bottom: parent.bottom
 
79
                    }
 
80
                    height: units.gu(18)
 
81
 
 
82
                    onNewTabClicked: newTabRequested()
 
83
                    onSwitchToTabClicked: switchToTabRequested(index)
 
84
                    onTabRemoved: closeTabRequested(index)
 
85
                }
 
86
            }
 
87
        }
 
88
    }
 
89
}