Merge branch 'matthiasc/for-master' into 'master'

docs: Mention <packing> in migration guide

Closes #3950

See merge request GNOME/gtk!3629
This commit is contained in:
Matthias Clasen 2021-06-04 13:21:37 +00:00
commit ff01067b8b
2 changed files with 9 additions and 3 deletions

View File

@ -740,7 +740,7 @@ The abstract base class `GtkBin` for single-child containers has been
removed. The former subclasses are now derived directly from `GtkWidget`, removed. The former subclasses are now derived directly from `GtkWidget`,
and have a "child" property for their child widget. To add a child, use and have a "child" property for their child widget. To add a child, use
the setter for the "child" property (e.g. [method@Gtk.Frame.set_child]) instead the setter for the "child" property (e.g. [method@Gtk.Frame.set_child]) instead
of `gtk_container_add()`. Adding a child in a ui file with <child> still works. of `gtk_container_add()`. Adding a child in a ui file with `<child>` still works.
The affected classes are: The affected classes are:
@ -766,7 +766,7 @@ expand flags) and [vfunc@Gtk.Widget.get_request_mode] (if you want your
container to support height-for-width). container to support height-for-width).
You may also want to implement the [iface@Gtk.Buildable] interface, to support You may also want to implement the [iface@Gtk.Buildable] interface, to support
adding children with <child> in ui files. adding children with `<child>` in ui files.
### Adapt to GtkContainer removal ### Adapt to GtkContainer removal
@ -777,7 +777,7 @@ and have class-specific add() and remove() functions.
The most noticeable change is the use of [method@Gtk.Box.append] or [method@Gtk.Box.prepend] The most noticeable change is the use of [method@Gtk.Box.append] or [method@Gtk.Box.prepend]
instead of `gtk_container_add()` for adding children to `GtkBox`, and the change instead of `gtk_container_add()` for adding children to `GtkBox`, and the change
to use container-specific remove functions, such as [method@Gtk.Stack.remove] instead to use container-specific remove functions, such as [method@Gtk.Stack.remove] instead
of `gtk_container_remove()`. Adding a child in a ui file with <child> still works. of `gtk_container_remove()`. Adding a child in a ui file with `<child>` still works.
The affected classes are: The affected classes are:
@ -804,6 +804,11 @@ by a layout manager (if they are layout-related), or handled in some
other way. One possibility is to use child meta objects, as seen with other way. One possibility is to use child meta objects, as seen with
[class@Gtk.AssistantPage], [class@Gtk.StackPage] and the like. [class@Gtk.AssistantPage], [class@Gtk.StackPage] and the like.
If you used to define child properties with `<packing>` in ui files, you have
to switch to using `<layout>` for the corresponding layout properties.
`gtk4-builder-tool` can help with this conversion, with the `--3to4` option
of the `simplify` command.
The replacements for gtk_container_add() are: The replacements for gtk_container_add() are:
| Widget | Replacement | | Widget | Replacement |

View File

@ -1648,6 +1648,7 @@ static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.wm.preferences", "action-middle-click-titlebar", "gtk-titlebar-middle-click", G_TYPE_STRING, { .s = "none" } }, { FALSE, "org.gnome.desktop.wm.preferences", "action-middle-click-titlebar", "gtk-titlebar-middle-click", G_TYPE_STRING, { .s = "none" } },
{ FALSE, "org.gnome.desktop.wm.preferences", "action-right-click-titlebar", "gtk-titlebar-right-click", G_TYPE_STRING, { .s = "menu" } }, { FALSE, "org.gnome.desktop.wm.preferences", "action-right-click-titlebar", "gtk-titlebar-right-click", G_TYPE_STRING, { .s = "menu" } },
{ FALSE, "org.gnome.desktop.a11y", "always-show-text-caret", "gtk-keynav-use-caret", G_TYPE_BOOLEAN, { .b = FALSE } }, { FALSE, "org.gnome.desktop.a11y", "always-show-text-caret", "gtk-keynav-use-caret", G_TYPE_BOOLEAN, { .b = FALSE } },
/* Note, this setting doesn't exist, the portal and gsd fake it */
{ FALSE, "org.gnome.fontconfig", "serial", "gtk-fontconfig-timestamp", G_TYPE_NONE, { .i = 0 } }, { FALSE, "org.gnome.fontconfig", "serial", "gtk-fontconfig-timestamp", G_TYPE_NONE, { .i = 0 } },
}; };