On 31 October 2013 21:24, Sam Bull <[email protected]> wrote:
>
> OK, so how do I actually use this in a toolbar button? The documentation
> says it only has an iconSource attribute, which doesn't support an Icon
> component, and all the examples use Qt.resolvedUrl("foo.png").
Hi Sam,
I had the same problem - I don't think the docs are very clear on how
to use the theme icons with toolbar buttons.
After some experimentation, I got the following to work:
tools: ToolbarItems {
ToolbarButton {
action: Action {
text: 'Refresh'
iconSource: Qt.resolvedUrl('image://theme/reload')
onTriggered: {}
}
}
}
I can replace 'reload' with any of the standard ubuntu mobile icons
(located at: /usr/share/icons/ubuntu-mobile ) - just remember to leave
off the the file extension.
Also be aware that it won't work on your desktop machine, as the
ubuntu mobile theme isn't in use - the icons only displayed on the
device itself when I was testing.
--
Matt
[email protected]
http://mattaustin.me.uk/
--
Mailing list: https://launchpad.net/~ubuntu-phone
Post to : [email protected]
Unsubscribe : https://launchpad.net/~ubuntu-phone
More help : https://help.launchpad.net/ListHelp