Skip to content

Commit

Permalink
action bar: Use a regular box instead of GtkCenterBox
Browse files Browse the repository at this point in the history
GtkBox now supports a centered child, so GtkCenterBox is
no longer needed here.
  • Loading branch information
Matthias Clasen committed Feb 17, 2014
1 parent 06716a6 commit ef565e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
13 changes: 6 additions & 7 deletions gtk/gtkactionbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "gtkaccessible.h"
#include "gtkbuildable.h"
#include "gtktypebuiltins.h"
#include "gtkcenterbox.h"
#include "gtkbox.h"
#include "gtkrevealer.h"

#include <string.h>
Expand Down Expand Up @@ -253,7 +253,7 @@ gtk_action_bar_buildable_add_child (GtkBuildable *buildable,
GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (action_bar);

if (type && strcmp (type, "center") == 0)
gtk_center_box_set_center_widget (GTK_CENTER_BOX (priv->center_box), GTK_WIDGET (child));
gtk_box_set_center_widget (GTK_BOX (priv->center_box), GTK_WIDGET (child));
else if (!type)
gtk_container_add (GTK_CONTAINER (buildable), GTK_WIDGET (child));
else
Expand Down Expand Up @@ -285,7 +285,7 @@ gtk_action_bar_pack_start (GtkActionBar *action_bar,
{
GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (action_bar);

gtk_center_box_pack_start (GTK_CENTER_BOX (priv->center_box), child);
gtk_box_pack_start (GTK_BOX (priv->center_box), child, FALSE, TRUE, 0);
}

/**
Expand All @@ -304,7 +304,7 @@ gtk_action_bar_pack_end (GtkActionBar *action_bar,
{
GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (action_bar);

gtk_center_box_pack_end (GTK_CENTER_BOX (priv->center_box), child);
gtk_box_pack_end (GTK_BOX (priv->center_box), child, FALSE, TRUE, 0);
}

/**
Expand All @@ -322,8 +322,7 @@ gtk_action_bar_set_center_widget (GtkActionBar *action_bar,
{
GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (action_bar);

gtk_center_box_set_center_widget (GTK_CENTER_BOX (priv->center_box),
center_widget);
gtk_box_set_center_widget (GTK_BOX (priv->center_box), center_widget);
}

/**
Expand All @@ -343,7 +342,7 @@ gtk_action_bar_get_center_widget (GtkActionBar *action_bar)

g_return_val_if_fail (GTK_IS_ACTION_BAR (action_bar), NULL);

return gtk_center_box_get_center_widget (GTK_CENTER_BOX (priv->center_box));
return gtk_box_get_center_widget (GTK_BOX (priv->center_box));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion gtk/resources/ui/gtkactionbar.ui
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCenterBox" id="center_box">
<object class="GtkBox" id="center_box">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<property name="can_focus">False</property>
<property name="border_width">0</property>
<property name="spacing">6</property>
Expand Down

0 comments on commit ef565e2

Please sign in to comment.