+Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
+ logic as GtkEntry when calculating border width. (#116368, reported
+ by Morten Welinder)
+
Thu Mar 11 15:59:05 2004 Owen Taylor <otaylor@redhat.com>
* tests/testgtk.c (create_spins): Use gtk_entry_set_width_chars()
Wed Mar 10 23:40:15 2004 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
- on the action view cell renderer here, not in init, so that a) we catch
- style changes, and b) we get the real style, not the default one.
- Partial fix for #127648, reported by Dave Bordoley.
+ * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the
+ background on the action view cell renderer here, not in init, so
+ that a) we catch style changes, and b) we get the real style, not
+ the default one. Partial fix for #127648, reported by Dave Bordoley.
2004-03-10 Tor Lillqvist <tml@iki.fi>
+Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
+ logic as GtkEntry when calculating border width. (#116368, reported
+ by Morten Welinder)
+
Thu Mar 11 15:59:05 2004 Owen Taylor <otaylor@redhat.com>
* tests/testgtk.c (create_spins): Use gtk_entry_set_width_chars()
Wed Mar 10 23:40:15 2004 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
- on the action view cell renderer here, not in init, so that a) we catch
- style changes, and b) we get the real style, not the default one.
- Partial fix for #127648, reported by Dave Bordoley.
+ * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the
+ background on the action view cell renderer here, not in init, so
+ that a) we catch style changes, and b) we get the real style, not
+ the default one. Partial fix for #127648, reported by Dave Bordoley.
2004-03-10 Tor Lillqvist <tml@iki.fi>
+Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
+ logic as GtkEntry when calculating border width. (#116368, reported
+ by Morten Welinder)
+
Thu Mar 11 15:59:05 2004 Owen Taylor <otaylor@redhat.com>
* tests/testgtk.c (create_spins): Use gtk_entry_set_width_chars()
Wed Mar 10 23:40:15 2004 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
- on the action view cell renderer here, not in init, so that a) we catch
- style changes, and b) we get the real style, not the default one.
- Partial fix for #127648, reported by Dave Bordoley.
+ * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the
+ background on the action view cell renderer here, not in init, so
+ that a) we catch style changes, and b) we get the real style, not
+ the default one. Partial fix for #127648, reported by Dave Bordoley.
2004-03-10 Tor Lillqvist <tml@iki.fi>
+Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
+ logic as GtkEntry when calculating border width. (#116368, reported
+ by Morten Welinder)
+
Thu Mar 11 15:59:05 2004 Owen Taylor <otaylor@redhat.com>
* tests/testgtk.c (create_spins): Use gtk_entry_set_width_chars()
Wed Mar 10 23:40:15 2004 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
- on the action view cell renderer here, not in init, so that a) we catch
- style changes, and b) we get the real style, not the default one.
- Partial fix for #127648, reported by Dave Bordoley.
+ * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the
+ background on the action view cell renderer here, not in init, so
+ that a) we catch style changes, and b) we get the real style, not
+ the default one. Partial fix for #127648, reported by Dave Bordoley.
2004-03-10 Tor Lillqvist <tml@iki.fi>
+Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
+ logic as GtkEntry when calculating border width. (#116368, reported
+ by Morten Welinder)
+
Thu Mar 11 15:59:05 2004 Owen Taylor <otaylor@redhat.com>
* tests/testgtk.c (create_spins): Use gtk_entry_set_width_chars()
Wed Mar 10 23:40:15 2004 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
- on the action view cell renderer here, not in init, so that a) we catch
- style changes, and b) we get the real style, not the default one.
- Partial fix for #127648, reported by Dave Bordoley.
+ * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the
+ background on the action view cell renderer here, not in init, so
+ that a) we catch style changes, and b) we get the real style, not
+ the default one. Partial fix for #127648, reported by Dave Bordoley.
2004-03-10 Tor Lillqvist <tml@iki.fi>
return a + digits + extra;
}
+/* Keep in sync with gtkentry.c !
+ */
+static void
+get_borders (GtkEntry *entry,
+ gint *xborder,
+ gint *yborder)
+{
+ GtkWidget *widget = GTK_WIDGET (entry);
+ gint focus_width;
+ gboolean interior_focus;
+
+ gtk_widget_style_get (widget,
+ "interior-focus", &interior_focus,
+ "focus-line-width", &focus_width,
+ NULL);
+
+ if (entry->has_frame)
+ {
+ *xborder = widget->style->xthickness;
+ *yborder = widget->style->ythickness;
+ }
+ else
+ {
+ *xborder = 0;
+ *yborder = 0;
+ }
+
+ if (!interior_focus)
+ {
+ *xborder += focus_width;
+ *yborder += focus_width;
+ }
+}
+
static void
gtk_spin_button_size_request (GtkWidget *widget,
GtkRequisition *requisition)
gint digit_width;
gboolean interior_focus;
gint focus_width;
+ gint xborder, yborder;
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
w = PANGO_PIXELS (MIN (string_len, max_string_len) * digit_width);
width = MAX (width, w);
- requisition->width = width + /* INNER_BORDER */ 2 * 2;
- if (!interior_focus)
- requisition->width += 2 * focus_width;
+ get_borders (entry, &xborder, &yborder);
+
+ xborder += 2; /* INNER_BORDER */
+
+ requisition->width = width + xborder * 2;
}
requisition->width += arrow_size + 2 * widget->style->xthickness;