Merge lp:~tpeeters/ubuntu-ui-toolkit/listitem-textarea into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters
Status: Merged
Approved by: Florian Boucault
Approved revision: 422
Merged at revision: 419
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/listitem-textarea
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 93 lines (+11/-14)
4 files modified
CHANGES (+2/-1)
modules/Ubuntu/Components/AbstractButton.qml (+4/-4)
modules/Ubuntu/Components/ListItems/SingleControl.qml (+1/-1)
modules/Ubuntu/Components/ListItems/Standard.qml (+4/-8)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/listitem-textarea
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Tim Peeters Needs Information
Florian Boucault (community) Needs Fixing
Michał Sawicz Disapprove
Zsombor Egri Pending
Review via email: mp+158456@code.launchpad.net

Commit message

Remove mouse parameters from AbstractButton's signals.

Description of the change

Remove mouse parameters from AbstractButton's signals.

To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote :

See linked bug why I made this change. We are not using keyboard handling anywhere, do we really need it now? Also, the clicked() signal currently needs a mouse parameter that the keyboard events cannot give it.

review: Needs Information
Revision history for this message
Michał Sawicz (saviq) wrote :

Even if not right now, we need support for keyboard navigation really soon. The core apps that are being developed might be as useful on the Ubuntu desktop, and IMO instead of removing this, we should fix it, if it poses problems.

The fix, IMO, should be that ListItem.Empty should not inherit AbstractButton.

review: Disapprove
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

I must agree with saviq. But why an abstract button's clicked() signal must bring a mouse event with it? It is a component, the signal is emitted when the mouse click happens on button area, and I guess noone really cares the details of the click. If they really do, they can connect to __mouseArea to get that.

Revision history for this message
Tim Peeters (tpeeters) wrote :

Removing the var mouse from the clicked events seems to work fine everywhere and it removes the error messages. But still the TextArea forwards the key events to its parent, so they get eaten by the ListItem.Empty instead of added inside the TextArea.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Florian Boucault (fboucault) wrote :

I'm happy with that API change but it must be documented in CHANGES.

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

Note that the actual bug #1166840 is being fixed by Zsombor separately.

Revision history for this message
Zsombor Egri (zsombi) wrote :

The bug was taken away from this MR. Tim, please proceed with the MR.

Revision history for this message
Tim Peeters (tpeeters) wrote :

Is there still a good reason to remove the mouse parameter?

review: Needs Information
421. By Tim Peeters

Empty commit to figure out some launchpad weirdness

422. By Tim Peeters

remove mouse parameter in remaining clicked() and pressAndHold() calls

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

The mouse parameter for the signals of AbstractButton were removed (and CHANGES was updated), but the Keys are no longer touched in this MR.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CHANGES'
2--- CHANGES 2013-04-12 12:09:26 +0000
3+++ CHANGES 2013-04-15 18:51:29 +0000
4@@ -15,7 +15,8 @@
5 API Changes
6 ***********
7
8-* None
9+* clicked() and pressAndHold() signals of AbstractButton no longer take a mouse
10+ parameter as input.
11
12 SDK 0.1.42
13 ##########
14
15=== modified file 'modules/Ubuntu/Components/AbstractButton.qml'
16--- modules/Ubuntu/Components/AbstractButton.qml 2013-03-15 18:20:36 +0000
17+++ modules/Ubuntu/Components/AbstractButton.qml 2013-04-15 18:51:29 +0000
18@@ -35,7 +35,7 @@
19 This handler is called when there is a mouse click on the button
20 and the button is not disabled.
21 */
22- signal clicked(var mouse)
23+ signal clicked()
24
25 Keys.onEnterPressed: clicked()
26 Keys.onReturnPressed: clicked()
27@@ -44,7 +44,7 @@
28 \preliminary
29 This handler is called when there is a long press.
30 */
31- signal pressAndHold(var mouse)
32+ signal pressAndHold()
33
34 /*!
35 \preliminary
36@@ -80,12 +80,12 @@
37
38 onClicked: {
39 if (button.__acceptEvents) {
40- button.clicked(mouse)
41+ button.clicked()
42 }
43 }
44 onPressAndHold: {
45 if (button.__acceptEvents) {
46- button.pressAndHold(mouse)
47+ button.pressAndHold()
48 }
49 }
50 }
51
52=== modified file 'modules/Ubuntu/Components/ListItems/SingleControl.qml'
53--- modules/Ubuntu/Components/ListItems/SingleControl.qml 2013-03-20 19:15:15 +0000
54+++ modules/Ubuntu/Components/ListItems/SingleControl.qml 2013-04-15 18:51:29 +0000
55@@ -55,7 +55,7 @@
56 property AbstractButton control
57
58 /*! \internal */
59- onClicked: control.clicked(mouse)
60+ onClicked: control.clicked()
61 pressed: __mouseArea.pressed || control.__mouseArea.pressed
62 /*! \internal */
63 onPressedChanged: control.pressed = singleControlListItem.pressed
64
65=== modified file 'modules/Ubuntu/Components/ListItems/Standard.qml'
66--- modules/Ubuntu/Components/ListItems/Standard.qml 2013-03-20 18:35:06 +0000
67+++ modules/Ubuntu/Components/ListItems/Standard.qml 2013-04-15 18:51:29 +0000
68@@ -249,21 +249,17 @@
69
70 onClicked: {
71 if (control && __mouseArea.mouseX < progressionHelper.x) {
72- control.clicked(mouse)
73- mouse.accepted = true
74+ control.clicked();
75 } else {
76- listItem.clicked(mouse)
77- mouse.accepted = true
78+ listItem.clicked();
79 }
80 }
81
82 onPressAndHold: {
83 if (control && __mouseArea.mouseX < progressionHelper.x) {
84- control.pressAndHold(mouse)
85- mouse.accepted = true
86+ control.pressAndHold();
87 } else {
88- listItem.pressAndHold(mouse)
89- mouse.accepted = true
90+ listItem.pressAndHold();
91 }
92 }
93 }

Subscribers

People subscribed via source and target branches

to status/vote changes: