Change the default icons of Switch and Checkbox
Bug #1211483 reported by
Giulio Collura
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
lp:~tpeeters/ubuntu-ui-toolkit/littleSwitch
- PS Jenkins bot: Approve (continuous-integration)
- Cris Dywan: Approve
-
Diff: 260 lines (+133/-44)2 files modifiedmodules/Ubuntu/Components/Themes/Ambiance/SwitchStyle.qml (+132/-43)
modules/Ubuntu/Components/Themes/Ambiance/qmldir (+1/-1)
Changed in ubuntu-ui-toolkit: | |
importance: | Undecided → Wishlist |
Changed in ubuntu-ui-toolkit: | |
status: | New → Triaged |
Changed in ubuntu-ui-toolkit: | |
status: | Triaged → In Progress |
Changed in ubuntu-ui-toolkit: | |
status: | Fix Committed → Fix Released |
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.
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 Components. Themes. Ambiance 1.1 as Ambience
import Ubuntu.Components 1.1
import Ubuntu.
MainView { edToolbar: false
id: root
useDeprecat
width: units.gu(30)
height: units.gu(40)
Switch {
anchors. centerIn: parent SwitchStyle {
checkedIco nSource: "image: //theme/ stock_video"
uncheckedI conSource: "image: //theme/ stock_image"
checkedThu mbColor: "red"
id: testSwitch
width: units.gu(10)
height: units.gu(5)
checked: true
style: Ambience.
}
}
}