Commit Graph

225 Commits

Author SHA1 Message Date
Alexander Larsson
7bee22bcb6 Avoid some more type checks for internal calls 2017-01-11 15:27:51 +01:00
Daniel Boles
2a7171534e Box: Restore an accidentally deleted comment
Also, split a MAX() onto its own line to match the others.
2016-12-26 10:57:51 +00:00
Daniel Boles
71bbd8881f Box: avoid recalc/reassignments, improve var names
Homogeneous branches repeated the calculation/assignment of the initial
space available to children. This avoids that by shuffling some code.

Perhaps more importantly, in doing that, I ended up with some ambiguous
names, and Company and I realised how vague the pre-existing naming was.
"size" becomes "extra_space", as this is what it represents. Conversely,
"extra" becomes "size_given_to_child" (albeit still given out in two
different ways depending on whether the Box is homogeneous). My hope is
that these sections of code are now somewhat less baffling than before!
2016-12-25 23:16:14 +00:00
Daniel Boles
5d10174031 Box: Don't unnecessarily repeat a function call
The spacing was already saved in a variable just above.
2016-12-25 21:46:40 +00: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
75c3d193f6 box: Implement support for border-spacing 2016-12-10 04:32:55 +01:00
Benjamin Otte
5aea108802 box: Remove unused member variable 2016-12-10 04:32:55 +01:00
Benjamin Otte
8ac7918e0b snapshot: convert GtkBox 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
6488dde4fd box: Use measure() to measure child sizes 2016-10-31 12:20:41 +01:00
Timm Bäder
76ff53193a box: Mark out params of _query_packing as (optional) 2016-10-31 12:20:41 +01:00
Timm Bäder
3154d3f258 box: Remove unused private API 2016-10-31 12:20:41 +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
Emmanuele Bassi
137ff8ede7 box: Port from immediate to deferred rendering
Drop the ::draw() vfunc implementation in favour of the
::get_render_node() vfunc.
2016-10-18 11:49:10 +01: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
Timm Bäder
fb3d9022ad Remove GtkHBox 2016-10-16 18:17:21 +02:00
Christoph Reiter
4556d0f0fe gtkbox: remove unnecessary queue_compute_expand()
The expand child property does not have any effect on the
expand state of the GtkBox, so queuing a compute_expand
when changing it is not needed.

https://bugzilla.gnome.org/show_bug.cgi?id=769162
2016-08-01 09:02:04 -04:00
Matthias Clasen
bf66cd1e94 box: Only emit ::child-notify when necessary
We can easily check if the values for expand, padding and so forth
actually changed, so lets do it.
2016-05-04 15:05:08 -04:00
Matthias Clasen
6b53138a01 box: Fix rtl allocation with center widget
The code for adjusting the center widget allocation in case
of uneven sides never worked right in RTL. This was finally
noticed for tabs with close button, which commonly use a
centered label.
2016-02-20 16:45:26 -05: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
7743944124 GtkBox: Documentation tweak 2016-01-13 00:39:53 -05:00
Matthias Clasen
2677eee720 box: Document child node ordering 2016-01-12 23:40:28 -05:00
Matthias Clasen
d81f8c1025 box: Add a way to get the gadget
This will be used in GtkButtonBox.
2015-12-18 07:37:52 -05:00
Matthias Clasen
9c88256441 box: Trivial doc change
All the CSS sections are named CSS nodes, so do the same here.
2015-12-15 08:41:16 -05:00
Benjamin Otte
49fea0b0f5 box: Port to gadgets 2015-12-15 08:41:16 -05:00
Timm Bäder
88b4955fd9 GtkBox: The center widget can be NULL
Propagates to GtkActionBar.
2015-12-01 13:41:35 +01:00
Matthias Clasen
95df0fb6f5 box: Use an element name 2015-11-19 07:07:26 -05:00
Benjamin Otte
a7816909ef box: Refactor CSS node handling
Only update the node that changed, don't invalidate everything.
2015-11-09 01:48:14 +01:00
Benjamin Otte
bed3ff2737 box: Don't track children visibility
It's not necessary anymore with css nodes.
2015-11-09 01:48:14 +01:00
Matthias Clasen
1e4369e8ef box: Convert to gtk_container_child_notify_by_pspec
For the same reasons as g_object_child_notify_by_pspec.
2015-09-08 08:07:32 -04:00
Matthias Clasen
0f92a43e10 Move GtkWidgetPrivate to gtkwidgetprivate.h
This lets us use inlined getters for members in there,
avoiding the type checks in the public getters.
2015-09-07 02:40:22 -04:00
Benjamin Otte
6e4f42f97e cssnode: Change API of some functions
gtk_css_node_set_after/before() are now called
gtk_css_node_insert_after/before().

This brings them in line with other similar APIs (ie GtkListStore). And
it allows easier usage of the API (see changes to gtkbox.c).
2015-07-16 06:15:13 +02:00
Benjamin Otte
36678306a0 box: Fix RTL styling 2015-05-12 18:44:59 +02:00
Benjamin Otte
ee91fb71ca box: Use CSS nodes instead of widget paths
This is a very simple patch that causes a bunch of overhead. But it
works.
2015-03-18 15:23:31 +01:00
Matthias Clasen
45d0a5cc4b Trivial formatting fix
&& goes at the end of the line in GTK+ coding style.
2014-12-09 23:41:28 -05:00
Matthias Clasen
8b6457732f GtkBox: Fix self-assignment for center widget
This is happening when glade is loading ui files containing
center widgets.
2014-10-25 20:30:08 -04:00
Matthias Clasen
b4a288a592 GtkBox: Ensure we only allow one center child
Glade was happily adding multiple center widgets. Oops.
2014-10-13 12:45:05 -04:00
Benjamin Otte
b5a8b7ef3b widget: Make _gtk_set_simple_clip() take an optional content clip 2014-08-21 00:54:07 +02:00
Matthias Clasen
b4ab29d4d5 GtkBox: Set orientable style classes initially
This was an omission, horizontal/vertical would only be set
when the orientation is changed.
2014-07-18 19:37:33 -04:00
Matthias Clasen
f531b0757c GtkBox: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:30:52 -04:00
Matthias Clasen
06564f5df6 GtkBox: Convert to g_object_install_properties 2014-06-09 13:30:52 -04:00
Matthias Clasen
e54525729e GtkBox: Move overridden property ids to the end
This will make it easier to convert to g_object_install_properties
in the next commit.
2014-06-09 13:30:52 -04:00
Benjamin Otte
0cd63faee2 widget: Add _gtk_widget_set_css_clip()
... and use it in GtkBox and GtkGrid.
2014-05-24 16:12:21 +02:00
Marcus Karlsson
ac5fbb5ef3 docs: Add missing transfer annotation to GtkBox
The gtk_box_get_center_widget function is missing a transfer annotation
for the returned widget. No transfer is done, so set transfer to none.

https://bugzilla.gnome.org/show_bug.cgi?id=728093
2014-04-13 13:22:36 -07:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
e679812be0 GtkBox: Fix an off-by-one error with center allocation
This error was causing children to not get allocated when
the center widget is the first one in the list of the box's
children.
2014-02-18 22:55:45 -05:00
Matthias Clasen
bb4f8d8ce1 Make gtk_box_set_center_widget take NULL
It makes sense to allow this, and gtk_action_bar_set_center_widget
already assumes that it can pass NULL to this function.
2014-02-18 22:50:37 -05:00
Paolo Borelli
ad9019c2c9 gtkbox: fix positioning of center widget 2014-02-17 23:23:04 +01:00