Commit Graph

122 Commits

Author SHA1 Message Date
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Timm Bäder
36ab70ddf5 widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well
change the size-allocate signature to include a out_clip parameter, just
like GtkCssGadget did. And since we now always propagate baselines, we
might as well pass that one on to size-allocate.

This way we can also make sure to transform the clip returned from
size-allocate to parent-coordinates, i.e. the same coordinate space
priv->allocation is in.
2017-07-19 21:27:16 -04:00
Timm Bäder
68c35bbe15 bbox: Don't report a horizontal baseline 2017-07-19 21:27:15 -04:00
Timm Bäder
c0f6a97eed buttonbox: Compute clip directly 2017-07-19 21:27:14 -04:00
Timm Bäder
2ba07901db buttonbox: Remove gadget 2017-07-19 21:27:12 -04:00
Timm Bäder
b749de8b8f buttonbox: Don't use the parent gadget 2017-07-19 21:27:11 -04:00
Timm Bäder
1425bfa95d bbox: Remove css box drawing
Whether we are in expand mode or not shouldn't really make a difference
for rendering anyway.
2017-07-19 21:27:11 -04:00
Timm Bäder
c92b7d4224 box: Remove fill child property
GtkWidget:halign and GtkWidget:valign are sufficient
2017-04-25 20:30:37 +02:00
Timm Bäder
5729ea7744 box: Remove expand child property
GtkWidget already has hexpand/vexpand properties.
2017-04-25 20:30:37 +02:00
Timm Bäder
f860ff8647 widget: Remove get_valign_with_baseline
This only existed for backwards compat reasons which aren't interesting
for gtk4.
2017-03-05 15:18:32 +01:00
Timm Bäder
47d4ad71fb Remove gtk_container_snapshot_child
Replace it with the already existing gtk_widget_snapshot_child.
2017-01-07 17:19:30 +01:00
Benjamin Otte
0dbdf0c428 gadget: Remove gtk_css_gadget_draw()
And with it, remove the draw func from custom gadgets, that has been
NULL everywhere.

All gadgets are snapshot now.
2016-12-20 18:01:12 +01:00
Benjamin Otte
8c77b6f7f1 snapshot: Convert GtkButtonBox 2016-11-15 17:48:45 +01:00
Benjamin Otte
da207c9fdd snapshot: Add a snapshot function to GtkCssCustomGadget 2016-11-15 17:48:45 +01:00
Timm Bäder
9992a616ef widget: Use ::measure vfunc to measure size
Add a new ::measure vfunc similar to GtkCssGadget's that widget
implementations have to override instead of the old get_preferred_width,
get_preferred_height, get_preferred_width_for_height,
get_preferred_height_for_width and
get_preferred_height_and_baseline_for_width.
2016-10-22 19:05:47 +02:00
Matthias Clasen
b8acd23a86 GtkButtonBox: Convert to indirect rendering 2016-10-18 11:49:13 +01:00
Timm Bäder
7d47d8023e bbox: Remove style properties 2016-10-18 00:29:16 +02:00
Benjamin Otte
4df6ddad54 API: container: Remove gtk_container_set_border_width() 2016-10-16 18:18:58 +02:00
Timm Bäder
f45dadadd0 box: Remove 'padding' child property 2016-10-16 18:17:21 +02:00
Carlos Garcia Campos
170cb01675 Revert "Remove _gtk_box_get_children"
This reverts commit 572e9a0402.

_gtk_box_get_children was not doing exactly the same than
gtk_container_get_children does, because the latter uses the forall
implementation of GtkBox that takes into account the children pack mode while
the former just iterated the list of children. This broke the order of
the buttons in a GtkButtonBox when they were packaged with PACK_END.
2016-02-12 13:29:21 +01:00
Timm Bäder
572e9a0402 Remove _gtk_box_get_children
It's doing exactly the same thing as gtk_container_get_children.
2016-02-04 13:32:34 +01:00
Matthias Clasen
0520ca3bdf buttonbox: Fix size request
A copy-paste mistake was making us always request too little
space, causing the buttons to be jumbled or cut off.

