Commit Graph

6 Commits

Author SHA1 Message Date
Emmanuele Bassi
3389ddf6fc Do not connect to a non-existing signal
The GtkWidget::parent-set signal was removed in ff6cd8f7.

Instead of removing GtkLayoutChild instances associated to a widget
using notifications when the widget's parent changes, we can have
gtk_widget_unparent() call a method on GtkLayoutManager to remove any
eventual GtkLayoutChild instances associated to the widget.
2019-03-26 17:37:49 +00:00
Emmanuele Bassi
341660e056 Drop warning from GtkLayoutManager::get_request_mode()
We can return a sensible default value, so we don't really need to warn
about a missing implementation.
2019-03-26 17:37:49 +00:00
Emmanuele Bassi
65965bed16 Changes after review
- Rename GtkLegacyLayout to GtkCustomLayout
 - Use for() to iterate over children in GtkBinLayout
 - Whitespace fixes for code imported from GtkBox
 - Store the GtkLayoutChild instances inside LayoutManager
 - Simplify the GtkLayoutManager API by dropping unnecessary arguments
 - Fix the ownership model of GtkLayoutManager
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
5cbf6f5fbd Add GtkLayoutChild
Layout managers needs a way to store properties that control the layout
policy of a widget; typically, we used to store these in GtkContainer's
child properties, but since GtkLayoutManager is decoupled from the
actual container widget, we need a separate storage. Additionally, child
properties have their own downsides, like requiring a separate, global
GParamSpecPool storage, and additional lookup API.

GtkLayoutChild is a simple GObject class, which means you can introspect
and document it as you would any other type.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
1b8595b5f2 Hook GtkLayoutManager into GtkWidget
We delegate the size request mode, the measuring, and the allocation of
a widget through a GtkLayoutManager instance, if one has been attached
to the widget; otherwise, we fall back to the widget's own implementation.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
24754c3259 Add GtkLayoutManager
A base abstract class for layout manager delegate objects.

Layout managers are associated to a single widget, like event
controllers, and are responsible for measuring and allocating the
children of the widget they are bound to.
2019-03-26 00:11:27 +00:00