Change the default icons of Switch and Checkbox

Bug #1211483 reported by Giulio Collura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Fix Released
Wishlist
Unassigned
ubuntu-ui-toolkit (Ubuntu)
Fix Released
Undecided
Unassigned
Vivid
New
Undecided
Unassigned
ubuntu-ui-toolkit (Ubuntu RTM)
Fix Released
Undecided
Unassigned

Bug Description

Hello everybody,
I'm developing an app which needs a Camera to took photos and videos and I'd like to use a Switch (or a Checkbox, they are pretty equivalent) to change the current modality (photo | video). It would be more intuitive for the user if I could change the default icons with a small symbolic icon of a photo and of a video.
On IRC, they suggested me to create a custom style for those widgets, but it would be better (for more use cases) if this functionality would be supported by the sdk.

Thanks your time and support,

Giulio

Related branches

Changed in ubuntu-ui-toolkit:
importance: Undecided → Wishlist
Zsombor Egri (zsombi)
Changed in ubuntu-ui-toolkit:
status: New → Triaged
Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
status: Triaged → In Progress
Revision history for this message
Tim Peeters (tpeeters) wrote :

I'm exposing the icons in the SwitchStyle in the linked branch. So when that lands, you can use the following to change the look of the Switch for a single instance (for more instances, it is recommended to create a custom theme that derives from Ambience instead of this):

import QtQuick 2.2
import Ubuntu.Components 1.1
import Ubuntu.Components.Themes.Ambiance 1.1 as Ambience

MainView {
    id: root
    useDeprecatedToolbar: false

    width: units.gu(30)
    height: units.gu(40)

    Switch {
        id: testSwitch
        anchors.centerIn: parent
        width: units.gu(10)
        height: units.gu(5)
        checked: true
        style: Ambience.SwitchStyle {
            checkedIconSource: "image://theme/stock_video"
            uncheckedIconSource: "image://theme/stock_image"
            checkedThumbColor: "red"
        }
    }
}

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

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

Changed in ubuntu-ui-toolkit:
status: In Progress → Fix Committed
Zoltan Balogh (bzoltan)
Changed in ubuntu-ui-toolkit:
status: Fix Committed → Fix Released
Zsombor Egri (zsombi)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Fix Released
Changed in ubuntu-ui-toolkit (Ubuntu RTM):
status: New → Fix Released
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.