#define COMPOSE_DRAFT_TIMEOUT_UNSET -1
#define COMPOSE_DRAFT_TIMEOUT_FORBIDDEN -2
+static GdkColor default_to_bgcolor = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
+static GdkColor default_to_color = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
static GList *compose_list = NULL;
static GSList *extra_headers = NULL;
static void compose_entry_mark_default_to(Compose *compose, const gchar *mailto)
{
-#if !GTK_CHECK_VERSION(3, 0, 0)
- static GdkColor yellow;
- static GdkColor black;
- static gboolean yellow_initialised = FALSE;
-#else
- static GdkColor yellow = { (guint32)0, (guint16)0xf5, (guint16)0xf6, (guint16)0xbe };
- static GdkColor black = { (guint32)0, (guint16)0x0, (guint16)0x0, (guint16)0x0 };
-#endif
GSList *h_list;
GtkEntry *entry;
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (!yellow_initialised) {
- gdk_color_parse("#f5f6be", &yellow);
- gdk_color_parse("#000000", &black);
- yellow_initialised = gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &yellow, FALSE, TRUE);
- yellow_initialised &= gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &black, FALSE, TRUE);
- }
-#endif
-
for (h_list = compose->header_list; h_list != NULL; h_list = h_list->next) {
entry = GTK_ENTRY(((ComposeHeaderEntry *)h_list->data)->entry);
if (gtk_entry_get_text(entry) &&
!g_utf8_collate(gtk_entry_get_text(entry), mailto)) {
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (yellow_initialised) {
-#endif
gtk_widget_modify_base(
GTK_WIDGET(((ComposeHeaderEntry *)h_list->data)->entry),
- GTK_STATE_NORMAL, &yellow);
+ GTK_STATE_NORMAL, &default_to_bgcolor);
gtk_widget_modify_text(
GTK_WIDGET(((ComposeHeaderEntry *)h_list->data)->entry),
- GTK_STATE_NORMAL, &black);
-#if !GTK_CHECK_VERSION(3, 0, 0)
- }
-#endif
+ GTK_STATE_NORMAL, &default_to_color);
}
}
}
gtk_widget_show(window);
}
+ gtkut_convert_int_to_gdk_color(prefs_common.default_to_bgcolor,
+ &default_to_bgcolor);
+ gtkut_convert_int_to_gdk_color(prefs_common.default_to_color,
+ &default_to_color);
+
return compose;
}
gboolean want_history;
};
+static GdkColor qs_active_bgcolor = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
+static GdkColor qs_active_color = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
+static GdkColor qs_error_bgcolor = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
+static GdkColor qs_error_color = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
void quicksearch_set_on_progress_cb(QuickSearch* search,
gboolean (*cb)(gpointer data, guint at, guint matched, guint total), gpointer data)
{
update_extended_buttons(quicksearch);
+ gtkut_convert_int_to_gdk_color(prefs_common.qs_active_bgcolor,
+ &qs_active_bgcolor);
+ gtkut_convert_int_to_gdk_color(prefs_common.qs_active_color,
+ &qs_active_color);
+ gtkut_convert_int_to_gdk_color(prefs_common.qs_error_bgcolor,
+ &qs_error_bgcolor);
+ gtkut_convert_int_to_gdk_color(prefs_common.qs_error_color,
+ &qs_error_color);
+
return quicksearch;
}
static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
{
-#if !GTK_CHECK_VERSION(3, 0, 0)
- static GdkColor yellow;
- static GdkColor red;
- static GdkColor black;
- static gboolean colors_initialised = FALSE;
-#else
- static GdkColor yellow = { (guint32)0, (guint16)0xf5, (guint16)0xf6, (guint16)0xbe };
- static GdkColor red = { (guint32)0, (guint16)0xff, (guint16)0x70, (guint16)0x70 };
- static GdkColor black = { (guint32)0, (guint16)0x0, (guint16)0x0, (guint16)0x0 };
-#endif
gboolean error = FALSE;
-
quicksearch->active = active;
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (!colors_initialised) {
- gdk_color_parse("#f5f6be", &yellow);
- gdk_color_parse("#000000", &black);
- gdk_color_parse("#ff7070", &red);
- colors_initialised = gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &yellow, FALSE, TRUE);
- colors_initialised &= gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &black, FALSE, TRUE);
- colors_initialised &= gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &red, FALSE, TRUE);
- }
-#endif
-
if (active &&
(prefs_common.summary_quicksearch_type == ADVANCED_SEARCH_EXTENDED
&& !advsearch_has_proper_predicate(quicksearch->asearch)))
if (active) {
gtk_widget_set_sensitive(quicksearch->clear_search, TRUE);
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (colors_initialised) {
-#endif
gtk_widget_modify_base(
gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
- GTK_STATE_NORMAL, error ? &red : &yellow);
+ GTK_STATE_NORMAL, error ? &qs_error_bgcolor : &qs_active_bgcolor);
gtk_widget_modify_text(
gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
- GTK_STATE_NORMAL, &black);
-#if !GTK_CHECK_VERSION(3, 0, 0)
- }
-#endif
+ GTK_STATE_NORMAL, error ? &qs_error_color : &qs_active_color);
} else {
gtk_widget_set_sensitive(quicksearch->clear_search, FALSE);
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (colors_initialised) {
-#endif
gtk_widget_modify_base(
gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text(
gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
GTK_STATE_NORMAL, NULL);
-#if !GTK_CHECK_VERSION(3, 0, 0)
- }
-#endif
}
if (!active) {
{"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
P_BOOL, NULL, NULL, NULL},
+ {"default_to_color", "#000000", &prefs_common.default_to_color, P_COLOR,
+ NULL, NULL, NULL},
+ {"default_to_bgcolor", "#f5f6be", &prefs_common.default_to_bgcolor, P_COLOR,
+ NULL, NULL, NULL},
+ {"tags_color", "#000000", &prefs_common.tags_color, P_COLOR,
+ NULL, NULL, NULL},
+ {"tags_bgcolor", "#f5f6be", &prefs_common.tags_bgcolor, P_COLOR,
+ NULL, NULL, NULL},
+ {"qs_active_color", "#000000", &prefs_common.qs_active_color, P_COLOR,
+ NULL, NULL, NULL},
+ {"qs_active_bgcolor", "#f5f6be", &prefs_common.qs_active_bgcolor, P_COLOR,
+ NULL, NULL, NULL},
+ {"qs_error_color", "#000000", &prefs_common.qs_error_color, P_COLOR,
+ NULL, NULL, NULL},
+ {"qs_error_bgcolor", "#ff7070", &prefs_common.qs_error_bgcolor, P_COLOR,
+ NULL, NULL, NULL},
+
{"display_header_pane", "FALSE", &prefs_common.display_header_pane,
P_BOOL, NULL, NULL, NULL},
{"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
gulong signature_col;
gulong emphasis_col;
gboolean recycle_quote_colors;
+ gulong default_to_bgcolor;
+ gulong default_to_color;
+ gulong tags_bgcolor;
+ gulong tags_color;
+ gulong qs_active_bgcolor;
+ gulong qs_active_color;
+ gulong qs_error_bgcolor;
+ gulong qs_error_color;
gboolean display_header_pane;
gboolean display_header;
gboolean display_xface;
(gushort)0
};
+static GdkColor tags_bgcolor = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
+static GdkColor tags_color = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
static GdkCursor *hand_cursor = NULL;
static GdkCursor *text_cursor = NULL;
static GdkCursor *watch_cursor= NULL;
{
GtkTextBuffer *buffer;
GtkTextTag *tag, *qtag;
-#if !GTK_CHECK_VERSION(3, 0, 0)
- static GdkColor yellow, black;
- static gboolean color_init = FALSE;
-#else
- static GdkColor yellow = { (guint32)0, (guint16)0xf5, (guint16)0xf6, (guint16)0xbe };
- static GdkColor black = { (guint32)0, (guint16)0x0, (guint16)0x0, (guint16)0x0 };
-#endif
static PangoFontDescription *font_desc, *bold_font_desc;
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (!color_init) {
- gdk_color_parse("#f5f6be", &yellow);
- gdk_color_parse("#000000", &black);
- color_init = gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &yellow, FALSE, TRUE);
- color_init &= gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &black, FALSE, TRUE);
- }
-#endif
-
if (!font_desc)
font_desc = pango_font_description_from_string
(NORMAL_FONT);
NULL);
}
gtk_text_buffer_create_tag(buffer, "tags",
- "foreground-gdk", &black,
- "paragraph-background-gdk", &yellow,
+ "foreground-gdk", &tags_color,
+ "paragraph-background-gdk", &tags_bgcolor,
NULL);
gtk_text_buffer_create_tag(buffer, "emphasis",
"foreground-gdk", &emphasis_color,
quote_colors[0] = quote_colors[1] = quote_colors[2] = black;
uri_color = emphasis_color = signature_color = diff_added_color =
diff_deleted_color = diff_hunk_color = black;
+ tags_bgcolor = tags_color = black;
if (prefs_common.enable_color) {
/* grab the quote colors, converting from an int to a GdkColor */
CHANGE_TAG_COLOR("diff-add-file", &diff_added_color, NULL);
CHANGE_TAG_COLOR("diff-del-file", &diff_deleted_color, NULL);
CHANGE_TAG_COLOR("diff-hunk", &diff_hunk_color, NULL);
+
+ gtkut_convert_int_to_gdk_color(prefs_common.tags_bgcolor,
+ &tags_bgcolor);
+ gtkut_convert_int_to_gdk_color(prefs_common.tags_color,
+ &tags_color);
}
#undef CHANGE_TAG_COLOR