Commit Graph

156 Commits

Author SHA1 Message Date
Matthias Clasen
2f544655f9 Revise CSS node documentation
Clarify the use of brackets in the CSS node diagrams:
[] means optional nodes or classes, <> means child widgets.
2015-12-16 10:58:47 -05:00
Matthias Clasen
a52c3a3db9 radiobutton: Port radio buttons to gadgets
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.
2015-12-15 08:41:16 -05:00
Matthias Clasen
67b739b58a button: Add diagrams to CSS node docs for buttons 2015-11-03 10:17:41 -05:00
Matthias Clasen
c631656f0c toggle button: Convert to css nodes
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.
2015-10-30 00:40:50 -04:00
Matthias Clasen
143d3c1204 radio button: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:36 -04:00
Matthias Clasen
0648453339 radio button: Fix directional navigation
GtkRadioButton had a deficient copy of the focus sort code
in GtkContainer, causing focus to jump over the next button
in the list. Just use _gtk_container_focus_sort() here,
which fixes the bug _and_ saves 80 lines of code.

https://bugzilla.gnome.org/show_bug.cgi?id=746817
2015-03-29 00:24:35 -04:00
Cosimo Cecchi
276a510b4b radiobutton: don't consider hidden buttons in the group for focus
When a GtkRadioButton has no focus, it will accept it when there is no
other active button in its group.
If the active button in the group is hidden, for example because the UI
desires not to have a default option pre-selected, currently the focus
will not be accepted, which is not desired behavior.

This commit changes the code to only consider visible buttons in the
group when checking whether another button is active.

