Center in the frame. (#304482, Rob Staudinger, patch by Richard

2007-01-02  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkentry.c (get_text_area_size): Center in the frame.
        (#304482, Rob Staudinger, patch by  Richard Stellingwerff)



svn path=/branches/gtk-2-10/; revision=17016
This commit is contained in:
Matthias Clasen
2007-01-02 14:26:07 +00:00
committed by Matthias Clasen
parent 449593fe6b
commit 3bd8ce6e16
2 changed files with 24 additions and 2 deletions

View File

@@ -1,3 +1,12 @@
2007-01-02 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (get_text_area_size): Center in the frame.
(#304482, Rob Staudinger, patch by Richard Stellingwerff)
2007-01-02 Michael Emmel <mike.emmel@gmail.com>
* gdkwindow-directfb.c: fixed leak of dfb resource on destroy
2007-01-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkscrolledwindow.h:

View File

@@ -1375,10 +1375,23 @@ get_text_area_size (GtkEntry *entry,
gint *width,
gint *height)
{
gint frame_height;
gint xborder, yborder;
GtkRequisition requisition;
GtkWidget *widget = GTK_WIDGET (entry);
gboolean interior_focus;
gint focus_width;
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
"focus-line-width", &focus_width,
NULL);
gdk_drawable_get_size (widget->window, NULL, &frame_height);
if (GTK_WIDGET_HAS_FOCUS (widget) && !interior_focus)
height -= 2 * focus_width;
gtk_widget_get_child_requisition (widget, &requisition);
_gtk_entry_get_borders (entry, &xborder, &yborder);
@@ -1387,8 +1400,8 @@ get_text_area_size (GtkEntry *entry,
*x = xborder;
if (y)
*y = yborder;
*y = frame_height / 2 - (requisition.height - yborder * 2) / 2;
if (width)
*width = GTK_WIDGET (entry)->allocation.width - xborder * 2;