[gtk+] widget: Remove get_valign_with_baseline
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Remove get_valign_with_baseline
- Date: Sun, 5 Mar 2017 15:48:41 +0000 (UTC)
commit f860ff86475b16c8d38cdad44c68b3292b7b8fdf
Author: Timm Bäder <mail baedert org>
Date: Sun Mar 5 15:18:32 2017 +0100
widget: Remove get_valign_with_baseline
This only existed for backwards compat reasons which aren't interesting
for gtk4.
docs/reference/gtk/gtk4-sections.txt | 1 -
gtk/gtkbbox.c | 6 ++--
gtk/gtkbox.c | 4 +-
gtk/gtksizerequest.c | 2 +-
gtk/gtkwidget.c | 38 ++++-----------------------------
gtk/gtkwidget.h | 2 -
6 files changed, 11 insertions(+), 42 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 39308f6..b89687d 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4675,7 +4675,6 @@ GtkAlign
gtk_widget_get_halign
gtk_widget_set_halign
gtk_widget_get_valign
-gtk_widget_get_valign_with_baseline
gtk_widget_set_valign
gtk_widget_get_margin_start
gtk_widget_set_margin_start
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c
index 34c338a..0928956 100644
--- a/gtk/gtkbbox.c
+++ b/gtk/gtkbbox.c
@@ -553,7 +553,7 @@ gtk_button_box_child_requisition (GtkWidget *widget,
_gtk_widget_get_preferred_size_and_baseline (child,
&child_requisition, NULL, &child_baseline, NULL);
if (orientation == GTK_ORIENTATION_HORIZONTAL &&
- gtk_widget_get_valign_with_baseline (child) == GTK_ALIGN_BASELINE &&
+ gtk_widget_get_valign (child) == GTK_ALIGN_BASELINE &&
child_baseline != -1)
{
have_baseline = TRUE;
@@ -618,7 +618,7 @@ gtk_button_box_child_requisition (GtkWidget *widget,
(*heights)[i] = -1;
if (orientation == GTK_ORIENTATION_HORIZONTAL &&
- gtk_widget_get_valign_with_baseline (child) == GTK_ALIGN_BASELINE &&
+ gtk_widget_get_valign (child) == GTK_ALIGN_BASELINE &&
child_baseline != -1)
{
(*baselines)[i] = child_baseline;
@@ -639,7 +639,7 @@ gtk_button_box_child_requisition (GtkWidget *widget,
(*heights)[i] = child_requisition.height + ipad_h;
if (orientation == GTK_ORIENTATION_HORIZONTAL &&
- gtk_widget_get_valign_with_baseline (child) == GTK_ALIGN_BASELINE &&
+ gtk_widget_get_valign (child) == GTK_ALIGN_BASELINE &&
child_baseline != -1)
(*baselines)[i] = child_baseline;
}
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 2fbf2bf..7e31c0b 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -631,7 +631,7 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
sizes[i].natural_size = child_size;
if (private->orientation == GTK_ORIENTATION_HORIZONTAL &&
- gtk_widget_get_valign_with_baseline (child->widget) == GTK_ALIGN_BASELINE)
+ gtk_widget_get_valign (child->widget) == GTK_ALIGN_BASELINE)
{
int child_allocation_width;
int child_minimum_height, child_natural_height;
@@ -976,7 +976,7 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
sizes[packing][i].natural_size = child_size;
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL &&
- gtk_widget_get_valign_with_baseline (child->widget) == GTK_ALIGN_BASELINE)
+ gtk_widget_get_valign (child->widget) == GTK_ALIGN_BASELINE)
{
gint child_allocation_width;
gint child_minimum_height, child_natural_height;
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 907a454..a94dd1d 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -261,7 +261,7 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
min_baseline = -1;
nat_baseline = -1;
}
- else if (gtk_widget_get_valign_with_baseline (widget) != GTK_ALIGN_BASELINE)
+ else if (gtk_widget_get_valign (widget) != GTK_ALIGN_BASELINE)
{
/* Ignore requested baseline for non-aligned widgets */
min_baseline = -1;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 188b713..6aa80e4 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3422,7 +3422,7 @@ gtk_widget_get_property (GObject *object,
g_value_set_enum (value, gtk_widget_get_halign (widget));
break;
case PROP_VALIGN:
- g_value_set_enum (value, gtk_widget_get_valign_with_baseline (widget));
+ g_value_set_enum (value, gtk_widget_get_valign (widget));
break;
case PROP_MARGIN_START:
g_value_set_int (value, gtk_widget_get_margin_start (widget));
@@ -5380,7 +5380,7 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
/* Never pass a baseline to a child unless it requested it.
This means containers don't have to manually check for this. */
if (baseline != -1 &&
- gtk_widget_get_valign_with_baseline (widget) != GTK_ALIGN_BASELINE)
+ gtk_widget_get_valign (widget) != GTK_ALIGN_BASELINE)
baseline = -1;
alloc_needed = priv->alloc_needed;
@@ -12852,47 +12852,19 @@ gtk_widget_set_halign (GtkWidget *widget,
}
/**
- * gtk_widget_get_valign_with_baseline:
- * @widget: a #GtkWidget
- *
- * Gets the value of the #GtkWidget:valign property, including
- * %GTK_ALIGN_BASELINE.
- *
- * Returns: the vertical alignment of @widget
- *
- * Since: 3.10
- */
-GtkAlign
-gtk_widget_get_valign_with_baseline (GtkWidget *widget)
-{
- g_return_val_if_fail (GTK_IS_WIDGET (widget), GTK_ALIGN_FILL);
- return widget->priv->valign;
-}
-
-/**
* gtk_widget_get_valign:
* @widget: a #GtkWidget
*
* Gets the value of the #GtkWidget:valign property.
*
- * For backwards compatibility reasons this method will never return
- * %GTK_ALIGN_BASELINE, but instead it will convert it to
- * %GTK_ALIGN_FILL. If your widget want to support baseline aligned
- * children it must use gtk_widget_get_valign_with_baseline(), or
- * `g_object_get (widget, "valign", &value, NULL)`, which will
- * also report the true value.
- *
- * Returns: the vertical alignment of @widget, ignoring baseline alignment
+ * Returns: the vertical alignment of @widget
*/
GtkAlign
gtk_widget_get_valign (GtkWidget *widget)
{
- GtkAlign align;
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), GTK_ALIGN_FILL);
- align = gtk_widget_get_valign_with_baseline (widget);
- if (align == GTK_ALIGN_BASELINE)
- return GTK_ALIGN_FILL;
- return align;
+ return widget->priv->valign;
}
/**
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 0be1d03..c1cbe20 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -901,8 +901,6 @@ void gtk_widget_set_halign (GtkWidget *widget,
GtkAlign align);
GDK_AVAILABLE_IN_ALL
GtkAlign gtk_widget_get_valign (GtkWidget *widget);
-GDK_AVAILABLE_IN_3_10
-GtkAlign gtk_widget_get_valign_with_baseline (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_widget_set_valign (GtkWidget *widget,
GtkAlign align);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]