mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 06:10:15 +00:00
gtktextdisplay: Optimize GtkStyleContext usage
This commit is contained in:
parent
fe8f6f60dc
commit
50c4fdbacd
@ -587,14 +587,18 @@ render_para (GtkTextRenderer *text_renderer,
|
||||
screen_width = line_display->total_width;
|
||||
|
||||
context = gtk_widget_get_style_context (text_renderer->widget);
|
||||
state = gtk_widget_get_state_flags (text_renderer->widget);
|
||||
gtk_style_context_save (context);
|
||||
|
||||
state = gtk_style_context_get_state (context);
|
||||
state |= GTK_STATE_FLAG_SELECTED;
|
||||
gtk_style_context_set_state (context, state);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_style_context_get_background_color (context, state, &selection);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
|
||||
do
|
||||
{
|
||||
PangoLayoutLine *line = pango_layout_iter_get_line_readonly (iter);
|
||||
|
Loading…
Reference in New Issue
Block a user