https://bugzilla.gnome.org/show_bug.cgi?id=739474
2014-11-01 10:08:42 -07:00
Matthias Clasen
3f5d462305 GtkToggleButton: Move nonexported API to a private header
This is our standard practice nowadays.
2014-10-19 22:42:49 -04:00
Matthias Clasen
cc529c2423 GtkRadioButton: Allow setting group more than once
It turns out that GtkBuilder will sometimes set a property
twice. Normally, this is harmless, but for GtkRadioButton:group,
it triggered a critical. Remove that.
2014-10-02 23:37:38 -04:00
Benjamin Otte
d36bba293d checkbutton: Don't redundantly update states
States are set properly by GtkButton, there is no need to set them
manually.
2014-08-17 03:19:59 +02:00
Benjamin Otte
c1a063e1a4 checkbutton: Draw background unconditionally
We want to draw backgrounds always, not just on prelight. Themes can
decide to only set a background during prelight themselves.
2014-08-17 00:58:04 +02:00
Benjamin Otte
0f7c90ac62 radiobutton: :hover on hover
No special cases, those go in the theme.
2014-08-16 16:34:15 +02:00
Benjamin Otte
db1ab7ddf8 button: Handle :inconsistent in GtkToggleButton 2014-08-16 16:34:15 +02:00
Benjamin Otte
cd349dcd48 button: Handle :checked in gtktogglebutton.c
Don't try to handle it elsewhere.
2014-08-16 16:34:15 +02:00
Benjamin Otte
b675a13233 button: Remove depressed_on_activate
All buttons should always be marked as :active when they are pressed.
That includes checkboxes (which are never activated in real code anyway,
so this change pretty much doesn't matter).
2014-08-16 16:34:14 +02:00
Benjamin Otte
1abe923740 css: Do inconsistent checked states right
In HTML5, both pseudoclasses apply. So we do the same thing in our
widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=733967
2014-08-16 16:34:14 +02:00
Benjamin Otte
bb069b781b button: Remove depressed variable
It is not used anymore.
2014-08-16 16:34:14 +02:00
Benjamin Otte
4e077d4638 gtk: Use new :checked state
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
2014-08-16 16:34:14 +02:00
Cosimo Cecchi
8fff30090b radiobutton: don't use focus-line-width 2014-05-09 11:02:45 -07:00
Cosimo Cecchi
99f0776f19 checkbutton: don't use focus padding 2014-05-09 11:02:42 -07:00
Cosimo Cecchi
0c6cc487d6 radiobutton: always use interior focus 2014-05-09 11:02:41 -07:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
c779b42476 Docs: use // for comments in examples
Without sgml mode, we can't escape /* as /&ast; anymore,
so just switch to // for comments in examples.
2014-02-14 23:34:22 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
4dee965116 docs: use apostrophe in *'m 2014-02-07 13:42:09 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
63e887e165 docs: replace all <examples> with markdown headings 2014-02-04 16:58:54 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
Torsten Schönfeld
904bc27250 gtkradio*: add (allow-none) annotations were appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=679563
2013-12-06 23:57:16 +01:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
William Jon McCann
b101d465be Deprecate and ignore gtk-keynav-cursor-only and gtk-keynav-wrap-around 2013-06-26 15:33:10 -04:00
Alexander Larsson
1df8d18ad2 GtkCheckButton and GtkRadioButton: Implement baseline alignment 2013-04-23 05:58:07 +02:00
Emmanuele Bassi
78107b1a7d docs: Fix up the RadioButton example in the description 2012-08-20 11:03:17 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Rui Matos
6dd0bd5536 radiobutton: Use the widget state flags as a base for drawing 2012-01-09 16:31:11 +00:00
Torsten Schönfeld
4ef61e2311 gtk: add annotations for some GtkRadio* constructors
Since constructors like gtk_radio_button_new_from_widget take an
instance of their type as the first argument, the gi scanner interprets
them as methods.

https://bugzilla.gnome.org/show_bug.cgi?id=661858
2011-11-06 16:50:57 +01:00
Benjamin Otte
b314f03bf4 radiobutton: Remove redundant call
The call is done by GtkButton already, no need to override it.
2011-09-05 18:56:23 +02:00
Matthias Clasen
e2847d9637 Convert GailRadioButton to GtkRadioButtonAccessible 2011-07-05 16:08:54 -04:00
Cosimo Cecchi
9cd4a1b622 radiobutton: exclude states we set manually from the previous state
https://bugzilla.gnome.org/show_bug.cgi?id=645172
2011-03-18 15:16:02 -04:00
Cosimo Cecchi
ef5fb8d673 radiobutton: build the new state flags from the previous flags on click
This fixes e.g. sensitivity issues with GtkRadioButton on state update.

https://bugzilla.gnome.org/show_bug.cgi?id=645172
2011-03-18 15:16:01 -04:00
Martin Pitt
0e795b67c3 [GI] Mark mis-detected constructors as such
constructors which take an object of the same class as its first argument are
mis-detected as method call with "self" argument by the GIR scanner. Using the
new (constructor) annotation from bug 561264, mark some of them as proper
constuctors, so that you can call them with NULL as first argument from
bindings; in particular, this fixes gdk_window_new() and the
gtk_radio_button_new_with*() constructors.
2011-02-02 15:11:06 +01:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Pavel Holejsovsky
3c8fc21e9b [GI] Fixes of existing incorrect annotations 2011-01-20 13:56:06 +01:00
Pavel Holejsovsky
9389054da2 [GI] Add (type) annotations to real types 2011-01-20 10:38:38 +01:00
Pavel Holejsovsky
a1c297a310 [GI] Cosmetic cleanups of annotations and doc comments
This change does not introduce any functionality change, mostly
cosmtic cleanups, like re-linebreak when introduced annotations messed
up indentation or whitespace errors fixes.
2011-01-18 17:31:59 +01:00
Carlos Garcia Campos
3fff4bd091 GtkRadioButton: Use "radio" style class instead of "check" 2011-01-03 13:09:00 +01:00
Matthias Clasen
be0ed14cce Fix GtkRadioButton drawing 2010-12-04 15:39:34 +01:00
Carlos Garnacho
be4a616e6e GtkRadioButton: Use GtkStyleContext for rendering. 2010-12-04 15:39:20 +01:00