Commit daeea8b8 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Share the three copies of get_borders() under the name

2004-10-08  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkentry.h:
	* gtk/gtkentry.c:
	* gtk/gtkentrycompletion.c:
	* gtk/gtkspinbutton.c: Share the three copies of get_borders()
	under the name _gtk_entry_get_borders().  (#116368, Owen Taylor)
parent 205d5ce3
2004-10-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.h:
* gtk/gtkentry.c:
* gtk/gtkentrycompletion.c:
* gtk/gtkspinbutton.c: Share the three copies of get_borders()
under the name _gtk_entry_get_borders(). (#116368, Owen Taylor)
2004-10-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilechooserdefault.c (check_is_folder): Don't free
......
2004-10-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.h:
* gtk/gtkentry.c:
* gtk/gtkentrycompletion.c:
* gtk/gtkspinbutton.c: Share the three copies of get_borders()
under the name _gtk_entry_get_borders(). (#116368, Owen Taylor)
2004-10-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilechooserdefault.c (check_is_folder): Don't free
......
2004-10-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.h:
* gtk/gtkentry.c:
* gtk/gtkentrycompletion.c:
* gtk/gtkspinbutton.c: Share the three copies of get_borders()
under the name _gtk_entry_get_borders(). (#116368, Owen Taylor)
2004-10-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilechooserdefault.c (check_is_folder): Don't free
......
2004-10-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.h:
* gtk/gtkentry.c:
* gtk/gtkentrycompletion.c:
* gtk/gtkspinbutton.c: Share the three copies of get_borders()
under the name _gtk_entry_get_borders(). (#116368, Owen Taylor)
2004-10-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilechooserdefault.c (check_is_folder): Don't free
......
......@@ -1173,10 +1173,10 @@ gtk_entry_unrealize (GtkWidget *widget)
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
}
static void
get_borders (GtkEntry *entry,
gint *xborder,
gint *yborder)
void
_gtk_entry_get_borders (GtkEntry *entry,
gint *xborder,
gint *yborder)
{
GtkWidget *widget = GTK_WIDGET (entry);
gint focus_width;
......@@ -1223,7 +1223,7 @@ gtk_entry_size_request (GtkWidget *widget,
entry->ascent = pango_font_metrics_get_ascent (metrics);
entry->descent = pango_font_metrics_get_descent (metrics);
get_borders (entry, &xborder, &yborder);
_gtk_entry_get_borders (entry, &xborder, &yborder);
xborder += INNER_BORDER;
yborder += INNER_BORDER;
......@@ -1257,7 +1257,7 @@ get_text_area_size (GtkEntry *entry,
gtk_widget_get_child_requisition (widget, &requisition);
get_borders (entry, &xborder, &yborder);
_gtk_entry_get_borders (entry, &xborder, &yborder);
if (x)
*x = xborder;
......
......@@ -215,6 +215,12 @@ void gtk_entry_set_editable (GtkEntry *entry,
gboolean editable);
#endif /* GTK_DISABLE_DEPRECATED */
/* private */
void _gtk_entry_get_borders (GtkEntry *entry,
gint *xborder,
gint *yborder);
#ifdef __cplusplus
}
#endif /* __cplusplus */
......
......@@ -1221,39 +1221,6 @@ gtk_entry_completion_get_text_column (GtkEntryCompletion *completion)
/* private */
/* lame copy from 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 gboolean
gtk_entry_completion_list_enter_notify (GtkWidget *widget,
GdkEventCrossing *event,
......@@ -1293,7 +1260,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
gint width;
gdk_window_get_origin (completion->priv->entry->window, &x, &y);
get_borders (GTK_ENTRY (completion->priv->entry), &x_border, &y_border);
_gtk_entry_get_borders (GTK_ENTRY (completion->priv->entry), &x_border, &y_border);
matches = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (completion->priv->filter_model), NULL);
......
......@@ -617,40 +617,6 @@ compute_double_length (double val, int digits)
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)
......@@ -709,7 +675,7 @@ gtk_spin_button_size_request (GtkWidget *widget,
w = PANGO_PIXELS (MIN (string_len, max_string_len) * digit_width);
width = MAX (width, w);
get_borders (entry, &xborder, &yborder);
_gtk_entry_get_borders (entry, &xborder, &yborder);
xborder += 2; /* INNER_BORDER */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment