~ps-jenkins/ubuntu-ui-extras/trusty-proposed

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/Extras/Share/SharePopover.qml

Add a SharePopover component that apps can use to let the user chose to which service to share.

Approved by Günter Schwann, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2012-2013 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
import QtQuick 2.0
 
18
import Ubuntu.Components.Popups 0.1
 
19
import Ubuntu.Components.ListItems 0.1 as ListItem
 
20
 
 
21
/*!
 
22
*/
 
23
Popover {
 
24
    id: sharePopover
 
25
 
 
26
    signal selected(string accountId)
 
27
 
 
28
    ShareMenu {
 
29
        anchors {
 
30
            left: parent.left
 
31
            right: parent.right
 
32
            top: parent.top
 
33
        }
 
34
        onSelected: {
 
35
            if (accountId !== null) {
 
36
                sharePopover.selected(accountId)
 
37
            }
 
38
            sharePopover.hide()
 
39
        }
 
40
    }
 
41
}