textview_create_tags(GTK_TEXT_VIEW(textview->text), textview);
}
-#define CHANGE_TAG_COLOR(tagname, colorfg, colorbg) { \
+#if GTK_CHECK_VERSION(2, 8, 0)
+ #define CHANGE_TAG_COLOR(tagname, colorfg, colorbg) { \
tag = gtk_text_tag_table_lookup(tags, tagname); \
- if (tag && colorbg) \
+ if (tag) \
g_object_set(G_OBJECT(tag), "foreground-gdk", colorfg, "paragraph-background-gdk", colorbg, NULL); \
- else if (tag) \
+ }
+#else
+ #define CHANGE_TAG_COLOR(tagname, colorfg, colorbg) { \
+ tag = gtk_text_tag_table_lookup(tags, tagname); \
+ if (tag) \
g_object_set(G_OBJECT(tag), "foreground-gdk", colorfg, NULL); \
-}
+ }
+#endif
static void textview_update_message_colors(TextView *textview)
{
textview->uri_list = g_slist_append(textview->uri_list, r_uri);
}
+static void textview_set_cursor(GdkWindow *window, GdkCursor *cursor)
+{
+ if (GDK_IS_WINDOW(window))
+ gdk_window_set_cursor(window, cursor);
+}
void textview_clear(TextView *textview)
{
GtkTextView *text = GTK_TEXT_VIEW(textview->text);
textview->image = NULL;
if (textview->messageview->mainwin->cursor_count == 0) {
- gdk_window_set_cursor(window, text_cursor);
+ textview_set_cursor(window, text_cursor);
} else {
- gdk_window_set_cursor(window, watch_cursor);
+ textview_set_cursor(window, watch_cursor);
}
}
procheader_headername_equal(header->name, "From") ||
procheader_headername_equal(header->name, "To") ||
procheader_headername_equal(header->name, "Cc") ||
- procheader_headername_equal(header->name, "Bcc");
+ procheader_headername_equal(header->name, "Bcc") ||
+ procheader_headername_equal(header->name, "Sender");
textview_make_clickable_parts(textview, "header",
"link", header->body,
hdr);
GdkWindow *window = gtk_text_view_get_window(
GTK_TEXT_VIEW(textview->text),
GTK_TEXT_WINDOW_TEXT);
- gdk_window_set_cursor(window, watch_cursor);
+ textview_set_cursor(window, watch_cursor);
}
void textview_cursor_normal(TextView *textview)
GdkWindow *window = gtk_text_view_get_window(
GTK_TEXT_VIEW(textview->text),
GTK_TEXT_WINDOW_TEXT);
- gdk_window_set_cursor(window, text_cursor);
+ textview_set_cursor(window, text_cursor);
}
static void textview_uri_update(TextView *textview, gint x, gint y)
window = gtk_text_view_get_window(GTK_TEXT_VIEW(textview->text),
GTK_TEXT_WINDOW_TEXT);
if (textview->messageview->mainwin->cursor_count == 0) {
- gdk_window_set_cursor(window, uri ? hand_cursor : text_cursor);
+ textview_set_cursor(window, uri ? hand_cursor : text_cursor);
} else {
- gdk_window_set_cursor(window, watch_cursor);
+ textview_set_cursor(window, watch_cursor);
}
TEXTVIEW_STATUSBAR_POP(textview);