This was already mostly done by inheritance from GtkCheckButton.
To complete it, stop using the draw_indicator vfunc for radio
buttons, and instead make the indicator gadget draw either a
check or radio.
Use a gadget for the button, and for the indicator.
A complication here is that GtkCheckButton (and
GtkRadioButton) have a totally different appearance
depending on the ::draw-indicator property. If an
indicator is not required, we just reuse the
GtkButton gadget.
This mostly works; some minor sizing issues left, e.g. cranking
up the indicator-size causes the checkbutton grid in testgtk
to overlap.
Instead of having old and new style, now have a GtkCssStyleChange opaque
object that will compute the changes you are interested in for you.
This simplifies change signal handlers quite a bit and avoids lots of
repeated computation in every signal handler.
Convert GtkToggleButton and its subclasses to CSS nodes.
Keep the button element name for when we want to render
these button-like (but with .toggle, .check and .radio
style classes for differentiation).
When we want to render them with an indicator, use distinct
element names checkbutton and radiobutton, and add a subnode
for the indicator with name check or radio.
This is a hack to get around the optimizations done by the CSS engine.
The CSS engine will notice that no CSS properties changed on the
widget itself when going from one state to another and not queue
a redraw.
And the reason for no properties changing will be that only the
checkmark itself changes, but that is hidden behind a
gtk_style_context_save()/_restore() pair, so it won't be caught.
on:
- GtkToggleButton
- GtkCheckButton
- GtkRadioButton
- GtkModelButton
- GtkCellRendererToggle
- GtkCheckMenuItem
also update themes:
- Adwaita
- Raleigh
but not the win32 theme.
The new :checked state replaces :active for the actual checkedness of
the widgets and :active is now used exclusively while the button is being
pressed.
https://bugzilla.gnome.org/show_bug.cgi?id=733967
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.
'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.
'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.
'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.
https://bugzilla.gnome.org/show_bug.cgi?id=649567
of limiting it to it's minimum size.
This fixes height-for-width labels inside a GtkCheckButton, for some
reason GtkCheckButton was limiting the child allocation to the child's
minimum request, probably for the sake of virtual left-alignment of
the child label to be beside the checkmark. This should be done by
other means if nescesarry.