No way to style OptionSelector without accessing internals

Bug #1257529 reported by Robert Schroll
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Incomplete
Low
Tim Peeters

Bug Description

There is (apparently) no way to style an OptionSelector short of providing your own OptionSelectorDelegate. This requires you to copy and modify the stock OptionSelectorDelegate, which relies on internal implementation details of the OptionSelector. When these details change, the OptionSelector using the old custom Delegate may break.

This was recently a problem: OptionSelector.isExpanded changed to .currentlyExpanded, breaking a Delegate I have that used the old variable name (https://github.com/rschroll/beru/blob/restricted/ui/components/StylableOptionSelectorDelegate.qml). This was discussed on the mailing list: https://lists.launchpad.net/ubuntu-phone/msg05430.html.

Revision history for this message
Robert Schroll (rschroll) wrote :

A related bug is #1220533, wherein I offered a patch to make the Labels for the text and subtext part of the external API. This was rejected on the mailing list (https://lists.launchpad.net/ubuntu-phone/msg04025.html), where the use of a custom Delegate was suggested.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

assigning for follow up

Changed in ubuntu-ui-toolkit:
assignee: nobody → Tim Peeters (tpeeters)
importance: Undecided → Medium
Revision history for this message
Tim Peeters (tpeeters) wrote :

Some things went wrong in updating the OptionSelector APIs, but they should be resolved now.

Is this issue still valid? OptionSelectorDelegate is a public component, so you can make your component inherit from it instead of copying it.

Changed in ubuntu-ui-toolkit:
status: New → Incomplete
Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
importance: Medium → Low
Revision history for this message
Robert Schroll (rschroll) wrote :

As far as I can tell, there's still no way to change the font or color of the labels, for example, short of copying the code and doing it yourself. This is not a function of whether OptionSelectorDelegate is public or private, but of whether OptionSelectorDelegate gives you the access to its interals. Currently, it does not.

That's okay, if sub-optimal, if the interface between OptionSelector and OptionSelectorDelegate is public and unchanging. When the bug was submitted, this was not the case. This interface was considered private and was subject to change without warning. If this interface is now considered public, then this bug is solved. Otherwise, it still exists.

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

The optionselector delegate is basically a list item, so when that gets a configurable font color, the issue here is solved.

The initial question/issue raised in this bug (broken optionselector api) has been resolved, and as a reference for the label color, I'll mark this bug as a duplicate of another bug that requests configurable label color.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.