diff --git a/ChangeLog b/ChangeLog index 7454bbe28..adde5a7bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,9 @@ * win32-config.h, src/makefile.win32: Fix Windows build: don't use GIO. Link against GIO anyways just to be safe with GTK 2.14. + * geany.glade, src/highlighting.c, src/interface.c, src/keyfile.c, + src/plugindata.h, src/ui_utils.h: + Add GUI pref to invert all colours for syntax highlighting. 2009-01-12 Nick Treleaven diff --git a/geany.glade b/geany.glade index 5edb62e08..14476ce81 100644 --- a/geany.glade +++ b/geany.glade @@ -5982,8 +5982,9 @@ Match braces 0 - - Use white text on a black background. + + True + Use white text on a black background and invert all colors. This option requires a restart of Geany. True Invert syntax highlighting colors True diff --git a/src/highlighting.c b/src/highlighting.c index c9b900cca..00cd71447 100644 --- a/src/highlighting.c +++ b/src/highlighting.c @@ -35,6 +35,7 @@ #include "utils.h" #include "filetypes.h" #include "symbols.h" +#include "ui_utils.h" /* Note: Avoid using SSM in files not related to scintilla, use sciwrappers.h instead. */ @@ -427,6 +428,8 @@ static void styleset_common_init(gint ft_id, GKeyFile *config, GKeyFile *config_ common_style_set.styling[GCS_MARKER_TRANSLUCENCY].background = tmp_style.background; } + common_style_set.invert_all = interface_prefs.highlighting_invert_all = + (common_style_set.invert_all || interface_prefs.highlighting_invert_all); get_keyfile_wordchars(config, config_home, &common_style_set.wordchars); whitespace_chars = get_keyfile_whitespace_chars(config, config_home); diff --git a/src/interface.c b/src/interface.c index 8c29e06e7..4adf0ff61 100644 --- a/src/interface.c +++ b/src/interface.c @@ -2454,7 +2454,7 @@ create_prefs_dialog (void) GtkWidget *frame5; GtkWidget *alignment6; GtkWidget *vbox12; - GtkWidget *checkbutton1; + GtkWidget *check_highlighting_invert; GtkWidget *check_indent; GtkWidget *check_white_space; GtkWidget *check_line_end; @@ -3626,9 +3626,10 @@ create_prefs_dialog (void) gtk_widget_show (vbox12); gtk_container_add (GTK_CONTAINER (alignment6), vbox12); - checkbutton1 = gtk_check_button_new_with_mnemonic (_("Invert syntax highlighting colors")); - gtk_box_pack_start (GTK_BOX (vbox12), checkbutton1, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, checkbutton1, _("Use white text on a black background."), NULL); + check_highlighting_invert = gtk_check_button_new_with_mnemonic (_("Invert syntax highlighting colors")); + gtk_widget_show (check_highlighting_invert); + gtk_box_pack_start (GTK_BOX (vbox12), check_highlighting_invert, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, check_highlighting_invert, _("Use white text on a black background and invert all colors. This option requires a restart of Geany."), NULL); check_indent = gtk_check_button_new_with_mnemonic (_("Show indentation guides")); gtk_widget_show (check_indent); @@ -4695,7 +4696,7 @@ create_prefs_dialog (void) GLADE_HOOKUP_OBJECT (prefs_dialog, frame5, "frame5"); GLADE_HOOKUP_OBJECT (prefs_dialog, alignment6, "alignment6"); GLADE_HOOKUP_OBJECT (prefs_dialog, vbox12, "vbox12"); - GLADE_HOOKUP_OBJECT (prefs_dialog, checkbutton1, "checkbutton1"); + GLADE_HOOKUP_OBJECT (prefs_dialog, check_highlighting_invert, "check_highlighting_invert"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_indent, "check_indent"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_white_space, "check_white_space"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_line_end, "check_line_end"); diff --git a/src/keyfile.c b/src/keyfile.c index 9789c73e7..14490efb4 100644 --- a/src/keyfile.c +++ b/src/keyfile.c @@ -121,6 +121,9 @@ static void init_pref_groups(void) stash_group_add_toggle_button(group, &interface_prefs.notebook_double_click_hides_widgets, "notebook_double_click_hides_widgets", FALSE, "check_double_click_hides_widgets"); + stash_group_add_toggle_button(group, &interface_prefs.highlighting_invert_all, + "highlighting_invert_all", FALSE, "check_highlighting_invert"); + stash_group_add_toggle_button(group, &search_prefs.suppress_dialogs, "pref_main_suppress_search_dialogs", FALSE, "check_ask_suppress_search_dialogs"); stash_group_add_toggle_button(group, &search_prefs.use_current_word, diff --git a/src/plugindata.h b/src/plugindata.h index 70c521ac6..dc93fbfb3 100644 --- a/src/plugindata.h +++ b/src/plugindata.h @@ -45,7 +45,7 @@ enum { /** The Application Programming Interface (API) version, incremented * whenever any plugin data types are modified or appended to. */ - GEANY_API_VERSION = 124, + GEANY_API_VERSION = 125, /** The Application Binary Interface (ABI) version, incremented whenever * existing fields in the plugin data types have to be changed or reordered. */ diff --git a/src/ui_utils.h b/src/ui_utils.h index 66a4a9525..dbdd7d600 100644 --- a/src/ui_utils.h +++ b/src/ui_utils.h @@ -49,6 +49,7 @@ typedef struct GeanyInterfacePrefs gboolean statusbar_visible; gboolean show_symbol_list_expanders; gboolean notebook_double_click_hides_widgets; + gboolean highlighting_invert_all; } GeanyInterfacePrefs;