Merge lp:~3v1n0/component-store/radial-expand-angle into lp:component-store

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: 47
Proposed branch: lp:~3v1n0/component-store/radial-expand-angle
Merge into: lp:component-store
Diff against target: 91 lines (+25/-3) (has conflicts)
4 files modified
ComponentStore/RadialBottomEdge/RadialBottomEdge.qml (+6/-2)
ComponentStore/RadialBottomEdge/ubuntu_component_store.json (+1/-1)
docs/_components/radialbottomedge.rst (+11/-0)
docs/release.rst (+7/-0)
Text conflict in docs/release.rst
To merge this branch: bzr merge lp:~3v1n0/component-store/radial-expand-angle
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) (community) Approve
Nekhelesh Ramananthan Needs Fixing
Review via email: mp+252529@code.launchpad.net

Commit message

RadialBottomEdge: make possible to expand actions in a narrower angle

And update expandedPosition depending on this value

Description of the change

I'd like to dispose actions using a narower expand-angle when I've just few actions to add... Changing expandAngle to something minor to 360, you'd be able to dispose actions using a smaller area.

Here's what happens adding 3 or 4 actions with a 180° expandAngle: http://imgur.com/a/aLqVU

To post a comment you must log in.
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Thanks Marco for the patch. The component code looks good. The documentation needs to be updated. I have done that for you at https://code.launchpad.net/~nik90/component-store/update-radial-docs/+merge/253622. Please merge that into this branch and then I can top-approve this MP.

review: Needs Fixing
47. By Marco Trevisan (Treviño)

Merging with nick90's docs

Thanks!

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Merged, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ComponentStore/RadialBottomEdge/RadialBottomEdge.qml'
2--- ComponentStore/RadialBottomEdge/RadialBottomEdge.qml 2014-11-15 14:50:47 +0000
3+++ ComponentStore/RadialBottomEdge/RadialBottomEdge.qml 2015-03-20 10:21:42 +0000
4@@ -11,7 +11,8 @@
5 property color hintIconColor: UbuntuColors.coolGrey
6 property bool bottomEdgeEnabled: true
7
8- property real expandedPosition: 0.6 * height
9+ property int expandAngle: 360
10+ property real expandedPosition: (0.85 - 0.25 * expandAngle/360) * height
11 property real collapsedPosition: height - hintSize/2
12
13 property list<RadialAction> actions
14@@ -60,10 +61,13 @@
15
16 Repeater {
17 id: actionList
18+ readonly property real itemSpace: bottomEdge.expandAngle/actionList.count;
19+ readonly property real substractAngle: (bottomEdge.expandAngle == 360 || !actionList.count) ?
20+ 0 : (actionList.count-1)/2 * itemSpace
21 model: actions
22 delegate: Rectangle {
23 id: actionDelegate
24- readonly property real radAngle: (index % actionList.count * (360/actionList.count)) * Math.PI / 180
25+ readonly property real radAngle: (index % actionList.count * actionList.itemSpace - actionList.substractAngle) * Math.PI / 180
26 property real distance: bottomEdgeHint.actionListDistance
27 z: -1
28 width: actionButtonSize
29
30=== modified file 'ComponentStore/RadialBottomEdge/ubuntu_component_store.json'
31--- ComponentStore/RadialBottomEdge/ubuntu_component_store.json 2015-01-04 16:15:59 +0000
32+++ ComponentStore/RadialBottomEdge/ubuntu_component_store.json 2015-03-20 10:21:42 +0000
33@@ -1,6 +1,6 @@
34 {
35 "name": "RadialBottomEdge",
36 "description": "This component provides a unique way to show actions buttons using the bottom edge. It allows app developers to decide how many actions they want to show and customize it to their liking.",
37- "version": "1.0",
38+ "version": "1.1",
39 "documentation_url": "http://ubuntu-component-store.readthedocs.org/en/latest/_components/radialbottomedge.html"
40 }
41
42=== modified file 'docs/_components/radialbottomedge.rst'
43--- docs/_components/radialbottomedge.rst 2014-11-15 14:59:11 +0000
44+++ docs/_components/radialbottomedge.rst 2015-03-20 10:21:42 +0000
45@@ -74,6 +74,7 @@
46 - :ref:`actions`: RadialAction <list>
47 - :ref:`actionButtonSize`: int
48 - :ref:`actionButtonDistance`: int
49+- :ref:`expandAngle`: int (defaults to 360 deg)
50
51 .. note:: All properties except for *hintIconSource* have well defined defaults. As a developer, you could choose to go with the defaults or change them to your liking.
52
53@@ -156,3 +157,13 @@
54 ^^^^^^^^^^^^^^^^^^^^
55
56 The distance (separation) between the action buttons and the center of the radial menu.
57+
58+.. _expandAngle:
59+
60+expandAngle
61+^^^^^^^^^^^
62+
63+The expand angle defines the spread angle. By default, it is set to 360 degrees which places the buttons
64+in a full circle pattern. If it was set to 180 degrees, then the buttons would follow a semi-circle
65+pattern.
66+
67
68=== modified file 'docs/release.rst'
69--- docs/release.rst 2015-03-13 11:18:34 +0000
70+++ docs/release.rst 2015-03-20 10:21:42 +0000
71@@ -1,6 +1,7 @@
72 Release Notes
73 =============
74
75+<<<<<<< TREE
76 **13th March 2015**
77
78 * Improved ListItemWithActions components by adding the following new properties,
79@@ -9,6 +10,12 @@
80 * showUnderscore - Shows an underscore under the active right side action
81 * enableHaptics - enables haptic effects on actions triggered
82
83+=======
84+**11th March 2015**
85+
86+* Added expandAngle property to radial bottom edge component to allow developers to specify the spread angle.
87+
88+>>>>>>> MERGE-SOURCE
89 **3rd March 2015**
90
91 * Added WelcomeWizard component

Subscribers

People subscribed via source and target branches