aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.ja7
-rw-r--r--src/prefs_common.c6
-rw-r--r--src/textview.c63
-rw-r--r--src/textview.h8
5 files changed, 68 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index b1be8775..a26ad5c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2005-06-22
+ * src/prefs_common.c: quote_colors_set_dialog_key_pressed(): destroy
+ dialog only if Escape key is pressed.
+ * src/textview.[ch]: update colors of text tags when prefs are
+ updated.
+
+2005-06-22
+
* src/summaryview.[ch]: made summary columns reorderable by DnD.
2005-06-22
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 90acd276..59e1692b 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,12 @@
2005-06-22
+ * src/prefs_common.c: quote_colors_set_dialog_key_pressed(): Escape
+ キーが押された場合のみダイアログを破棄するようにした。
+ * src/textview.[ch]: 設定が更新されたらテキストタグの色も更新する
+ ようにした。
+
+2005-06-22
+
* src/summaryview.[ch]: DnD でサマリカラムを並べ替えられるようにした。
2005-06-22
diff --git a/src/prefs_common.c b/src/prefs_common.c
index 132e151e..aadbfaa6 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -2792,7 +2792,6 @@ void prefs_quote_colors_dialog(void)
gtk_main();
gtk_widget_hide(quote_color_win);
- textview_update_message_colors();
main_window_reflect_prefs_all();
}
@@ -3027,7 +3026,10 @@ static gboolean quote_colors_set_dialog_key_pressed(GtkWidget *widget,
GdkEventKey *event,
gpointer data)
{
- gtk_widget_destroy(color_dialog);
+ if (event && event->keyval == GDK_Escape) {
+ gtk_widget_destroy(color_dialog);
+ return TRUE;
+ }
return FALSE;
}
diff --git a/src/textview.c b/src/textview.c
index f974fde6..26d1e385 100644
--- a/src/textview.c
+++ b/src/textview.c
@@ -296,8 +296,9 @@ TextView *textview_create(void)
return textview;
}
-static void textview_create_tags(GtkTextView *text, TextView *textview)
+static void textview_create_tags(TextView *textview)
{
+ GtkTextView *text = GTK_TEXT_VIEW(textview->text);
GtkTextBuffer *buffer;
static PangoFontDescription *font_desc;
@@ -316,25 +317,32 @@ static void textview_create_tags(GtkTextView *text, TextView *textview)
gtk_text_buffer_create_tag(buffer, "header_title",
"weight", PANGO_WEIGHT_BOLD,
NULL);
- gtk_text_buffer_create_tag(buffer, "quote0",
- "foreground-gdk", &quote_colors[0],
- NULL);
- gtk_text_buffer_create_tag(buffer, "quote1",
- "foreground-gdk", &quote_colors[1],
- NULL);
- gtk_text_buffer_create_tag(buffer, "quote2",
- "foreground-gdk", &quote_colors[2],
- NULL);
+
+ textview->quote0_tag =
+ gtk_text_buffer_create_tag(buffer, "quote0",
+ "foreground-gdk", &quote_colors[0],
+ NULL);
+ textview->quote1_tag =
+ gtk_text_buffer_create_tag(buffer, "quote1",
+ "foreground-gdk", &quote_colors[1],
+ NULL);
+ textview->quote2_tag =
+ gtk_text_buffer_create_tag(buffer, "quote2",
+ "foreground-gdk", &quote_colors[2],
+ NULL);
+ textview->link_tag =
+ gtk_text_buffer_create_tag(buffer, "link",
+ "foreground-gdk", &uri_color,
+ NULL);
+ textview->hover_link_tag =
+ gtk_text_buffer_create_tag(buffer, "hover-link",
+ "foreground-gdk", &uri_color,
+ "underline", PANGO_UNDERLINE_SINGLE,
+ NULL);
+
gtk_text_buffer_create_tag(buffer, "emphasis",
"foreground-gdk", &emphasis_color,
NULL);
- gtk_text_buffer_create_tag(buffer, "link",
- "foreground-gdk", &uri_color,
- NULL);
- gtk_text_buffer_create_tag(buffer, "hover-link",
- "foreground-gdk", &uri_color,
- "underline", PANGO_UNDERLINE_SINGLE,
- NULL);
#if USE_GPGME
gtk_text_buffer_create_tag(buffer, "good-signature",
"foreground-gdk", &good_sig_color,
@@ -358,18 +366,19 @@ void textview_init(TextView *textview)
if (!regular_cursor)
regular_cursor = gdk_cursor_new(GDK_XTERM);
+ textview_create_tags(textview);
textview_reflect_prefs(textview);
textview_set_all_headers(textview, FALSE);
textview_set_font(textview, NULL);
- textview_create_tags(GTK_TEXT_VIEW(textview->text), textview);
}
-void textview_update_message_colors(void)
+static void textview_update_message_colors(void)
{
GdkColor black = {0, 0, 0, 0};
if (prefs_common.enable_color) {
- /* grab the quote colors, converting from an int to a GdkColor */
+ /* grab the quote colors, converting from an int to a
+ GdkColor */
gtkut_convert_int_to_gdk_color(prefs_common.quote_level1_col,
&quote_colors[0]);
gtkut_convert_int_to_gdk_color(prefs_common.quote_level2_col,
@@ -384,9 +393,23 @@ void textview_update_message_colors(void)
}
}
+static void textview_update_tags(TextView *textview)
+{
+ g_object_set(textview->quote0_tag, "foreground-gdk", &quote_colors[0],
+ NULL);
+ g_object_set(textview->quote1_tag, "foreground-gdk", &quote_colors[1],
+ NULL);
+ g_object_set(textview->quote2_tag, "foreground-gdk", &quote_colors[2],
+ NULL);
+ g_object_set(textview->link_tag, "foreground-gdk", &uri_color, NULL);
+ g_object_set(textview->hover_link_tag, "foreground-gdk", &uri_color,
+ NULL);
+}
+
void textview_reflect_prefs(TextView *textview)
{
textview_update_message_colors();
+ textview_update_tags(textview);
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(textview->text),
prefs_common.textview_cursor_visible);
}
diff --git a/src/textview.h b/src/textview.h
index df4a20fc..57382d39 100644
--- a/src/textview.h
+++ b/src/textview.h
@@ -26,6 +26,7 @@
#include <glib.h>
#include <gtk/gtkwidget.h>
+#include <gtk/gtktexttag.h>
typedef struct _TextView TextView;
@@ -41,6 +42,12 @@ struct _TextView
GtkWidget *popup_menu;
GtkItemFactory *popup_factory;
+ GtkTextTag *quote0_tag;
+ GtkTextTag *quote1_tag;
+ GtkTextTag *quote2_tag;
+ GtkTextTag *link_tag;
+ GtkTextTag *hover_link_tag;
+
GSList *uri_list;
gint body_pos;
@@ -51,7 +58,6 @@ struct _TextView
TextView *textview_create (void);
void textview_init (TextView *textview);
-void textview_update_message_colors (void);
void textview_reflect_prefs (TextView *textview);
void textview_show_message (TextView *textview,