Commit a0fe18b9 authored by Adrien Plazas's avatar Adrien Plazas Committed by Guido Gunther
Browse files

action-row: Handle show_all()

This avoids an empty image, an empty subtitle and an empty prefixes box
to be visible when calling show_all(), as they are handled by the row
itself.
parent 4c19b0bb
Pipeline #3448 passed with stage
in 2 minutes and 40 seconds
...@@ -169,6 +169,22 @@ hdy_action_row_dispose (GObject *object) ...@@ -169,6 +169,22 @@ hdy_action_row_dispose (GObject *object)
priv->previous_parent = NULL; priv->previous_parent = NULL;
} }
static void
hdy_action_row_show_all (GtkWidget *widget)
{
HdyActionRow *self = HDY_ACTION_ROW (widget);
HdyActionRowPrivate *priv;
g_return_if_fail (HDY_IS_ACTION_ROW (self));
priv = hdy_action_row_get_instance_private (self);
gtk_container_foreach (GTK_CONTAINER (priv->prefixes),
(GtkCallback) gtk_widget_show_all,
NULL);
GTK_WIDGET_CLASS (hdy_action_row_parent_class)->show_all (widget);
}
static void static void
hdy_action_row_add (GtkContainer *container, hdy_action_row_add (GtkContainer *container,
GtkWidget *child) GtkWidget *child)
...@@ -246,6 +262,8 @@ hdy_action_row_class_init (HdyActionRowClass *klass) ...@@ -246,6 +262,8 @@ hdy_action_row_class_init (HdyActionRowClass *klass)
object_class->set_property = hdy_action_row_set_property; object_class->set_property = hdy_action_row_set_property;
object_class->dispose = hdy_action_row_dispose; object_class->dispose = hdy_action_row_dispose;
widget_class->show_all = hdy_action_row_show_all;
container_class->add = hdy_action_row_add; container_class->add = hdy_action_row_add;
container_class->forall = hdy_action_row_forall; container_class->forall = hdy_action_row_forall;
......
...@@ -17,12 +17,14 @@ ...@@ -17,12 +17,14 @@
<child> <child>
<object class="GtkBox" id="prefixes"> <object class="GtkBox" id="prefixes">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<property name="visible">False</property> <property name="visible">False</property>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkImage" id="image"> <object class="GtkImage" id="image">
<property name="no_show_all">True</property>
<property name="pixel_size">32</property> <property name="pixel_size">32</property>
<property name="valign">center</property> <property name="valign">center</property>
</object> </object>
...@@ -33,6 +35,7 @@ ...@@ -33,6 +35,7 @@
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_bottom">8</property> <property name="margin_bottom">8</property>
<property name="margin_top">8</property> <property name="margin_top">8</property>
<property name="no_show_all">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="visible">True</property> <property name="visible">True</property>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment