Disabling the control in a ListItem should also disable clicks on the ListItem itself

Bug #1166982 reported by Stuart Langridge on 2013-04-09
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Fix Released
Tim Peeters
Ubuntu UX
Calum Pringle
ubuntu-ui-toolkit (Ubuntu)

Bug Description

import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1 as ListItem

MainView {
    width: units.gu(40)
    height: units.gu(60)

    ListView {
        anchors.fill: parent
        model: 5
        delegate: ListItem.Standard {
            text: "Clicking shouldn't change the checkbox"
            control: CheckBox {
                enabled: false
                checked: true

Here, the CheckBox is disabled. However, if you click the ListItem, it still toggles the CheckBox even though the CheckBox is disabled. A ListItem with a disabled control should stop forwarding clicks to the control.

Note: we don't want to enabled:false the ListItem itself. That makes the ListItem have the disabled appearance. The goal here is to have the ListItem look normal but make it clear that you can't toggle it, not to make the ListItem itself look disabled.

The use case is for friends-app, when posting a new status update. If you have multiple accounts, you get a list of them with checkboxes below the posting textarea, so you can select where it posts to. If you have only one account, you should not be able to uncheck it (that would mean that you are posting to nowhere).
However, if you enabled:false the whole ListItem, then it looks like you are not posting to that account at all (because it looks disabled), which is not the case. What it should look like is that you are posting to that account and you can't turn it off, hence the requirement to disable the checkbox, not the whole listitem. Disabling the checkbox gives the correct appearance, but clicking the listitem still, incorrectly, toggles the disabled checkbox.

Related branches

Zoltan Balogh (bzoltan) on 2013-04-10
Changed in ubuntu-ui-toolkit:
importance: Undecided → Critical
assignee: nobody → Tim Peeters (tpeeters)
Tim Peeters (tpeeters) on 2013-04-10
Changed in ubuntu-ui-toolkit:
status: New → Confirmed
Tim Peeters (tpeeters) on 2013-04-11
Changed in ubuntu-ui-toolkit:
status: Confirmed → In Progress
Tim Peeters (tpeeters) wrote :

If the control is disabled, should the list item still be highlighted when it is pressed?

Stuart Langridge (sil) wrote :

Am I right in thinking that a ListItem which has a disabled control in it won't do anything if clicked? If that is correct, then it should not be highlighted. I think that if a ListItem with a control inside can do different things when the ListItem is clicked from when the control is clicked, that's confusing, but if that *is* the case, then I'm not sure about the highlight.

It is possible that you don't mean "highlight while it is pressed" (that is, some sort of 'currently pressed' visual effect) but instead you mean a QML list highlight -- the thing that specifically highlights the currently *selected* ListItem. If that is the case, then I think that a ListItem with a disabled control should still be able to get the highlight: if you don't want it to be highlightable, then disable the whole LIstItem, not just its control.

Tim Peeters (tpeeters) wrote :

I will disable highlighting of a list item with disabled control, until we get feedback from design that says we should do otherwise.

Changed in ubuntu-ux:
assignee: nobody → Xi Zhu (xi.zhu)
Changed in ubuntu-ux:
assignee: Xi Zhu (xi.zhu) → Calum Pringle (calumpringle)
Tim Peeters (tpeeters) wrote :

Do we really need to support the disabled control?

<ckpringle> If it can't be turned off, there shouldn't be an on / off switch

Tim Peeters (tpeeters) wrote :

Could you add a screenshot of the design that shows the bug, to get feedback from design? Perhaps the design of the app should be changed.

Matthew Paul Thomas (mpt) wrote :

Tim, I don't know what you mean by "support" in this context. But one example of an insensitive switch in a list item is the "Cellular" settings "Data Roaming" switch, which should be insensitive whenever "Cellular Data" is off. <https://wiki.ubuntu.com/Networking#Phone> I expect to produce more examples as I design more of System Settings.

When a switch is turned off or a checkbox is unchecked, sometimes it is appropriate to hide dependent controls completely. Other times it is more appropriate just to make them insensitive. Which is more appropriate depends on how instructive the dependent stuff is when it's insensitive (e.g. backup options showing you what kind of backups you can do even when backup is off), conversely how confusing the dependent stuff is when you aren't using it (e.g. proxy settings when you aren't using a proxy), and whether there's any independent stuff below the dependent stuff (because either sliding the independent stuff up and down, or having a blank space, could be awkward). Always hiding would be inappropriate, and so would always desensitizing.

Tim Peeters (tpeeters) wrote :

Thanks for clearing it up mpt. I'll make the disabled controls work as expected, and in this specific case, Stuart and Calum can discuss among themselves whether to show a disabled control or not.

PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:ubuntu-ui-toolkit at revision 439, scheduled for release in ubuntu-ui-toolkit, milestone Unknown

Changed in ubuntu-ui-toolkit:
status: In Progress → Fix Committed
Changed in ubuntu-ui-toolkit:
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (23.9 KiB)

This bug was fixed in the package ubuntu-ui-toolkit - 0.1.46daily13.06.05.1-0ubuntu1

ubuntu-ui-toolkit (0.1.46daily13.06.05.1-0ubuntu1) saucy; urgency=low

  [ Zoltán Balogh ]
  * update the example app for the latest UI Toolkit.
  * A simple app to check few locales.
  * Add qttools5-dev-tools to build dependencies to provide
    qhelpgenerator for creating QtC help files from documentation.
  * Build documentation and publish the qch file.
  * Offer symlinks for qmlscene via 'qmlrunner' package. See package
    description for usage instructions. (LP: #1155634). (LP: #1155634)

  [ Loïc Molinari ]
  * [UbuntuShape] Correctly stored the current material. (LP: #1132771)
  * [UbuntuShape] Ensured the texture is available in updatePaintNode().
    (LP: #1171437)

  [ Kaleo ]
  * QML_IMPORT_PATH is deprecated for QtQuick 2.0. Switch to
  * Added syntax description for CHANGES file in CHANGES.syntax.
  * UCScalingImageProvider: respect 'requestedSize' parameter. That
    ensures that the 'sourceSize' property of Image is respected even
    when the toolkit automatically scales the asset for the device. (LP:
  * Added documentation for bitmap suffixes in the resolution
    independence page. (LP: #1092051)
  * Revamped component showcase now called 'Ubuntu UI Toolkit Gallery'.
    Works on Ubuntu Touch. (LP: #1130603)
  * Benchmarks for time critical components.
  * Added ListItem.ValueSelector example. Fixed incorrect 'Multi value'
    label. (LP: #1172663)
  * Toolkit Gallery: added examples for Sheets.
  * Automatic rotation of applications depending on the device
    orientation. For applications that are using MainView, they opt-in
    by setting 'automaticOrientation' to true. New component
    OrientationHelper for applications that do not use MainView but
    still need an easy way to automatically rotate.
  * UbuntuShape: fix slight distortion of image when set. This
    distortion was quite disturbing when the content has text in it, as
    it is often the case in Popups and Popovers. (LP: #1170878)
  * Use standard animation ubuntu snap beat for popups fade in.
  * Removed unnecessary clipping from Tabs, Popover, Dialog and
  * All ListItems: set default contents right and left margins to 2 gu.
    ListItems Base, Standard and ValueSelector: deprecated private
    properties __leftIconMargin and __rightIconMargin IconVisual
    (private): removed properties leftIconMargin and rightIconMargin
    Standard: removed ugly progression highlight background when there
    is no split.
  * ListItems: constrain size of the icon by default. Deprecated private
    properties __iconWidth and __iconHeight.
  * Ubuntu UI Toolkit Gallery tweaks: - Made window wider and left
    column the width of the phone: 40gu. - Removed 'slider.' from Slider
    example's labels. - Renamed 'Switches' into 'Toggles'. Renamed
    'Progress Bars' into 'Progress and activity'. - Use resolution
    independence for navigation example screenshots.
  * Support source with quotes in .sci files. (LP: #1080719)
  * Reverted unjustified changes to ubuntu-ui-toolkit-gallery.desktop.
  * Popover: simplified com...

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Fix Released
Changed in ubuntu-ux:
status: New → Fix Released
Rolf Leggewie (r0lf) wrote :

raring has seen the end of its life and is no longer receiving any updates. Marking the raring task for this ticket as "Won't Fix".

Changed in ubuntu-ui-toolkit (Ubuntu Raring):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers