Kirigami: a feature needed for subsurface and api change feedback

Marco Martin notmart at gmail.com
Mon Apr 18 17:29:43 UTC 2016


Hi all,

one thing that as i understood was needed in the mobile UI of Subsurface, is 
the possibility to add other buttons in the action buttons at the bottom.
here's how my prototype looks like: http://imgur.com/VTHbDBJ
From discussions with the designers, it seems it should be always limited to 
at most three buttons, and this of course influences the final API: there 
should then be 3 separate actions properties instead of a list of an arbitrary 
number of actions, like it happens for context menu actions

In my first working approach, the API looks like this, leftAction and 
rightAction properties work just like mainAction controls the central button:

Page {
	mainAction: Action {...}
	leftAction: Action {...}
	rightAction: Action {...}
    	contextualActions: [
       		Action {...},
		Action{...}
	]
}

Now, since we are still at a prerelease state, I would like a little api 
change.
In QML, is usually considered good manner to group together similar 
properties, to obtain code more tied together and less repeated words in 
property names (such as mainAction LeftAction whateverAction)

for instance you define anchors like
Item {
	anchors {
		left: parent.left
		right: parent.right
		...
	}
}

following this, the api of Page would look like this:

Page {
	actions {
		main: Action {...}
		left: Action {...}
		right: Action {...}
    		contextualActions: [
       			Action {...},
			Action{...}
		]
	}
}

opinions? comments? (would be a problem for subsurface for eventually adapting 
existing stuff to new api?)

-- 
Marco Martin


More information about the Plasma-devel mailing list