searchbar: Warn about deprecated buildable features

<child> is deprecated for setting child properties

Affected ui files have been updated.
This commit is contained in:
Matthias Clasen 2025-01-04 11:10:15 -05:00
parent 70c765ae97
commit a9e064218b
6 changed files with 18 additions and 12 deletions

View File

@ -63,12 +63,12 @@
<object class="GtkSearchBar">
<property name="search-mode-enabled" bind-source="search_button" bind-property="active" bind-flags="bidirectional"/>
<signal name="notify::search-mode-enabled" handler="search_enabled" object="entry"/>
<child>
<property name="child">
<object class="GtkSearchEntry" id="entry">
<signal name="search-changed" handler="search_changed"/>
<signal name="stop-search" handler="stop_search"/>
</object>
</child>
</property>
</object>
</child>
<child>

View File

@ -26,11 +26,11 @@
<object class="GtkSearchBar">
<property name="search-mode-enabled" bind-source="search_button" bind-property="active" bind-flags="bidirectional"/>
<signal name="notify::search-mode-enabled" handler="search_enabled" object="entry"/>
<child>
<property name="child">
<object class="GtkSearchEntry" id="entry">
<signal name="stop-search" handler="stop_search"/>
</object>
</child>
</property>
</object>
</child>
<child>

View File

@ -64,14 +64,14 @@
<relation name="labelled-by">search-entry</relation>
</accessibility>
<property name="key-capture-widget">window</property>
<child>
<property name="child">
<object class="GtkSearchEntry" id="search-entry">
<accessibility>
<property name="label" translatable="yes">Search</property>
<relation name="controls">listview</relation>
</accessibility>
</object>
</child>
</property>
</object>
</child>
<child>

View File

@ -1941,9 +1941,9 @@ microphone-sensitivity-medium-symbolic</property>
</child>
<child>
<object class="GtkSearchBar" id="searchbar">
<child>
<property name="child">
<object class="GtkSearchEntry"/>
</child>
</property>
</object>
</child>
<child>

View File

@ -31,6 +31,7 @@
#include "gtkbinlayout.h"
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
#include "gtkbutton.h"
#include "gtkcenterbox.h"
#include "gtkentryprivate.h"
@ -145,9 +146,14 @@ gtk_search_bar_buildable_add_child (GtkBuildable *buildable,
const char *type)
{
if (GTK_IS_WIDGET (child))
gtk_search_bar_set_child (GTK_SEARCH_BAR (buildable), GTK_WIDGET (child));
{
gtk_buildable_child_deprecation_warning (buildable, builder, NULL, "child");
gtk_search_bar_set_child (GTK_SEARCH_BAR (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

@ -11,12 +11,12 @@
<property name="spacing">2</property>
<child>
<object class="GtkSearchBar" id="search_bar">
<child>
<property name="child">
<object class="GtkSearchEntry" id="search_entry">
<property name="hexpand">1</property>
<property name="max-width-chars">40</property>
</object>
</child>
</property>
</object>
</child>
<child internal-child="action_area">