mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
textview: Invalidate selection when its style changes
This commit is contained in:
parent
f413d5ef22
commit
0fa4b7a249
@ -833,6 +833,20 @@ gtk_text_layout_invalidate_cursors (GtkTextLayout *layout,
|
|||||||
gtk_text_layout_invalidated (layout);
|
gtk_text_layout_invalidated (layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_text_layout_invalidate_selection (GtkTextLayout *layout)
|
||||||
|
{
|
||||||
|
GtkTextIter selection_start, selection_end;
|
||||||
|
|
||||||
|
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
|
||||||
|
|
||||||
|
if (layout->buffer &&
|
||||||
|
gtk_text_buffer_get_selection_bounds (layout->buffer,
|
||||||
|
&selection_start,
|
||||||
|
&selection_end))
|
||||||
|
gtk_text_layout_invalidate (layout, &selection_start, &selection_end);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gtk_text_layout_free_line_data (GtkTextLayout *layout,
|
gtk_text_layout_free_line_data (GtkTextLayout *layout,
|
||||||
GtkTextLine *line,
|
GtkTextLine *line,
|
||||||
|
@ -287,6 +287,7 @@ void gtk_text_layout_invalidate (GtkTextLayout *layout,
|
|||||||
void gtk_text_layout_invalidate_cursors(GtkTextLayout *layout,
|
void gtk_text_layout_invalidate_cursors(GtkTextLayout *layout,
|
||||||
const GtkTextIter *start,
|
const GtkTextIter *start,
|
||||||
const GtkTextIter *end);
|
const GtkTextIter *end);
|
||||||
|
void gtk_text_layout_invalidate_selection (GtkTextLayout *layout);
|
||||||
void gtk_text_layout_free_line_data (GtkTextLayout *layout,
|
void gtk_text_layout_free_line_data (GtkTextLayout *layout,
|
||||||
GtkTextLine *line,
|
GtkTextLine *line,
|
||||||
GtkTextLineData *line_data);
|
GtkTextLineData *line_data);
|
||||||
|
@ -5046,6 +5046,9 @@ gtk_text_view_state_flags_changed (GtkWidget *widget,
|
|||||||
|
|
||||||
gtk_css_node_set_state (priv->selection_node, state);
|
gtk_css_node_set_state (priv->selection_node, state);
|
||||||
|
|
||||||
|
if (priv->layout)
|
||||||
|
gtk_text_layout_invalidate_selection (priv->layout);
|
||||||
|
|
||||||
gtk_widget_queue_draw (widget);
|
gtk_widget_queue_draw (widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user