Commit 63023841 authored by Matthias Clasen's avatar Matthias Clasen

Fix frame size allocation

svn path=/trunk/; revision=20368
parent 7c12a83e
2008-06-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_frame): Fix frame size allocation.
Patch by Jan Arne Peterson
2008-06-12 Matthias Clasen <mclasen@redhat.com> 2008-06-12 Matthias Clasen <mclasen@redhat.com>
Bug 537985 – gtk_init_with_args() doesn't open a display after Bug 537985 – gtk_init_with_args() doesn't open a display after
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "gtkseparatormenuitem.h" #include "gtkseparatormenuitem.h"
#include "gtkselection.h" #include "gtkselection.h"
#include "gtksettings.h" #include "gtksettings.h"
#include "gtkspinbutton.h"
#include "gtkstock.h" #include "gtkstock.h"
#include "gtktextutil.h" #include "gtktextutil.h"
#include "gtkwindow.h" #include "gtkwindow.h"
...@@ -1558,16 +1559,22 @@ gtk_entry_draw_frame (GtkWidget *widget, ...@@ -1558,16 +1559,22 @@ gtk_entry_draw_frame (GtkWidget *widget,
GdkRectangle *area) GdkRectangle *area)
{ {
GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (widget); GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (widget);
gint x, y, width, height; gint x = 0, y = 0, width, height;
gint xborder, yborder;
get_text_area_size (GTK_ENTRY (widget), &x, &y, &width, &height);
_gtk_entry_get_borders (GTK_ENTRY (widget), &xborder, &yborder);
x -= xborder; gdk_drawable_get_size (widget->window, &width, &height);
y -= yborder;
width += xborder * 2; /* Fix a problem with some themes which assume that entry->text_area's
height += yborder * 2; * width equals widget->window's width */
if (GTK_IS_SPIN_BUTTON (widget))
{
gint xborder, yborder;
get_text_area_size (GTK_ENTRY (widget), &x, NULL, &width, NULL);
_gtk_entry_get_borders (GTK_ENTRY (widget), &xborder, &yborder);
x -= xborder;
width += xborder * 2;
}
if (GTK_WIDGET_HAS_FOCUS (widget) && !priv->interior_focus) if (GTK_WIDGET_HAS_FOCUS (widget) && !priv->interior_focus)
{ {
......
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