frame: Warn about deprecated buildable features

<child type="label"> is deprecated for <property name="label-widget">.
This commit is contained in:
Matthias Clasen 2025-01-04 10:43:48 -05:00
parent 077fc992ed
commit 8a18edc604
4 changed files with 46 additions and 37 deletions

View File

@ -660,7 +660,7 @@
<property name="halign">center</property>
<child>
<object class="GtkFrame">
<child>
<property name="child">
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
@ -846,13 +846,13 @@
</object>
</child>
</object>
</child>
</property>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="hexpand">1</property>
<child>
<property name="child">
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
@ -1159,13 +1159,13 @@
</object>
</child>
</object>
</child>
</property>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="hexpand">1</property>
<child>
<property name="child">
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
@ -1412,13 +1412,13 @@
</object>
</child>
</object>
</child>
</property>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="hexpand">1</property>
<child>
<property name="child">
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
@ -1845,13 +1845,13 @@
</object>
</child>
</object>
</child>
</property>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="hexpand">1</property>
<child>
<property name="child">
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
@ -2758,13 +2758,13 @@
</object>
</child>
</object>
</child>
</property>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="hexpand">1</property>
<child>
<property name="child">
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
@ -2891,7 +2891,7 @@
</object>
</child>
</object>
</child>
</property>
</object>
</child>
</object>

View File

@ -1048,24 +1048,24 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="hexpand">1</property>
<child>
<object class="GtkFrame">
<child>
<property name="child">
<object class="GtkVideo">
<property name="autoplay">1</property>
<property name="loop">1</property>
<property name="file">resource:///org/gtk/WidgetFactory4/gtk-logo.webm</property>
</object>
</child>
</property>
</object>
</child>
<child>
<object class="GtkFrame">
<child type="label">
<property name="label-widget">
<object class="GtkLabel" id="label1">
<property name="label" translatable="1">&lt;b&gt;Text Styles&lt;/b&gt;</property>
<property name="use-markup">1</property>
</object>
</child>
<child>
</property>
<property name="child">
<object class="GtkScrolledWindow">
<property name="vexpand">1</property>
<property name="hscrollbar-policy">2</property>
@ -1150,7 +1150,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
</child>
</property>
</object>
</child>
</object>
@ -1508,7 +1508,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<style>
<class name="app-notification"/>
</style>
<child>
<property name="child">
<object class="GtkBox" id="page2box">
<property name="spacing">20</property>
<property name="margin-start">10</property>
@ -1536,7 +1536,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
</child>
</property>
</object>
</child>
</object>
@ -1611,7 +1611,7 @@ microphone-sensitivity-medium-symbolic</property>
</child>
<child>
<object class="GtkFrame" id="page2frame1">
<child>
<property name="child">
<object class="GtkBox">
<property name="orientation">1</property>
<child>
@ -1674,7 +1674,7 @@ microphone-sensitivity-medium-symbolic</property>
</object>
</child>
</object>
</child>
</property>
</object>
</child>
<child>
@ -1885,7 +1885,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="spacing">10</property>
<child>
<object class="GtkFrame" id="page2frame2">
<child>
<property name="child">
<object class="GtkBox">
<property name="orientation">1</property>
<child>
@ -1982,7 +1982,7 @@ microphone-sensitivity-medium-symbolic</property>
<object class="GtkStatusbar" id="statusbar"/>
</child>
</object>
</child>
</property>
</object>
</child>
<child>
@ -1996,7 +1996,7 @@ microphone-sensitivity-medium-symbolic</property>
<object class="GtkFrame" id="panedframe1">
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<property name="child">
<object class="GtkPaned">
<style>
<class name="view"/>
@ -2012,14 +2012,14 @@ microphone-sensitivity-medium-symbolic</property>
</object>
</child>
</object>
</child>
</property>
</object>
</child>
<child>
<object class="GtkFrame" id="panedframe2">
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<property name="child">
<object class="GtkPaned">
<property name="orientation">1</property>
<style>
@ -2036,7 +2036,7 @@ microphone-sensitivity-medium-symbolic</property>
</object>
</child>
</object>
</child>
</property>
</object>
</child>
</object>
@ -2345,7 +2345,7 @@ microphone-sensitivity-medium-symbolic</property>
</child>
<child>
<object class="GtkFrame">
<child>
<property name="child">
<object class="GtkBox">
<child>
<object class="GtkStackSidebar">
@ -2556,7 +2556,7 @@ microphone-sensitivity-medium-symbolic</property>
</object>
</child>
</object>
</child>
</property>
</object>
</child>
<child>
@ -2704,7 +2704,7 @@ microphone-sensitivity-medium-symbolic</property>
</child>
<child>
<object class="GtkFrame" id="osd_frame">
<child>
<property name="child">
<object class="GtkPaned">
<property name="wide-handle">1</property>
<child>
@ -2807,7 +2807,7 @@ microphone-sensitivity-medium-symbolic</property>
</object>
</child>
</object>
</child>
</property>
<child>
<object class="GtkGestureClick">
<signal name="pressed" handler="osd_frame_pressed" object="osd_frame" swapped="no"/>

View File

@ -31,6 +31,7 @@
#include "gtkbuildable.h"
#include "gtkwidgetprivate.h"
#include "gtklabel.h"
#include "gtkbuilderprivate.h"
/**
* GtkFrame:
@ -227,11 +228,19 @@ gtk_frame_buildable_add_child (GtkBuildable *buildable,
const char *type)
{
if (type && strcmp (type, "label") == 0)
gtk_frame_set_label_widget (GTK_FRAME (buildable), GTK_WIDGET (child));
{
gtk_buildable_child_deprecation_warning (buildable, builder, "label", "label-widget");
gtk_frame_set_label_widget (GTK_FRAME (buildable), GTK_WIDGET (child));
}
else if (GTK_IS_WIDGET (child))
gtk_frame_set_child (GTK_FRAME (buildable), GTK_WIDGET (child));
{
gtk_buildable_child_deprecation_warning (buildable, builder, NULL, "child");
gtk_frame_set_child (GTK_FRAME (buildable), GTK_WIDGET (child));
}
else
parent_buildable_iface->add_child (buildable, builder, child, type);
{
parent_buildable_iface->add_child (buildable, builder, child, type);
}
}
static void

View File

@ -110,7 +110,7 @@
<child>
<object class="GtkFrame" id="language_frame">
<property name="margin-start">12</property>
<child>
<property name="child">
<object class="GtkScrolledWindow">
<property name="min-content-height">200</property>
<property name="hscrollbar-policy">2</property>
@ -118,7 +118,7 @@
<object class="GtkListView" id="language_list"/>
</child>
</object>
</child>
</property>
</object>
</child>
</object>