~elopio/gallery-app/revert_workaround-1302706-click_toolbar_button_failure

« back to all changes in this revision

Viewing changes to rc/qml/Utility/SelectionToolbarAction.qml

  • Committer: Leo Arias
  • Date: 2015-05-15 08:05:23 UTC
  • mfrom: (954.1.241 gallery-app)
  • Revision ID: leo.arias@canonical.com-20150515080523-i2of3vr8h7dioj59
Now the toolbar object is not needed at all.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    signal addClicked(var caller)
34
34
    ///Emitted when delete was clicked
35
35
    signal deleteClicked()
 
36
    ///Emitted when share was clicked
 
37
    signal shareClicked()
36
38
 
37
39
    // in selection mode, never hide the toolbar:
38
40
    opened: true
41
43
    ToolbarButton {
42
44
        id: addButton
43
45
        objectName: "addButton"
44
 
        text: i18n.tr("Add")
45
 
        iconSource: Qt.resolvedUrl("../../img/add.png")
46
 
        enabled: root.selection.selectedCount > 0
47
 
        onTriggered: root.addClicked(addButton);
48
 
    }
49
 
    ToolbarButton {
50
 
        objectName: "deleteButton"
51
 
        text: i18n.tr("Delete")
52
 
        iconSource: Qt.resolvedUrl("../../img/delete.png")
53
 
        enabled: root.selection.selectedCount > 0
54
 
        onTriggered:root.deleteClicked();
55
 
    }
56
 
    ToolbarButton {
57
 
        objectName: "shareButton"
58
 
        text: i18n.tr("Share")
59
 
        iconSource: Qt.resolvedUrl("../../img/share.png")
60
 
        enabled: false
 
46
        action: Action {
 
47
            text: i18n.tr("Add")
 
48
            iconName: "add"
 
49
            enabled: root.selection.selectedCount > 0
 
50
            onTriggered: root.addClicked(addButton);
 
51
        }
 
52
    }
 
53
    ToolbarButton {
 
54
        action: Action {
 
55
            objectName: "deleteButton"
 
56
            text: i18n.tr("Delete")
 
57
            iconName: "delete"
 
58
            enabled: root.selection.selectedCount > 0
 
59
            onTriggered:root.deleteClicked();
 
60
        }
 
61
    }
 
62
    ToolbarButton {
 
63
        action: Action {
 
64
            objectName: "shareButton"
 
65
            text: i18n.tr("Share")
 
66
            iconName: "share"
 
67
            enabled: root.selection.selectedMediaCount == 1
 
68
            onTriggered: root.shareClicked();
 
69
        }
61
70
    }
62
71
 
63
72
    back:  Button {
64
73
        objectName: "cancelButton"
65
 
        anchors.verticalCenter: parent.verticalCenter
66
 
        text: i18n.tr("Cancel")
67
 
        width: units.gu(10)
68
 
        onClicked: {
69
 
            root.cancelClicked();
 
74
        action: Action {
 
75
            text: i18n.tr("Cancel")
 
76
            iconName: "back"
 
77
            onTriggered: {
 
78
                root.cancelClicked();
 
79
            }
70
80
        }
71
81
    }
72
82
}