Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/contextMenu into lp:ubuntu-ui-toolkit/staging

Proposed by Cris Dywan
Status: Work in progress
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/contextMenu
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 615 lines (+374/-47) (has conflicts)
15 files modified
components.api (+17/-0)
examples/ubuntu-ui-toolkit-gallery/ExampleContextMenu.qml (+59/-0)
examples/ubuntu-ui-toolkit-gallery/NewListItems.qml (+6/-0)
examples/ubuntu-ui-toolkit-gallery/Popover.qml (+5/-0)
src/Ubuntu/Components/ComponentModule.pro (+4/-0)
src/Ubuntu/Components/Popups/1.3/ContextMenu.qml (+44/-0)
src/Ubuntu/Components/Popups/1.3/ListItemContextMenu.qml (+11/-47)
src/Ubuntu/Components/Popups/1.3/MenuGroup.qml (+46/-0)
src/Ubuntu/Components/Popups/1.3/MenuItem.qml (+86/-0)
src/Ubuntu/Components/Popups/1.3/Popover.qml (+1/-0)
src/Ubuntu/Components/Popups/Popups.pro (+4/-0)
src/Ubuntu/Components/Popups/qmldir (+3/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/ContextMenuForegroundStyle.qml (+43/-0)
src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro (+2/-0)
src/Ubuntu/Components/plugin/uclistitem.cpp (+43/-0)
Text conflict in components.api
Text conflict in src/Ubuntu/Components/ComponentModule.pro
Text conflict in src/Ubuntu/Components/plugin/uclistitem.cpp
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/contextMenu
Reviewer Review Type Date Requested Status
Ubuntu SDK team Pending
Review via email: mp+281835@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

1607. By Cris Dywan

Proper looks

1606. By Cris Dywan

Example context menu

1605. By Cris Dywan

Implement ContextMenu/ MenuGroup/ (internal) MenuItem

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2015-12-19 10:06:24 +0000
+++ components.api 2016-01-07 10:05:16 +0000
@@ -303,7 +303,12 @@
303 default property Component layout303 default property Component layout
304 property string name304 property string name
305 property QQmlBinding when305 property QQmlBinding when
306<<<<<<< TREE
306Ubuntu.PerformanceMetrics.CpuUsage 1.0 0.1 UPMCpuUsage: Item307Ubuntu.PerformanceMetrics.CpuUsage 1.0 0.1 UPMCpuUsage: Item
308=======
309Ubuntu.Components.Popups.ContextMenu 1.3: Popover
310Ubuntu.PerformanceMetrics.CpuUsage 1.0 0.1: Item
311>>>>>>> MERGE-SOURCE
307 readonly property UPMGraphModel graphModel312 readonly property UPMGraphModel graphModel
308 property int period313 property int period
309 property int samplingInterval314 property int samplingInterval
@@ -614,6 +619,7 @@
614 default property list<QtObject> contentsItem619 default property list<QtObject> contentsItem
615Ubuntu.Components.MainView 1.3: MainViewBase620Ubuntu.Components.MainView 1.3: MainViewBase
616 property bool automaticOrientation621 property bool automaticOrientation
622<<<<<<< TREE
617 default property list<QtObject> contentsItem623 default property list<QtObject> contentsItem
618Ubuntu.Components.MathUtils 1.0 0.1: QtObject singleton624Ubuntu.Components.MathUtils 1.0 0.1: QtObject singleton
619 function double clamp(double x, double min, double max)625 function double clamp(double x, double min, double max)
@@ -621,6 +627,16 @@
621 function double projectValue(double x, double xmin, double xmax, double ymin, double ymax)627 function double projectValue(double x, double xmin, double xmax, double ymin, double ymax)
622 function double clampAndProject(double x, double xmin, double xmax, double ymin, double ymax)628 function double clampAndProject(double x, double xmin, double xmax, double ymin, double ymax)
623Ubuntu.Components.MimeData 1.0 0.1 QQuickMimeData: QtObject629Ubuntu.Components.MimeData 1.0 0.1 QQuickMimeData: QtObject
630=======
631 default readonly property QtObject contentsItem
632Ubuntu.Components.MathUtils 0.1 1.0 1.3
633Ubuntu.Components.Popups.MenuGroup 1.3: Column
634 readonly property QtObject actions
635 property Component delegate
636 property ContextMenu menu
637 property string text
638Ubuntu.Components.MimeData 1.0 0.1: QtObject
639>>>>>>> MERGE-SOURCE
624 property color color640 property color color
625 property var data641 property var data
626 readonly property QStringList formats642 readonly property QStringList formats
@@ -935,6 +951,7 @@
935 function var show()951 function var show()
936 function var hide()952 function var hide()
937 property Item pointerTarget953 property Item pointerTarget
954 property string styleName
938Ubuntu.Components.Popups.PopupBase 1.0 0.1: OrientationHelper955Ubuntu.Components.Popups.PopupBase 1.0 0.1: OrientationHelper
939 property Item dismissArea956 property Item dismissArea
940 property PropertyAnimation fadingAnimation957 property PropertyAnimation fadingAnimation
941958
=== added file 'examples/ubuntu-ui-toolkit-gallery/ExampleContextMenu.qml'
--- examples/ubuntu-ui-toolkit-gallery/ExampleContextMenu.qml 1970-01-01 00:00:00 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ExampleContextMenu.qml 2016-01-07 10:05:16 +0000
@@ -0,0 +1,59 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Ubuntu.Components.Popups 1.3
20
21ContextMenu {
22 MenuGroup {
23 Action {
24 text: i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.")
25 shortcut: 'Alt+P'
26 }
27 Action {
28 iconName: 'compose'
29 text: i18n.tr("Once upon a time there was a story nobody told.")
30 enabled: false
31 shortcut: 'Ctrl+Shift+T'
32 }
33 }
34 MenuGroup {
35 Action {
36 iconName: 'delete'
37 text: i18n.tr("Delete")
38 shortcut: 'Del'
39 }
40 MenuGroup {
41 text: i18n.tr("But wait, there's more")
42 Action {
43 text: i18n.tr("Send an email")
44 shortcut: 'Ctrl+C'
45 enabled: false
46 }
47 Action {
48 iconName: 'save-to'
49 text: i18n.tr("Save to file")
50 shortcut: 'Shift+S'
51 }
52 }
53 MenuGroup {
54 text: i18n.tr("Forever moar quoth the raven")
55 enabled: false
56 }
57 }
58}
59
060
=== modified file 'examples/ubuntu-ui-toolkit-gallery/NewListItems.qml'
--- examples/ubuntu-ui-toolkit-gallery/NewListItems.qml 2015-09-28 12:26:13 +0000
+++ examples/ubuntu-ui-toolkit-gallery/NewListItems.qml 2016-01-07 10:05:16 +0000
@@ -49,9 +49,12 @@
49 actions: [49 actions: [
50 Action {50 Action {
51 iconName: "tick"51 iconName: "tick"
52 text: i18n.tr('Check')
53 enabled: false
52 },54 },
53 Action {55 Action {
54 iconName: "delete"56 iconName: "delete"
57 text: i18n.tr('Delete')
55 }58 }
56 ]59 ]
57 }60 }
@@ -60,9 +63,12 @@
60 actions: [63 actions: [
61 Action {64 Action {
62 iconName: "edit"65 iconName: "edit"
66 text: i18n.tr('Edit')
63 },67 },
64 Action {68 Action {
65 iconName: "save-to"69 iconName: "save-to"
70 text: i18n.tr('Save As')
71 enabled: false
66 }72 }
67 ]73 ]
68 }74 }
6975
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Popover.qml'
--- examples/ubuntu-ui-toolkit-gallery/Popover.qml 2015-06-24 16:16:51 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Popover.qml 2016-01-07 10:05:16 +0000
@@ -27,6 +27,11 @@
27 iconSource: "call_icon.png"27 iconSource: "call_icon.png"
28 onTriggered: PopupUtils.open(actionSelectionPopover)28 onTriggered: PopupUtils.open(actionSelectionPopover)
29 visible: true29 visible: true
30 },
31 Action {
32 text: "Context menu"
33 iconName: "like"
34 onTriggered: PopupUtils.open(Qt.resolvedUrl('ExampleContextMenu.qml'), popoverWithFlickableButton)
30 }35 }
31 ]36 ]
3237
3338
=== modified file 'src/Ubuntu/Components/ComponentModule.pro'
--- src/Ubuntu/Components/ComponentModule.pro 2015-12-17 13:48:23 +0000
+++ src/Ubuntu/Components/ComponentModule.pro 2016-01-07 10:05:16 +0000
@@ -126,12 +126,16 @@
126 1.3/UbuntuColors.qml \126 1.3/UbuntuColors.qml \
127 1.3/UbuntuListView.qml \127 1.3/UbuntuListView.qml \
128 1.3/UbuntuNumberAnimation.qml \128 1.3/UbuntuNumberAnimation.qml \
129<<<<<<< TREE
129 1.3/ListItemPopover.qml \130 1.3/ListItemPopover.qml \
130 1.3/PageColumn.qml \131 1.3/PageColumn.qml \
131 1.3/PageColumnsLayout.qml \132 1.3/PageColumnsLayout.qml \
132 1.3/ProgressionSlot.qml \133 1.3/ProgressionSlot.qml \
133 1.3/ScrollView.qml \134 1.3/ScrollView.qml \
134 1.3/PageHeader.qml135 1.3/PageHeader.qml
136=======
137 1.3/BottomEdgeHint.qml
138>>>>>>> MERGE-SOURCE
135139
136OTHER_FILES+= qmldir \140OTHER_FILES+= qmldir \
137 1.3/CrossFadeImage.qdoc \141 1.3/CrossFadeImage.qdoc \
138142
=== added file 'src/Ubuntu/Components/Popups/1.3/ContextMenu.qml'
--- src/Ubuntu/Components/Popups/1.3/ContextMenu.qml 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/Popups/1.3/ContextMenu.qml 2016-01-07 10:05:16 +0000
@@ -0,0 +1,44 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Popover {
21 id: contextmenu
22 objectName: 'ContextMenu'
23 contentHeight: Math.max(column.childrenRect.height, units.gu(4))
24 contentWidth: Math.max(column.childrenRect.width, units.gu(4))
25
26 default property alias children: column.children
27
28 // FIXME: styleName: "ContextMenuForegroundStyle"
29 Column {
30 id: column
31 anchors {
32 left: parent.left
33 top: parent.top
34 right: parent.right
35 }
36 }
37
38 // Hide the arrow
39 Binding {
40 target: __foreground
41 property: "direction"
42 value: "none"
43 }
44}
045
=== renamed file 'src/Ubuntu/Components/1.3/ListItemPopover.qml' => 'src/Ubuntu/Components/Popups/1.3/ListItemContextMenu.qml'
--- src/Ubuntu/Components/1.3/ListItemPopover.qml 2015-07-01 12:06:34 +0000
+++ src/Ubuntu/Components/Popups/1.3/ListItemContextMenu.qml 2016-01-07 10:05:16 +0000
@@ -18,53 +18,17 @@
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Components.Popups 1.319import Ubuntu.Components.Popups 1.3
2020
21ActionSelectionPopover {21ContextMenu {
22 id: popover
23 objectName: 'listItemContextMenu'22 objectName: 'listItemContextMenu'
24 contentWidth: units.gu(25)23 caller: ListItem {
2524 }
26 delegate: ListItem {25
27 contentItem.anchors {26 MenuGroup {
28 leftMargin: units.gu(2)27 objectName: 'leadingActions'
29 rightMargin: units.gu(2)28 actions: caller.leadingActions ? caller.leadingActions.actions : []
30 topMargin: units.gu(0.5)29 }
31 bottomMargin: units.gu(0.5)30 MenuGroup {
32 }31 objectName: 'trailingActions'
33 divider.visible: action != actions[actions.length - 1]32 actions: caller.trailingActions ? caller.trailingActions.actions : []
34
35 Label {
36 anchors.verticalCenter: parent.verticalCenter
37 text: action.text
38 color: '#5D5D5D'
39 }
40
41 onClicked: popover.hide()
42 }
43
44 function mergeActions(to, from) {
45 if (from == null)
46 return;
47
48 var actions = from.actions;
49 for (var i in actions) {
50 var action = actions[i];
51 if (!action.text)
52 action.text = action.iconName;
53 to.push(actions[i]);
54 }
55 }
56
57 onCallerChanged: {
58 var all = [];
59 mergeActions(all, caller.leadingActions);
60 mergeActions(all, caller.trailingActions);
61 actions = all;
62 }
63
64 // Hide the arrow
65 Binding {
66 target: __foreground
67 property: "direction"
68 value: "none"
69 }33 }
70}34}
7135
=== added file 'src/Ubuntu/Components/Popups/1.3/MenuGroup.qml'
--- src/Ubuntu/Components/Popups/1.3/MenuGroup.qml 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/Popups/1.3/MenuGroup.qml 2016-01-07 10:05:16 +0000
@@ -0,0 +1,46 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Column {
21 id: group
22 property ContextMenu menu
23 property list<QtObject> actions
24 default property alias children: group.actions
25 property Component delegate: MenuItem {
26 action: modelData.hasOwnProperty('shortcut') ? modelData : null
27 text: modelData.text
28 enabled: modelData.enabled
29 onClicked: contextmenu.hide() // FIXME
30 divider.visible: action == actions[group.actions.length - 1]
31 }
32 property string text
33
34 Loader {
35 property var modelData: Action {
36 text: group.text
37 }
38 active: group.text !== ''
39 sourceComponent: group.delegate
40 }
41
42 Repeater {
43 model: actions
44 delegate: group.delegate
45 }
46}
047
=== added file 'src/Ubuntu/Components/Popups/1.3/MenuItem.qml'
--- src/Ubuntu/Components/Popups/1.3/MenuItem.qml 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/Popups/1.3/MenuItem.qml 2016-01-07 10:05:16 +0000
@@ -0,0 +1,86 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20ListItem {
21 id: menuitem
22 contentItem.anchors {
23 leftMargin: units.gu(2)
24 rightMargin: units.gu(2)
25 }
26 width: row.spacing + units.gu(25) + hotkey.width + units.gu(4)
27 height: units.gu(4)
28
29 color: '#ffffff'
30 opacity: selected || hovered ? 0.08 : 1.0
31 Mouse.onEntered: hovered = true
32 Mouse.onExited: hovered = false
33 property bool hovered
34 property string text
35 enabled: action ? action.enabled : true
36
37 Row {
38 id: row
39 anchors.left: parent.left
40 anchors.verticalCenter: parent.verticalCenter
41 anchors.right: shortcut.left
42 spacing: units.gu(1)
43
44 Icon {
45 id: icon
46 name: action ? action.iconName : ''
47 width: visible ? units.gu(2) : 0
48 height: width
49 opacity: label.opacity
50 visible: name != ''
51 }
52
53 Label {
54 id: label
55 text: action ? action.text : menuitem.text
56 color: '#333333'
57 opacity: menuitem.enabled ? 1.0 : 0.3
58 elide: Text.ElideRight
59 width: units.gu(25) - icon.width
60 }
61 }
62
63 Row {
64 id: shortcut
65 anchors.right: parent.right
66 anchors.verticalCenter: parent.verticalCenter
67 opacity: label.opacity
68
69 Label {
70 id: hotkey
71 property string shortcut: action && action.shortcut ? action.shortcut : ''
72 text: hotkey.shortcut.replace('Ctrl+', '^').replace('Shift+', '⇧')
73 color: label.color
74 visible: shortcut != ''
75 width: units.gu(5)
76 }
77
78 Icon {
79 id: chevron
80 name: 'chevron'
81 width: units.gu(2)
82 height: width
83 visible: !action
84 }
85 }
86}
087
=== modified file 'src/Ubuntu/Components/Popups/1.3/Popover.qml'
--- src/Ubuntu/Components/Popups/1.3/Popover.qml 2015-12-09 12:34:18 +0000
+++ src/Ubuntu/Components/Popups/1.3/Popover.qml 2016-01-07 10:05:16 +0000
@@ -244,6 +244,7 @@
244244
245 styleName: "PopoverForegroundStyle"245 styleName: "PopoverForegroundStyle"
246 }246 }
247 property alias styleName: foreground.styleName
247248
248 QtObject {249 QtObject {
249 id: pointer250 id: pointer
250251
=== modified file 'src/Ubuntu/Components/Popups/Popups.pro'
--- src/Ubuntu/Components/Popups/Popups.pro 2015-07-24 15:46:33 +0000
+++ src/Ubuntu/Components/Popups/Popups.pro 2016-01-07 10:05:16 +0000
@@ -11,9 +11,13 @@
11 1.2/SheetBase.qml \11 1.2/SheetBase.qml \
12 1.3/ActionSelectionPopover.qml \12 1.3/ActionSelectionPopover.qml \
13 1.3/ComposerSheet.qml \13 1.3/ComposerSheet.qml \
14 1.3/ContextMenu.qml \
15 1.3/MenuGroup.qml \
16 1.3/MenuItem.qml \
14 1.3/DefaultSheet.qml \17 1.3/DefaultSheet.qml \
15 1.3/Dialog.qml \18 1.3/Dialog.qml \
16 1.3/internalPopupUtils.js \19 1.3/internalPopupUtils.js \
20 1.3/ListItemContextMenu.qml \
17 1.3/Popover.qml \21 1.3/Popover.qml \
18 1.3/PopupBase.qml \22 1.3/PopupBase.qml \
19 1.3/popupUtils.js \23 1.3/popupUtils.js \
2024
=== modified file 'src/Ubuntu/Components/Popups/qmldir'
--- src/Ubuntu/Components/Popups/qmldir 2015-07-17 14:42:26 +0000
+++ src/Ubuntu/Components/Popups/qmldir 2016-01-07 10:05:16 +0000
@@ -23,6 +23,9 @@
2323
24#################################################24#################################################
25#version 1.325#version 1.3
26ContextMenu 1.3 1.3/ContextMenu.qml
27MenuGroup 1.3 1.3/MenuGroup.qml
28internal MenuItem 1.3/MenuItem.qml
26Dialog 1.3 1.3/Dialog.qml29Dialog 1.3 1.3/Dialog.qml
27PopupBase 1.3 1.3/PopupBase.qml30PopupBase 1.3 1.3/PopupBase.qml
28Popover 1.3 1.3/Popover.qml31Popover 1.3 1.3/Popover.qml
2932
=== added file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ContextMenuForegroundStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ContextMenuForegroundStyle.qml 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ContextMenuForegroundStyle.qml 2016-01-07 10:05:16 +0000
@@ -0,0 +1,43 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Item {
21 id: contextMenuForegroundStyle
22
23 Image {
24 id: background
25 anchors.fill: parent
26 source: Qt.resolvedUrl("../artwork/contextual_menu_bg@27.png")
27 }
28
29 function show() { }
30 function hide() { }
31 signal showCompleted()
32 signal hideCompleted()
33 onShowCompleted: styledItem.showCompleted()
34 onHideCompleted: styledItem.hideCompleted()
35 property Item contentItem: Item {
36 anchors.fill: parent
37 Connections {
38 target: styledItem
39 onShow: show()
40 onHide: hide()
41 }
42 }
43}
044
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro'
--- src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-12-16 10:01:07 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2016-01-07 10:05:16 +0000
@@ -13,6 +13,7 @@
13 artwork/caret_noshadow@27.png \13 artwork/caret_noshadow@27.png \
14 artwork/chevron@27.png \14 artwork/chevron@27.png \
15 artwork/chevron_down@30.png \15 artwork/chevron_down@30.png \
16 artwork/contextual_menu_bg@27.png \
16 artwork/cross@30.png \17 artwork/cross@30.png \
17 artwork/header_overflow_dropshadow@27.png \18 artwork/header_overflow_dropshadow@27.png \
18 artwork/header_overflow_dropshadow@27.sci \19 artwork/header_overflow_dropshadow@27.sci \
@@ -80,6 +81,7 @@
80 1.3/ButtonStyle.qml \81 1.3/ButtonStyle.qml \
81 1.3/CheckBoxStyle.qml \82 1.3/CheckBoxStyle.qml \
82 1.3/ComboButtonStyle.qml \83 1.3/ComboButtonStyle.qml \
84 1.3/ContextMenuForegroundStyle.qml \
83 1.3/DatePickerStyle.qml \85 1.3/DatePickerStyle.qml \
84 1.3/DialerHandStyle.qml \86 1.3/DialerHandStyle.qml \
85 1.3/DialerStyle.qml \87 1.3/DialerStyle.qml \
8688
=== added file 'src/Ubuntu/Components/Themes/Ambiance/artwork/contextual_menu_bg@27.png'
87Binary files src/Ubuntu/Components/Themes/Ambiance/artwork/contextual_menu_bg@27.png 1970-01-01 00:00:00 +0000 and src/Ubuntu/Components/Themes/Ambiance/artwork/contextual_menu_bg@27.png 2016-01-07 10:05:16 +0000 differ89Binary files src/Ubuntu/Components/Themes/Ambiance/artwork/contextual_menu_bg@27.png 1970-01-01 00:00:00 +0000 and src/Ubuntu/Components/Themes/Ambiance/artwork/contextual_menu_bg@27.png 2016-01-07 10:05:16 +0000 differ
=== modified file 'src/Ubuntu/Components/plugin/uclistitem.cpp'
--- src/Ubuntu/Components/plugin/uclistitem.cpp 2015-12-15 15:58:54 +0000
+++ src/Ubuntu/Components/plugin/uclistitem.cpp 2016-01-07 10:05:16 +0000
@@ -1162,6 +1162,7 @@
1162{1162{
1163 if (event->button() != Qt::RightButton)1163 if (event->button() != Qt::RightButton)
1164 return false;1164 return false;
1165<<<<<<< TREE
1165 return leadingActions || trailingActions;1166 return leadingActions || trailingActions;
1166}1167}
11671168
@@ -1203,6 +1204,48 @@
1203 SLOT(_q_popoverClosed()), Qt::DirectConnection);1204 SLOT(_q_popoverClosed()), Qt::DirectConnection);
1204 }1205 }
1205 delete component;1206 delete component;
1207=======
1208 return leadingActions() || trailingActions();
1209}
1210
1211void UCListItem13::mousePressEvent(QMouseEvent *event)
1212{
1213 UCListItem::mousePressEvent(event);
1214 if (shouldShowContextMenu(event)) {
1215 Q_D(UCListItem);
1216
1217 // Highlight the Item while the menu is showing
1218 d->setHighlighted(true);
1219 // Reset the timer which otherwise is started with highlighting
1220 d->pressAndHoldTimer.stop();
1221
1222 quint16 version(d->getTheme()->version());
1223 QString versionString(QStringLiteral("%1.%2").arg(MAJOR_VERSION(version)).arg(MINOR_VERSION(version)));
1224 QUrl url(UbuntuComponentsPlugin::pluginUrl().resolved("Popups/" + versionString + "/ListItemContextMenu.qml"));
1225
1226 // Open Popover
1227 QQmlEngine* engine = qmlEngine(this);
1228 QQmlComponent* component = new QQmlComponent(engine, url, QQmlComponent::PreferSynchronous, this);
1229 if (component->isError()) {
1230 qmlInfo(this) << component->errorString();
1231 } else {
1232 QQmlEngine::setContextForObject(component, qmlContext(this));
1233 QQuickItem* item = static_cast<QQuickItem*>(component->create(qmlContext(this)));
1234 item->setProperty("caller", QVariant::fromValue(this));
1235 item->setParentItem(QuickUtils::instance().rootItem(this));
1236 QMetaObject::invokeMethod(item, "show");
1237 connect(item, &QQuickItem::visibleChanged, this,
1238 &UCListItem13::popoverClosed, Qt::DirectConnection);
1239 }
1240 delete component;
1241 }
1242}
1243
1244void UCListItem13::popoverClosed()
1245{
1246 Q_D(UCListItem);
1247 d->setHighlighted(false);
1248>>>>>>> MERGE-SOURCE
1206}1249}
12071250
1208// ungrabs any previously grabbed left mouse button event1251// ungrabs any previously grabbed left mouse button event

Subscribers

People subscribed via source and target branches