entry: Make code do what it's meant to do

With the 3.0 transition, this code went from just querying the entry's
height request to doing a full size request.
Then it got code to revert the features that a full size request does.
And then it grew code that manually computed the baseline.

Avoid this and just do what happened back in the days: Do a regular
height request.

This changes the semantics of the get_frame_size() vfunc wrt its
behavior towards subclasses overwriting the get_height() vfuncs, but I'm
happy to live with that.
This commit is contained in:
Benjamin Otte
2015-03-13 18:04:51 +01:00
parent d2881d901b
commit c5905b13b9
2 changed files with 5 additions and 49 deletions

View File

@ -263,11 +263,6 @@ static void gtk_spin_button_get_text_area_size (GtkEntry *entry,
gint *y,
gint *width,
gint *height);
static void gtk_spin_button_get_frame_size (GtkEntry *entry,
gint *x,
gint *y,
gint *width,
gint *height);
static void gtk_spin_button_unset_adjustment (GtkSpinButton *spin_button);
static void gtk_spin_button_set_orientation (GtkSpinButton *spin_button,
GtkOrientation orientation);
@ -335,7 +330,6 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
entry_class->activate = gtk_spin_button_activate;
entry_class->get_text_area_size = gtk_spin_button_get_text_area_size;
entry_class->get_frame_size = gtk_spin_button_get_frame_size;
class->input = NULL;
class->output = NULL;
@ -1858,32 +1852,6 @@ gtk_spin_button_activate (GtkEntry *entry)
GTK_ENTRY_CLASS (gtk_spin_button_parent_class)->activate (entry);
}
static void
gtk_spin_button_get_frame_size (GtkEntry *entry,
gint *x,
gint *y,
gint *width,
gint *height)
{
GtkSpinButtonPrivate *priv = GTK_SPIN_BUTTON (entry)->priv;
gint up_panel_width, up_panel_height;
gint down_panel_width, down_panel_height;
gtk_spin_button_panel_get_size (GTK_SPIN_BUTTON (entry), priv->up_panel, &up_panel_width, &up_panel_height);
gtk_spin_button_panel_get_size (GTK_SPIN_BUTTON (entry), priv->down_panel, &down_panel_width, &down_panel_height);
GTK_ENTRY_CLASS (gtk_spin_button_parent_class)->get_frame_size (entry, x, y, width, height);
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
{
if (y)
*y += up_panel_height;
if (height)
*height -= up_panel_height + down_panel_height;
}
}
static void
gtk_spin_button_get_text_area_size (GtkEntry *entry,
gint *x,