[gtk/text: 6/26] spin button: Use GtkText
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/text: 6/26] spin button: Use GtkText
- Date: Sun, 17 Feb 2019 21:23:44 +0000 (UTC)
commit 2063760e38d10ae6b0995e530f9369620236e380
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 15 21:01:33 2019 -0500
spin button: Use GtkText
We already use GtkEditable api throughout. This just
means we create a GtkText instead of a GtkEntry.
gtk/gtkspinbutton.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 59c8681bc7..3143fa01c1 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -36,7 +36,8 @@
#include "gtkcssstylepropertyprivate.h"
#include "gtkeditable.h"
#include "gtkeditableprivate.h"
-#include "gtkentry.h"
+#include "gtkimage.h"
+#include "gtktext.h"
#include "gtkeventcontrollerkey.h"
#include "gtkeventcontrollermotion.h"
#include "gtkeventcontrollerscroll.h"
@@ -95,7 +96,7 @@
* |[<!-- language="plain" -->
* spinbutton.horizontal
* ╰── box.horizontal
- * ├── entry
+ * ├── text
* │ ├── undershoot.left
* │ ╰── undershoot.right
* ├── button.down
@@ -106,7 +107,7 @@
* spinbutton.vertical
* ╰── box.vertical
* ├── button.up
- * ├── entry
+ * ├── text
* │ ├── undershoot.left
* │ ╰── undershoot.right
* ╰── button.down
@@ -114,8 +115,8 @@
*
* GtkSpinButtons main CSS node has the name spinbutton. It creates subnodes
* for the entry and the two buttons, with these names. The button nodes have
- * the style classes .up and .down. The GtkEntry subnodes (if present) are put
- * below the entry node. The orientation of the spin button is reflected in
+ * the style classes .up and .down. The GtkText subnodes (if present) are put
+ * below the text node. The orientation of the spin button is reflected in
* the .vertical or .horizontal style class on the main node.
*
* ## Using a GtkSpinButton to get an integer
@@ -269,7 +270,7 @@ static gboolean gtk_spin_button_stop_spinning (GtkSpinButton *spin);
static void gtk_spin_button_value_changed (GtkAdjustment *adjustment,
GtkSpinButton *spin_button);
-static void gtk_spin_button_activate (GtkEntry *entry,
+static void gtk_spin_button_activate (GtkText *entry,
gpointer user_data);
static void gtk_spin_button_unset_adjustment (GtkSpinButton *spin_button);
static void gtk_spin_button_set_orientation (GtkSpinButton *spin_button,
@@ -829,7 +830,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
priv->box = gtk_box_new (priv->orientation, 0);
gtk_widget_set_parent (priv->box, GTK_WIDGET (spin_button));
- priv->entry = gtk_entry_new ();
+ priv->entry = gtk_text_new ();
gtk_editable_set_delegate (GTK_EDITABLE (spin_button), GTK_EDITABLE (priv->entry));
gtk_editable_set_width_chars (GTK_EDITABLE (priv->entry), 0);
gtk_editable_set_max_width_chars (GTK_EDITABLE (priv->entry), 0);
@@ -1294,7 +1295,7 @@ gtk_spin_button_snap (GtkSpinButton *spin_button,
}
static void
-gtk_spin_button_activate (GtkEntry *entry,
+gtk_spin_button_activate (GtkText *entry,
gpointer user_data)
{
GtkSpinButton *spin_button = user_data;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]