After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 669811 - Checkbox widget
Checkbox widget
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: st
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks: 652459
 
 
Reported: 2012-02-10 15:30 UTC by Stef Walter
Modified: 2012-02-17 17:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a checkbox widget (8.03 KB, patch)
2012-02-15 16:41 UTC, Florian Müllner
committed Details | Review
Example usage of the widget (98.04 KB, image/png)
2012-02-15 16:43 UTC, Florian Müllner
  Details
checkbox widget SVG (9.74 KB, image/svg+xml)
2012-02-16 13:09 UTC, Jakub Steiner
  Details
forgot to narrow it though :) (9.70 KB, image/svg+xml)
2012-02-16 13:11 UTC, Jakub Steiner
  Details
unchecked state (6.81 KB, image/svg+xml)
2012-02-16 13:11 UTC, Jakub Steiner
  Details
theme: Adjust checkbox style (18.50 KB, patch)
2012-02-16 13:53 UTC, Florian Müllner
committed Details | Review

Description Stef Walter 2012-02-10 15:30:46 UTC
As part of the gnome-keyring prompting work I tried to implement a simple checkbox using StButton. However it doesn't seem to be capable enough, both in design, and implementation:

From Florian Müllner:
> 'check-box' (single quotes!) is very generic (which is fine by me), but the
> corresponding CSS is not - I wonder if it would be clearer to use a composite
> widget here (for instance a BoxLayout with a Bin (for the check-box image) and
> a Label) and set it as the Button child. In addition to the artwork, the
> ellipsized label also feels wrong (in my testing, I get "Automatically unlock
> this keyring whenever ...", which means the most important part is missing). I
> suspect this is way easier to fix with a custom Button child than with crazy
> CSS.

I agree that it needs to be done better. I tried to do it similar to what
you're suggesting but ran out of time somewhere between undocumented St toolkit,
unfamiliar (or strange) clutter behavior, and CSS selectors that didn't work as
expected. In addition a new widget would need to support keyboard, active,
focus, hover and other things I'm sure. StButton has all those already, so that was the reason behind restyling it.

The ellipsizing behavior of StButton is quite brittle, and should probably be
tweaked or removed. I can imagine it running into problems with translated
labels as well.

In addition the checkbox needs to have its look designed properly.

So here's a new bug for properly designing a checkbox control.
Comment 1 Florian Müllner 2012-02-15 16:41:54 UTC
Created attachment 207669 [details] [review]
Add a checkbox widget

gnome-keyring dialogs need checkboxes, and while it is possible to
get pretty close using CSS tricks, a dedicated widgets yields better
results.
Comment 2 Florian Müllner 2012-02-15 16:43:37 UTC
Created attachment 207670 [details]
Example usage of the widget
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-02-15 21:02:22 UTC
Review of attachment 207669 [details] [review]:

While I'm not a fan of the Shell.GenericContainer, this is good for now.
Comment 4 Florian Müllner 2012-02-15 21:16:02 UTC
Attachment 207669 [details] pushed as e2726f3 - Add a checkbox widget

Sure, I expect a get-rid-of-generic-container cleanup at some point, but until then I don't see a good reason to avoid it (especially as the usage here is hardly very sophisticated)
Comment 5 Stef Walter 2012-02-15 22:42:40 UTC
Wonderful. Looks nice :)
Comment 6 Jakub Steiner 2012-02-16 13:09:40 UTC
Created attachment 207761 [details]
checkbox widget SVG

I've made the checkbox as tall as the on/off switch by default.
Comment 7 Jakub Steiner 2012-02-16 13:11:17 UTC
Created attachment 207762 [details]
forgot to narrow it though :)
Comment 8 Jakub Steiner 2012-02-16 13:11:41 UTC
Created attachment 207763 [details]
unchecked state
Comment 9 Florian Müllner 2012-02-16 13:53:31 UTC
Created attachment 207774 [details] [review]
theme: Adjust checkbox style

Replace the original hacked-up style with some original Steiner
artwork.
Comment 10 Florian Müllner 2012-02-16 13:55:52 UTC
Reopening for the style update.
Comment 11 Jasper St. Pierre (not reading bugmail) 2012-02-16 15:06:05 UTC
Review of attachment 207774 [details] [review]:

Go for it.
Comment 12 Florian Müllner 2012-02-17 17:40:21 UTC
Attachment 207774 [details] pushed as 36c3ce9 - theme: Adjust checkbox style