https://bugzilla.gnome.org/show_bug.cgi?id=759664
2015-12-20 17:03:06 -05:00
Matthias Clasen
acd339a9a5 buttonbox: Convert to gadgets
Set a css name and use a gadget for button box allocation and
drawing.
2015-12-18 06:52:35 -05:00
Matthias Clasen
e02c21fdd8 button box: Deprecate style properties
These can all be replaced by standard CSS properties.
2015-12-15 08:41:16 -05:00
Matthias Clasen
8fea3ebfa0 button box: Document some style properties as deprecated
No code change.
2015-11-16 07:20:18 -05:00
Matthias Clasen
62dce64a48 Remove a self-assignment
clang doesn't like those.
2015-08-09 23:38:40 +02:00
Lars Uebernickel
2dda89cbd5 GtkButtonBox: remove spacing when buttons are linked
GtkButtonBox adds the "linked" class to its style context when its
layout is set to GTK_BUTTONBOX_EXPAND. It shouldn't ever make sense to
have spacing between buttons in that case, as themes generally draw
linked elements with a continuous border.

Thus, always set spacing to 0 and ignore GtkDialog's button-spacing
style property when the layout is set to EXPAND.

Also remove the now-redundant css rules which set button-spacing to 0
for message dialogs.

https://bugzilla.gnome.org/show_bug.cgi?id=752131
2015-07-14 15:12:56 +02:00
Will Thompson
371a3a7871 bbox: correct documentation typo 2015-03-26 14:01:53 +00:00
Matthias Clasen
e423c045d5 GtkButtonBox: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:30:52 -04:00
Michael Catanzaro
0c55b841fc Fix a typo 2014-05-17 22:21:14 -05:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
13998c55e7 docs: use proper quotations instead of '*' 2014-02-07 14:22:39 -05:00
William Jon McCann
701651a0a5 docs: don't use properties syntax for child properties 2014-01-21 18:57:37 -05:00
William Jon McCann
9717e75ffe docs: there is no homogeneous property on bbox 2014-01-21 18:57:37 -05:00
Matthias Clasen
1258eadd75 button box: Set linked style for extend
This is needed for proper styling of the new extend-placement
in button boxes.
2014-01-17 17:52:07 -05:00
William Jon McCann
00326d3362 Add an expand button box type
https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:07 -05: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
Benjamin Otte
bd4d00918e API: Don't export gtk_widget_preferred_size_and_baseline()
gtk_widget_preferred_size() is only useful if you want to quickly port a
widget from GTK2 sizing code to GTK3 but does not properly work with
height-for-width as used in GTK. So we don't want to encourage people to
use it. In particular we want people to convert to height-for-width
before adding baseline support to their widgets.
2013-05-11 14:48:01 +02:00
Alexander Larsson
e64c1f8929 GtkButtonBox: Support baseline alignment 2013-04-23 05:58:07 +02:00
Matthias Clasen
050cba6a31 Fix malformed doc comments
Most of these are forgotten :'s and similar details
which gtk-doc now warns about.
2012-04-12 21:12:16 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Murray Cumming
a0b4ab109d Documentation: Correct references to properties.
These should use :, not ::, though signals would use ::.
See
http://developer.gnome.org/gtk-doc-manual/unstable/documenting_syntax.html.en
and
http://developer.gnome.org/gtk-doc-manual/unstable/documenting_symbols.html.en
2012-02-15 11:43:33 +01:00
Javier Jardón
8985ce3b72 gtkbox: Move private functions to private header 2011-10-02 21:30:42 +01:00
Murray Cumming
151bcc6dfa Box, etc: Improve docs after H* and V* deprecations.
Stop documenting the base class as just a base class for the
H and V specializations, copying the useful descriptions from
those H/V classes to the base class. Do not advise the use of
the H/V classes or refer to them unnecessarily.
2011-06-10 09:50:45 +02:00
Matthias Clasen
b8fe808e15 GtkButtonBox: add a non-homogeneous child property
This makes it easier to add things like lock buttons in
dialogs. Part of #626457.
2011-05-05 07:46:03 -04: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
Matthias Clasen
16877b4d7b Reduce includes of gtktypeutils.h to a minimum 2011-01-04 12:05:05 -05:00
Matthias Clasen
a83b0b68ce Handle empty button boxes gracefully
https://bugzilla.gnome.org/show_bug.cgi?id=633915
2010-11-05 22:19:50 +09:00
Michael Natterer
ca6398a649 gtk: remove all border_width handling from the button box
and let GtkContainer do the job; fixes doubled border widths. GtkBox
did already delegate border handling to Gtkcontainer, which interacted
badly with a subclass that didn't.
2010-11-02 12:04:36 +09:00
Matthias Clasen
ef03dc3fc6 Don't set get_preferred_width_for_height to NULL
The size request machinery expects that it is non-NULL.
2010-10-30 17:37:02 +09:00