~fboucault/camera-app/click_autopilot_add_deps

« back to all changes in this revision

Viewing changes to GalleryViewHeader.qml

  • Committer: CI Train Bot
  • Author(s): Ugo Riboni
  • Date: 2015-02-04 20:35:40 UTC
  • mfrom: (425.7.13 camera-app-editor)
  • Revision ID: ci-train-bot@canonical.com-20150204203540-zdd2ut1x686tlirn
Add photo editor feature using the component from ubuntu-ui-extras. Fixes: #1368787

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    height: units.gu(7)
33
33
 
34
34
    property bool shown: true
35
 
    property alias actions: actionsDrawer.actions
 
35
    property list<Action> actions
 
36
    property list<Action> editModeActions
36
37
    property bool gridMode: false
 
38
    property bool editMode: false
37
39
    property bool validationVisible
38
40
    property bool userSelectionMode: false
39
41
    signal exit
 
42
    signal exitEditor
40
43
    signal toggleViews
41
44
    signal toggleSelectAll
42
45
    signal validationClicked
68
71
            width: units.gu(8)
69
72
            iconName: "back"
70
73
            iconColor: Theme.palette.normal.foregroundText
71
 
            onClicked: header.exit()
 
74
            onClicked: editMode ? header.exitEditor() : header.exit()
72
75
        }
73
76
 
74
77
        Label {
75
 
            text: userSelectionMode ? i18n.tr("Select") : i18n.tr("Photo Roll")
 
78
            text: userSelectionMode ? i18n.tr("Select") :
 
79
                  (editMode ? i18n.tr("Edit Photo") : i18n.tr("Photo Roll"))
76
80
            fontSize: "x-large"
77
81
            color: Theme.palette.normal.foregroundText
78
82
            elide: Text.ElideRight
87
91
            }
88
92
            iconName: header.gridMode ? "stock_image" : "view-grid-symbolic"
89
93
            onClicked: header.toggleViews()
90
 
            visible: !main.contentExportMode && !userSelectionMode
 
94
            visible: !main.contentExportMode && !userSelectionMode && !editMode
91
95
        }
92
96
 
93
97
        IconButton {
108
112
                bottom: parent.bottom
109
113
            }
110
114
            iconName: "contextual-menu"
111
 
            visible: actionsDrawer.actions.length > 0
 
115
            visible: actionsDrawer.actions.length > 0 && !editMode
112
116
            onClicked: actionsDrawer.opened = !actionsDrawer.opened
113
117
        }
114
118
 
122
126
            onClicked: header.validationClicked()
123
127
            visible: header.validationVisible
124
128
        }
 
129
 
 
130
        IconButton {
 
131
            id: undoButton
 
132
            objectName: "undoButton"
 
133
            anchors {
 
134
                top: parent.top
 
135
                bottom: parent.bottom
 
136
            }
 
137
            visible: header.editMode
 
138
            action: editModeActions.length > 0 ? editModeActions[0] : null
 
139
            onTriggered: if (action) action.triggered()
 
140
        }
 
141
 
 
142
        IconButton {
 
143
            id: redoButton
 
144
            objectName: "redoButton"
 
145
            anchors {
 
146
                top: parent.top
 
147
                bottom: parent.bottom
 
148
            }
 
149
            visible: header.editMode
 
150
            action: editModeActions.length > 1 ? editModeActions[1] : null
 
151
            onTriggered: if (action) action.triggered()
 
152
        }
125
153
    }
126
154
 
127
155
    Item {
136
164
        clip: actionsColumn.y != 0
137
165
        visible: false
138
166
 
 
167
        actions: header.actions
 
168
 
139
169
        function close() {
140
170
            opened = false;
141
171
        }