~ubuntu-branches/ubuntu/vivid/gpodder/vivid

« back to all changes in this revision

Viewing changes to share/gpodder/ui/qml/sailfish/org/gpodder/qmlui/ActionMenu.qml

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2013-04-12 22:07:02 UTC
  • mfrom: (5.2.27 sid)
  • Revision ID: package-import@ubuntu.com-20130412220702-mux8v9r8zt2jin0x
Tags: 3.5.1-1
* New upstream release.
* d/control: declare versioned dependency on python-gtk2 (>= 2.16)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
import QtQuick 1.1
 
3
import Sailfish.Silica 1.0
 
4
 
 
5
Item {
 
6
    id: actionmenu
 
7
 
 
8
    /* ListView for which this menu is valid */
 
9
    property variant listview
 
10
 
 
11
    /* Collect actions from the menu here */
 
12
    default property alias content: actions.children
 
13
    Item { id: actions }
 
14
 
 
15
    /* Show action menu when this function is called */
 
16
    function open() {
 
17
        pullDownMenu.open();
 
18
    }
 
19
 
 
20
    anchors.fill: parent
 
21
 
 
22
    PullDownMenu {
 
23
        id: pullDownMenu
 
24
 
 
25
        Repeater {
 
26
            model: actions.children
 
27
 
 
28
            MenuItem {
 
29
                text: modelData.text
 
30
                onClicked: modelData.clicked()
 
31
            }
 
32
        }
 
33
    }
 
34
 
 
35
    Component.onCompleted: {
 
36
        pullDownMenu.parent = actionmenu.listview;
 
37
    }
 
38
}
 
39