contacts-box: adjust search bar's margin inside toolbar

A toolbar view, per its docs, expects its toolbar
children to either be of a set of known widget types that
are supported by default, or otherwise be a Gtk.Box-like
container with the .toolbar CSS style class.

This expectation was not met, but instead similar, but
not identical margins manually applied. These similar yet
different margins made it look off.

While this now adheres to the toolbar child requirements
of libadwaita, and the margins look more familiar, it
still breaks with libadwaita's assumption that toolbars
are not stacked. Its stylesheet allows for stacking
toolbar views only if one is providing the top and the
other the bottom one.

This view, especially, deserves a more thorough design
overhaul, regardless of this. Thus, I will leave it at
this.

Link: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ToolbarView.html

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/791>
This commit is contained in:
Markus Göllnitz
2025-09-16 00:26:21 +02:00
committed by Marge Bot
parent cab52d464c
commit 3d5ff3dbdc

View File

@@ -4,13 +4,21 @@
<child>
<object class="AdwToolbarView" id="child">
<child type="top">
<object class="GtkBox">
<style>
<class name="toolbar"/>
</style>
<property name="orientation">vertical</property>
<child>
<object class="AdwClamp">
<property name="maximum-size">588</property> <!-- 600px - 2 * 6px due to toolbar margin to match clamp below -->
<property name="tightening-threshold">388</property> <!-- 400px - 2 * 6px due to toolbar margin to match clamp below -->
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
<property name="margin-start">6</property>
<property name="margin-end">6</property>
</object>
</child>
</object>
</child>
</object>