diff options
author | Timm Bäder <mail@baedert.org> | 2018-02-26 20:23:45 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-02-27 10:30:14 +0100 |
commit | 83c74ff7d055692d3e1310a0d87bedc6a6a52607 (patch) | |
tree | 632c4ad969f6a76e194f7daebeb91a0bdc9e5344 /gtk/gtkspinbutton.c | |
parent | 7c59ac2e4a87b7077413b1b5b0d5492d5c07e7c1 (diff) | |
download | gtk+-83c74ff7d055692d3e1310a0d87bedc6a6a52607.tar.gz |
spinbutton: Fold function into only caller
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r-- | gtk/gtkspinbutton.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 58d0587822..c7ee077c04 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -720,28 +720,6 @@ scroll_controller_scroll (GtkEventControllerScroll *Scroll, gtk_spin_button_real_spin (spin, -dy * gtk_adjustment_get_step_increment (priv->adjustment)); } -static void -update_node_ordering (GtkSpinButton *spin_button) -{ - GtkSpinButtonPrivate *priv = spin_button->priv; - - g_assert (priv->orientation != gtk_orientable_get_orientation (GTK_ORIENTABLE (priv->box))); - - if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) - { - /* Current orientation of the box is vertical! */ - gtk_box_reorder_child (GTK_BOX (priv->box), priv->entry, 0); - gtk_box_reorder_child (GTK_BOX (priv->box), priv->down_button, 1); - } - else - { - /* Current orientation of the box is horizontal! */ - gtk_box_reorder_child (GTK_BOX (priv->box), priv->up_button, 0); - } - - gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), priv->orientation); -} - static gboolean gtk_spin_button_stop_spinning (GtkSpinButton *spin) { @@ -1032,10 +1010,21 @@ gtk_spin_button_set_orientation (GtkSpinButton *spin, gtk_entry_get_alignment (entry) == 0.5) gtk_entry_set_alignment (entry, 0.0); - update_node_ordering (spin); + if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) + { + /* Current orientation of the box is vertical! */ + gtk_box_reorder_child (GTK_BOX (priv->box), priv->entry, 0); + gtk_box_reorder_child (GTK_BOX (priv->box), priv->down_button, 1); + } + else + { + /* Current orientation of the box is horizontal! */ + gtk_box_reorder_child (GTK_BOX (priv->box), priv->up_button, 0); + } + + gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), priv->orientation); g_object_notify (G_OBJECT (spin), "orientation"); - gtk_widget_queue_resize (GTK_WIDGET (spin)); } static gchar * |