Add GUI pref to invert all colours for syntax highlighting.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3468 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2009-01-14 19:19:08 +00:00
parent 06e3783c1f
commit 9d627214f1
7 changed files with 20 additions and 8 deletions

View File

@ -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 <nick(dot)treleaven(at)btinternet(dot)com>

View File

@ -5982,8 +5982,9 @@ Match braces</property>
<property name="spacing">0</property>
<child>
<widget class="GtkCheckButton" id="checkbutton1">
<property name="tooltip" translatable="yes">Use white text on a black background.</property>
<widget class="GtkCheckButton" id="check_highlighting_invert">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Use white text on a black background and invert all colors. This option requires a restart of Geany.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Invert syntax highlighting colors</property>
<property name="use_underline">True</property>

View File

@ -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);

View File

@ -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");

View File

@ -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,

View File

@ -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. */

View File

@ -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;