From 11e7d40e8fa159a122e4c98b09cfb0cd4902f342 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 3 Aug 2005 15:47:28 +0000 Subject: Use the entry's style's [xy]thickness, not our own. Fixes rendering with 2005-08-03 Christian Persch * lib/widgets/ephy-icon-entry.c: (ephy_icon_entry_get_borders), (ephy_icon_entry_size_allocate): Use the entry's style's [xy]thickness, not our own. Fixes rendering with current Clearlooks engine. --- ChangeLog | 8 ++++++ lib/widgets/ephy-icon-entry.c | 58 ++++++++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33c3df9dd..234c18652 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-08-03 Christian Persch + + * lib/widgets/ephy-icon-entry.c: (ephy_icon_entry_get_borders), + (ephy_icon_entry_size_allocate): + + Use the entry's style's [xy]thickness, not our own. + Fixes rendering with current Clearlooks engine. + 2005-08-03 Christian Persch * lib/widgets/Makefile.am: diff --git a/lib/widgets/ephy-icon-entry.c b/lib/widgets/ephy-icon-entry.c index 5d871e52e..898b8cadb 100644 --- a/lib/widgets/ephy-icon-entry.c +++ b/lib/widgets/ephy-icon-entry.c @@ -56,6 +56,38 @@ entry_focus_change_cb (GtkWidget *widget, return FALSE; } +static void +ephy_icon_entry_get_borders (GtkWidget *widget, + GtkWidget *entry, + int *xborder, + int *yborder) +{ + int focus_width; + gboolean interior_focus; + + g_return_if_fail (entry->style != NULL); + + gtk_widget_style_get (entry, + "focus-line-width", &focus_width, + "interior-focus", &interior_focus, + NULL); + + *xborder = entry->style->xthickness; + *yborder = entry->style->ythickness; + + /* While GtkEntry does this only when !interior-focus, we need this even + * with interior-focus, since otherwise we end up being too small. + */ + *xborder += focus_width; + *yborder += focus_width; + + if (!interior_focus) + { + *xborder += focus_width; + *yborder += focus_width; + } +} + static void ephy_icon_entry_paint (GtkWidget *widget, GdkEventExpose *event) @@ -167,30 +199,6 @@ ephy_icon_entry_realize (GtkWidget *widget) gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); } -static void -ephy_icon_entry_get_borders (GtkWidget *widget, - GtkWidget *entry, - int *xborder, - int *yborder) -{ - int focus_width; - - g_return_if_fail (entry->style != NULL); - - gtk_widget_style_get (entry, - "focus-line-width", &focus_width, - NULL); - - *xborder = widget->style->xthickness; - *yborder = widget->style->ythickness; - - /* While GtkEntry does this only when !interior-focus, we need this even - * with interior-focus, since otherwise we end up being too small. - */ - *xborder += focus_width; - *yborder += focus_width; -} - static void ephy_icon_entry_size_request (GtkWidget *widget, GtkRequisition *requisition) @@ -229,7 +237,7 @@ ephy_icon_entry_size_allocate (GtkWidget *widget, int xborder, yborder; widget->allocation = *allocation; - + ephy_icon_entry_get_borders (widget, entry->entry, &xborder, &yborder); if (GTK_WIDGET_REALIZED (widget)) -- cgit v1.2.3