~ubuntu-branches/ubuntu/saucy/webbrowser-app/saucy-proposed

« back to all changes in this revision

Viewing changes to src/app/ActivityView.qml

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2013-07-31 10:35:29 UTC
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20130731103529-y3pnb53u111mpqep
Tags: upstream-0.22+13.10.20130731.1
ImportĀ upstreamĀ versionĀ 0.22+13.10.20130731.1

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
    id: activityView
 
24
 
 
25
    property alias tabsModel: timelineView.tabsModel
 
26
    property alias historyModel: timelineView.historyModel
 
27
 
 
28
    signal historyEntryRequested(url url)
 
29
    signal newTabRequested()
 
30
    signal switchToTabRequested(int index)
 
31
    signal closeTabRequested(int index)
 
32
 
 
33
    onVisibleChanged: {
 
34
        if (visible) {
 
35
            timelineView.resetPositionRequested()
 
36
        }
 
37
    }
 
38
 
 
39
    Header {
 
40
        id: header
 
41
        title: tabs.selectedTab.title
 
42
    }
 
43
 
 
44
    Tabs {
 
45
        id: tabs
 
46
 
 
47
        anchors {
 
48
            fill: undefined
 
49
            top: header.bottom
 
50
            topMargin: units.dp(-1)
 
51
            left: parent.left
 
52
            right: parent.right
 
53
            bottom: parent.bottom
 
54
        }
 
55
 
 
56
        Tab {
 
57
            title: i18n.tr("Activity")
 
58
 
 
59
            visible: true
 
60
 
 
61
            TimelineView {
 
62
                id: timelineView
 
63
 
 
64
                anchors.fill: parent
 
65
 
 
66
                onNewTabRequested: activityView.newTabRequested()
 
67
                onSwitchToTabRequested: activityView.switchToTabRequested(index)
 
68
                onCloseTabRequested: activityView.closeTabRequested(index)
 
69
                onHistoryEntryClicked: activityView.historyEntryRequested(url)
 
70
            }
 
71
        }
 
72
    }
 
73
}