forked from AuroraMiddleware/gtk
entry: Translate progress region properly when drawing text
This commit is contained in:
parent
76294fcf1d
commit
da1f618b09
@ -5744,7 +5744,6 @@ gtk_entry_draw_text (GtkEntry *entry,
|
|||||||
GtkStateFlags state = 0;
|
GtkStateFlags state = 0;
|
||||||
GdkRGBA text_color, bar_text_color;
|
GdkRGBA text_color, bar_text_color;
|
||||||
GtkStyleContext *context;
|
GtkStyleContext *context;
|
||||||
gint pos_x, pos_y;
|
|
||||||
gint width, height;
|
gint width, height;
|
||||||
gint progress_x, progress_y, progress_width, progress_height;
|
gint progress_x, progress_y, progress_width, progress_height;
|
||||||
gint clip_width, clip_height;
|
gint clip_width, clip_height;
|
||||||
@ -5784,6 +5783,8 @@ gtk_entry_draw_text (GtkEntry *entry,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int frame_x, frame_y, area_x, area_y;
|
||||||
|
|
||||||
width = gdk_window_get_width (priv->text_area);
|
width = gdk_window_get_width (priv->text_area);
|
||||||
height = gdk_window_get_height (priv->text_area);
|
height = gdk_window_get_height (priv->text_area);
|
||||||
|
|
||||||
@ -5792,9 +5793,12 @@ gtk_entry_draw_text (GtkEntry *entry,
|
|||||||
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
|
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
|
||||||
cairo_rectangle (cr, 0, 0, width, height);
|
cairo_rectangle (cr, 0, 0, width, height);
|
||||||
|
|
||||||
gdk_window_get_position (priv->text_area, &pos_x, &pos_y);
|
/* progres area is frame-relative, we need it text-area window
|
||||||
progress_x -= pos_x;
|
* relative */
|
||||||
progress_y -= pos_y;
|
get_frame_size (entry, TRUE, &frame_x, &frame_y, NULL, NULL);
|
||||||
|
gdk_window_get_position (priv->text_area, &area_x, &area_y);
|
||||||
|
progress_x += frame_x - area_x;
|
||||||
|
progress_y += frame_y - area_y;
|
||||||
|
|
||||||
cairo_rectangle (cr, progress_x, progress_y,
|
cairo_rectangle (cr, progress_x, progress_y,
|
||||||
progress_width, progress_height);
|
progress_width, progress_height);
|
||||||
|
Loading…
Reference in New Issue
Block a user