Commit Graph

149 Commits

Author SHA1 Message Date
Matthias Clasen
2a24b8c653 Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
2020-05-11 22:38:21 -04:00
Matthias Clasen
f59f355190 Use gtk_window_set_child throughout
Replace all uses of gtk_container_add on windows
by gtk_window_set_child.
2020-05-04 22:53:08 -04:00
Benjamin Otte
a278edab22 window: Remove type argument from gtk_window_new() 2020-02-14 21:18:49 +01:00
Timm Bäder
655711fef2 Rename gtk_widget{get,set,has}_style_class to _css_class
We want to use css instead of style everywhere now.
2020-02-07 13:16:45 -05:00
Timm Bäder
b7ee2cbc28 Start using GtkWidget's new style class API 2020-02-07 13:16:32 -05:00
Benjamin Otte
553a9c292d togglebutton: Don't emit clicked during set_active()
set_active() is meant to set the state of the property, which happens
during setup.
The clicked signal is emitting events from user actions.

It is impossible to use Togglebuttons for MVC applications as long as it
does that.
2019-10-29 04:56:19 +01:00
Matthias Clasen
cf47bb9355 gtk: Stop using gtk_button_clicked
This function is going away.
2019-05-18 14:27:09 -04:00
Benjamin Otte
a44ac75e65 gtk: Don't include gtkstylecontext.h from gtkcsstypesprivate.h
And make sure it's included everywhere it's needed.
2019-03-19 08:53:25 +01:00
Timm Bäder
0fdd061bf5 togglebutton: Remove priv pointer 2018-03-30 23:15:04 +02:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -05:00
Daniel Boles
1e8a166e34 ToggleButton: Actually show buttons in new snippet
Also, create a Window, instead of a Dialog without a transient parent,
which is (noisily) discouraged. Then s/content_area/box/g to match.
2017-10-11 21:15:54 +01:00
Timm Bäder
236098f89b togglebutton: Fix code snippet
Remove gtk_box_pack_start usage, gtk_dialog_get_content_area, fix wrong
gtk_dialog_new parameters and actually add a output_state callback.
2017-10-11 12:35:55 +02:00
Timm Bäder
2aea8dfee9 togglebutton: Move :inconsistent to GtkCheckButton 2017-01-30 18:11:00 +01:00
Timm Bäder
66d584ce6e togglebutton: Move :draw-indicator property to GtkCheckButton
It's not used in GtkToggleButton at all, only in GtkCheckButton and
GtkRadioButton.
2017-01-30 18:11:00 +01:00
Timm Bäder
ea897c6df4 Remove gtk_widget_show_all 2017-01-20 21:37:04 +01:00
Piotr Drąg
a2da4ddceb Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00
Timm Bäder
8d36fbfbaa togglebutton: Remove unused defines 2016-12-03 13:19:25 +01:00
Timm Bäder
41f5d3b14c Remove GtkToggleAction 2016-10-18 00:34:40 +02:00
Timm Bäder
7e16396cc5 button: Stop implementing GtkActivatable 2016-10-18 00:29:18 +02:00
Benjamin Otte
e1a03ead7a Use NULL for generic marshallers in g_signal_new()
glib will use the correct marshaller automatically. And as a side
effect, we also get all glib optimizations, like a va marshaller.
2016-08-29 16:20:54 +02:00
Matthias Clasen
94f0cef6fc Minor documentation improvement
https://bugzilla.gnome.org/show_bug.cgi?id=583780
2016-03-06 10:23:49 -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
b350779a6f togglebutton: Add a style class
This lets us differentiate toggle buttons from plain buttons
with button.toggle, without having to redo all the styling.
2015-10-29 23:04:47 -04:00
Matthias Clasen
0e4589d902 toggle 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
3f5d462305 GtkToggleButton: Move nonexported API to a private header
This is our standard practice nowadays.
2014-10-19 22:42:49 -04:00
Benjamin Otte
eecbe5416e togglebutton: Remove unneeded code
The state is completely handled by gtkbutton.c so no need to do anything
in the togglebutton.
2014-08-16 16:34:16 +02:00
Benjamin Otte
1febbdb499 togglebutton: Don't duplicate button code
It's the same code, so no need to write the same vfunc twice.
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
Matthias Clasen
08e5efd605 Bring back redundant notifications for GtkToggleButton::draw-indicator
GtkCheckButton sets a different initial value for this property without
actually changing the declared default, and then relies on change notification
to update other properties (such as xalign). This, combined with glades
insistance on putting default values into ui files creates a situation
where we can't remove the redundant notification for ::draw-indicator
without causing lots of checkboxes to suddenly have centered labels.
This was seen in gnome-terminal, evolution, and other applications.

Therefore, keep the extra notification for now. This can be revisited
when we clean up the button hierarchy.
2014-06-27 21:22:40 -04:00
Matthias Clasen
1b3542419c GtkToggleButton: Queue a redraw on enter/leave
Without this, we don't redraw consistently for prelight state changes.
2014-06-24 13:03:47 -04:00
Matthias Clasen
e3dc90dc9b GtkToggleButton: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:01 -04: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 /* anymore,
so just switch to // for comments in examples.
2014-02-14 23:34:22 -05:00
William Jon McCann
37a8ee6e95 docs: fully break lines in examples
Try to do a better job of keeping example content
from being too wide. It is often rendered as <pre>
text so the only time we can wrap it is in the source.

It is best to full break lines at all punctuation and
to try to keep the width under 70 chars or so.
2014-02-12 18:42:50 -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
13998c55e7 docs: use proper quotations instead of '*' 2014-02-07 14:22:39 -05:00
William Jon McCann
4dee965116 docs: use apostrophe in *'m 2014-02-07 13:42:09 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -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
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -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
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04: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