gtk: draw the progress only on the text area

so it doesn't extend under GtkSpinButton's buttons.
This commit is contained in:
Michael Natterer 2010-11-16 19:25:45 +01:00
parent 10d541b8b6
commit 95f588dc78

View File

@ -3339,27 +3339,6 @@ gtk_entry_draw_frame (GtkWidget *widget,
} }
} }
static void
gtk_entry_get_progress_border (GtkWidget *widget,
GtkBorder *progress_border)
{
GtkBorder *tmp_border;
gtk_widget_style_get (widget, "progress-border", &tmp_border, NULL);
if (tmp_border)
{
*progress_border = *tmp_border;
gtk_border_free (tmp_border);
}
else
{
progress_border->left = widget->style->xthickness;
progress_border->right = widget->style->xthickness;
progress_border->top = widget->style->ythickness;
progress_border->bottom = widget->style->ythickness;
}
}
static void static void
get_progress_area (GtkWidget *widget, get_progress_area (GtkWidget *widget,
gint *x, gint *x,
@ -3369,25 +3348,28 @@ get_progress_area (GtkWidget *widget,
{ {
GtkEntryPrivate *private = GTK_ENTRY_GET_PRIVATE (widget); GtkEntryPrivate *private = GTK_ENTRY_GET_PRIVATE (widget);
GtkEntry *entry = GTK_ENTRY (widget); GtkEntry *entry = GTK_ENTRY (widget);
GtkBorder progress_border; GtkBorder *progress_border;
gtk_entry_get_progress_border (widget, &progress_border); get_text_area_size (entry, x, y, width, height);
*x = progress_border.left; if (!private->interior_focus)
*y = progress_border.top;
*width = gdk_window_get_width (widget->window);
*height = gdk_window_get_height (widget->window);
*width -= progress_border.left + progress_border.right;
*height -= progress_border.top + progress_border.bottom;
if (gtk_widget_has_focus (widget) && !private->interior_focus)
{ {
*x += private->focus_width; *x -= private->focus_width;
*y += private->focus_width; *y -= private->focus_width;
*width -= 2 * private->focus_width; *width += 2 * private->focus_width;
*height -= 2 * private->focus_width; *height += 2 * private->focus_width;
}
gtk_widget_style_get (widget, "progress-border", &progress_border, NULL);
if (progress_border)
{
*x += progress_border->left;
*y += progress_border->top;
*width -= progress_border->left + progress_border->right;
*height -= progress_border->top + progress_border->bottom;
gtk_border_free (progress_border);
} }
if (private->progress_pulse_mode) if (private->progress_pulse_mode)