Commit a86b0cf0 authored by Jehan's avatar Jehan
Browse files

app: create a different tag for underlined text during preedit.

It still shows up as underlined during preedit, but does not toggle the
underline button in the style editor.
parent e7b75408
......@@ -1450,7 +1450,7 @@ gimp_text_tool_im_preedit_changed (GtkIMContext *context,
{
case PANGO_ATTR_UNDERLINE:
gtk_text_buffer_apply_tag (buffer,
text_tool->buffer->underline_tag,
text_tool->buffer->preedit_underline_tag,
&start, &end);
break;
case PANGO_ATTR_BACKGROUND:
......
......@@ -106,6 +106,11 @@ gimp_text_buffer_constructed (GObject *object)
"underline", PANGO_UNDERLINE_SINGLE,
NULL);
buffer->preedit_underline_tag = gtk_text_buffer_create_tag (GTK_TEXT_BUFFER (buffer),
"preedit-underline",
"underline", PANGO_UNDERLINE_SINGLE,
NULL);
buffer->strikethrough_tag = gtk_text_buffer_create_tag (GTK_TEXT_BUFFER (buffer),
"strikethrough",
"strikethrough", TRUE,
......@@ -1091,12 +1096,14 @@ gimp_text_buffer_set_bg_color (GimpTextBuffer *buffer,
/* Pango markup attribute names */
#define GIMP_TEXT_ATTR_NAME_SIZE "size"
#define GIMP_TEXT_ATTR_NAME_BASELINE "rise"
#define GIMP_TEXT_ATTR_NAME_KERNING "letter_spacing"
#define GIMP_TEXT_ATTR_NAME_FONT "font"
#define GIMP_TEXT_ATTR_NAME_COLOR "foreground"
#define GIMP_TEXT_ATTR_NAME_BG_COLOR "background"
#define GIMP_TEXT_ATTR_NAME_SIZE "size"
#define GIMP_TEXT_ATTR_NAME_BASELINE "rise"
#define GIMP_TEXT_ATTR_NAME_KERNING "letter_spacing"
#define GIMP_TEXT_ATTR_NAME_FONT "font"
#define GIMP_TEXT_ATTR_NAME_STYLE "style"
#define GIMP_TEXT_ATTR_NAME_COLOR "foreground"
#define GIMP_TEXT_ATTR_NAME_BG_COLOR "background"
#define GIMP_TEXT_ATTR_NAME_UNDERLINE "underline"
const gchar *
gimp_text_buffer_tag_to_name (GimpTextBuffer *buffer,
......@@ -1205,6 +1212,16 @@ gimp_text_buffer_tag_to_name (GimpTextBuffer *buffer,
return "span";
}
else if (tag == buffer->preedit_underline_tag)
{
if (attribute)
*attribute = GIMP_TEXT_ATTR_NAME_UNDERLINE;
if (value)
*value = g_strdup ("single");
return "span";
}
return NULL;
}
......
......@@ -47,6 +47,8 @@ struct _GimpTextBuffer
GList *color_tags;
GList *bg_color_tags;
GtkTextTag *preedit_underline_tag;
gboolean insert_tags_set;
GList *insert_tags;
GList *remove_tags;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment