summaryrefslogtreecommitdiff
path: root/gtk/gtkbin.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-10-09 02:32:00 +0200
committerBenjamin Otte <otte@redhat.com>2016-10-16 18:18:58 +0200
commit4df6ddad54d2cb6ebfdcbf2b6fee35ec4fa760b9 (patch)
tree0d6d46d38a70de6930e51d279c0eb50265a0a203 /gtk/gtkbin.c
parent1518fe0a8f0a973f013e21c185f38111d69d6ac7 (diff)
downloadgtk+-4df6ddad54d2cb6ebfdcbf2b6fee35ec4fa760b9.tar.gz
API: container: Remove gtk_container_set_border_width()
Diffstat (limited to 'gtk/gtkbin.c')
-rw-r--r--gtk/gtkbin.c45
1 files changed, 3 insertions, 42 deletions
diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c
index 1295a37bc2..2fba246162 100644
--- a/gtk/gtkbin.c
+++ b/gtk/gtkbin.c
@@ -171,15 +171,6 @@ gtk_bin_forall (GtkContainer *container,
(* callback) (priv->child, callback_data);
}
-static int
-gtk_bin_get_effective_border_width (GtkBin *bin)
-{
- if (GTK_CONTAINER_CLASS (GTK_BIN_GET_CLASS (bin))->_handle_border_width)
- return 0;
-
- return gtk_container_get_border_width (GTK_CONTAINER (bin));
-}
-
static void
gtk_bin_get_preferred_width (GtkWidget *widget,
gint *minimum_width,
@@ -187,7 +178,6 @@ gtk_bin_get_preferred_width (GtkWidget *widget,
{
GtkBin *bin = GTK_BIN (widget);
GtkBinPrivate *priv = bin->priv;
- gint border_width;
*minimum_width = 0;
*natural_width = 0;
@@ -200,10 +190,6 @@ gtk_bin_get_preferred_width (GtkWidget *widget,
*minimum_width = child_min;
*natural_width = child_nat;
}
-
- border_width = gtk_bin_get_effective_border_width (bin);
- *minimum_width += 2 * border_width;
- *natural_width += 2 * border_width;
}
static void
@@ -213,7 +199,6 @@ gtk_bin_get_preferred_height (GtkWidget *widget,
{
GtkBin *bin = GTK_BIN (widget);
GtkBinPrivate *priv = bin->priv;
- gint border_width;
*minimum_height = 0;
*natural_height = 0;
@@ -226,10 +211,6 @@ gtk_bin_get_preferred_height (GtkWidget *widget,
*minimum_height = child_min;
*natural_height = child_nat;
}
-
- border_width = gtk_bin_get_effective_border_width (bin);
- *minimum_height += 2 * border_width;
- *natural_height += 2 * border_width;
}
static void
@@ -240,25 +221,19 @@ gtk_bin_get_preferred_width_for_height (GtkWidget *widget,
{
GtkBin *bin = GTK_BIN (widget);
GtkBinPrivate *priv = bin->priv;
- gint border_width;
*minimum_width = 0;
*natural_width = 0;
- border_width = gtk_bin_get_effective_border_width (bin);
-
if (priv->child && gtk_widget_get_visible (priv->child))
{
gint child_min, child_nat;
- gtk_widget_get_preferred_width_for_height (priv->child, height - 2 * border_width,
+ gtk_widget_get_preferred_width_for_height (priv->child, height,
&child_min, &child_nat);
*minimum_width = child_min;
*natural_width = child_nat;
}
-
- *minimum_width += 2 * border_width;
- *natural_width += 2 * border_width;
}
static void
@@ -269,25 +244,19 @@ gtk_bin_get_preferred_height_for_width (GtkWidget *widget,
{
GtkBin *bin = GTK_BIN (widget);
GtkBinPrivate *priv = bin->priv;
- gint border_width;
*minimum_height = 0;
*natural_height = 0;
- border_width = gtk_bin_get_effective_border_width (bin);
-
if (priv->child && gtk_widget_get_visible (priv->child))
{
gint child_min, child_nat;
- gtk_widget_get_preferred_height_for_width (priv->child, width - 2 * border_width,
+ gtk_widget_get_preferred_height_for_width (priv->child, width,
&child_min, &child_nat);
*minimum_height = child_min;
*natural_height = child_nat;
}
-
- *minimum_height += 2 * border_width;
- *natural_height += 2 * border_width;
}
static void
@@ -301,15 +270,7 @@ gtk_bin_size_allocate (GtkWidget *widget,
if (priv->child && gtk_widget_get_visible (priv->child))
{
- GtkAllocation child_allocation;
- gint border_width = gtk_bin_get_effective_border_width (bin);
-
- child_allocation.x = allocation->x + border_width;
- child_allocation.y = allocation->y + border_width;
- child_allocation.width = allocation->width - 2 * border_width;
- child_allocation.height = allocation->height - 2 * border_width;
-
- gtk_widget_size_allocate (priv->child, &child_allocation);
+ gtk_widget_size_allocate (priv->child, allocation);
}
}