diff --git a/ChangeLog b/ChangeLog index a18a56dd7..2d71f0fb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-09/11 karl + + * #822 prefs option not to use alternating fg/bg in parallel displays. + 2017-09/03 karl * #524 fix use of fonts whose names end in digits. diff --git a/src/gnome2/preferences_dialog.c b/src/gnome2/preferences_dialog.c index db216a56a..c1a090c17 100644 --- a/src/gnome2/preferences_dialog.c +++ b/src/gnome2/preferences_dialog.c @@ -112,6 +112,7 @@ struct _preferences_check_buttons GtkWidget *show_splash_screen; GtkWidget *prayerlist; GtkWidget *statusbar; + GtkWidget *alternation; GtkWidget *show_in_viewer; GtkWidget *show_in_dictionary; @@ -1446,6 +1447,35 @@ on_checkbutton_statusbar_toggled(GtkToggleButton *togglebutton, gpointer user_da gtk_widget_hide(widgets.appbar); } +/****************************************************************************** + * Name + * on_checkbutton_alternation_toggled + * + * Synopsis + * #include "preferences_dialog.h" + * void on_checkbutton_alternation_toggled(GtkToggleButton * togglebutton, gpointer user_data) + * + * Description + * + * Return value + * void + */ + +void +on_checkbutton_alternation_toggled(GtkToggleButton *togglebutton, gpointer user_data) +{ + xml_set_value("Xiphos", "misc", "alternation", + (gtk_toggle_button_get_active(togglebutton) ? "1" : "0")); + settings.alternation = gtk_toggle_button_get_active(togglebutton); + + main_update_parallel_page(); /* 1 verse */ + if (settings.dockedInt) { /* whole chapter */ + main_update_parallel_page(); + } else { + main_update_parallel_page_detached(); + } +} + /****************************************************************************** * Name * on_folder_changed @@ -2170,6 +2200,8 @@ static void setup_check_buttons(void) settings.prayerlist); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button.statusbar), settings.statusbar); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button.alternation), + settings.alternation); /* v-- BibleSync --v */ /* toggles */ @@ -2245,6 +2277,9 @@ static void setup_check_buttons(void) g_signal_connect(check_button.statusbar, "toggled", G_CALLBACK(on_checkbutton_statusbar_toggled), NULL); + g_signal_connect(check_button.alternation, "toggled", + G_CALLBACK(on_checkbutton_alternation_toggled), + NULL); /* v-- BibleSync --v */ g_signal_connect(check_button.bs_debug, "toggled", @@ -2895,82 +2930,57 @@ static void create_preferences_dialog(void) /* color pickers */ color_picker.text_background = UI_GET_ITEM(gxml, "colorbutton1"); color_picker.text = UI_GET_ITEM(gxml, "colorbutton2"); - color_picker.text_current_verse = - UI_GET_ITEM(gxml, "colorbutton3"); + color_picker.text_current_verse = UI_GET_ITEM(gxml, "colorbutton3"); color_picker.verse_numbers = UI_GET_ITEM(gxml, "colorbutton4"); - color_picker.href_links = UI_GET_ITEM(gxml, "colorbutton5"); - color_picker.highlight_fg = UI_GET_ITEM(gxml, "colorbutton6"); - color_picker.highlight_bg = UI_GET_ITEM(gxml, "colorbutton7"); + color_picker.href_links = UI_GET_ITEM(gxml, "colorbutton5"); + color_picker.highlight_fg = UI_GET_ITEM(gxml, "colorbutton6"); + color_picker.highlight_bg = UI_GET_ITEM(gxml, "colorbutton7"); color_picker.invert_normal = UI_GET_ITEM(gxml, "invert_normal"); color_picker.invert_highlight = UI_GET_ITEM(gxml, "invert_highlight"); - check_button.use_linked_tabs = UI_GET_ITEM(gxml, "checkbutton10"); - check_button.readaloud = UI_GET_ITEM(gxml, "checkbutton11"); - check_button.show_verse_num = UI_GET_ITEM(gxml, "checkbutton12"); - check_button.use_default_dictionary = - UI_GET_ITEM(gxml, "checkbutton6"); - check_button.show_devotion = UI_GET_ITEM(gxml, "checkbutton7"); - check_button.show_splash_screen = - UI_GET_ITEM(gxml, "checkbutton8"); - check_button.use_chapter_scroll = - UI_GET_ITEM(gxml, "checkbutton_scroll"); - - check_button.use_imageresize = - UI_GET_ITEM(gxml, "checkbutton_imageresize"); + check_button.use_linked_tabs = UI_GET_ITEM(gxml, "checkbutton10"); + check_button.readaloud = UI_GET_ITEM(gxml, "checkbutton11"); + check_button.show_verse_num = UI_GET_ITEM(gxml, "checkbutton12"); + check_button.use_default_dictionary = UI_GET_ITEM(gxml, "checkbutton6"); + check_button.show_devotion = UI_GET_ITEM(gxml, "checkbutton7"); + check_button.show_splash_screen = UI_GET_ITEM(gxml, "checkbutton8"); + check_button.use_chapter_scroll = UI_GET_ITEM(gxml, "checkbutton_scroll"); + + check_button.use_imageresize = UI_GET_ITEM(gxml, "checkbutton_imageresize"); #ifdef WIN32 /* webkit image hackery requires resize always be enabled. */ gtk_widget_hide(check_button.use_imageresize); #endif - check_button.use_verse_num_bold = - UI_GET_ITEM(gxml, "checkbutton_verse_num_bold"); - check_button.use_verse_num_bracket = - UI_GET_ITEM(gxml, "checkbutton_verse_num_bracket"); - check_button.use_verse_num_superscript = - UI_GET_ITEM(gxml, "checkbutton_verse_num_superscript"); - check_button.versehighlight = - UI_GET_ITEM(gxml, "checkbutton_versehighlight"); - check_button.annotate_highlight = - UI_GET_ITEM(gxml, "checkbutton_annotate_highlight"); - check_button.xrefs_in_verse_list = - UI_GET_ITEM(gxml, "checkbutton_xrefs_in_verse_list"); - check_button.prayerlist = - UI_GET_ITEM(gxml, "checkbutton_prayerlist"); - check_button.statusbar = UI_GET_ITEM(gxml, "checkbutton_statusbar"); + check_button.use_verse_num_bold = UI_GET_ITEM(gxml, "checkbutton_verse_num_bold"); + check_button.use_verse_num_bracket = UI_GET_ITEM(gxml, "checkbutton_verse_num_bracket"); + check_button.use_verse_num_superscript = UI_GET_ITEM(gxml, "checkbutton_verse_num_superscript"); + check_button.versehighlight = UI_GET_ITEM(gxml, "checkbutton_versehighlight"); + check_button.annotate_highlight = UI_GET_ITEM(gxml, "checkbutton_annotate_highlight"); + check_button.xrefs_in_verse_list = UI_GET_ITEM(gxml, "checkbutton_xrefs_in_verse_list"); + check_button.prayerlist = UI_GET_ITEM(gxml, "checkbutton_prayerlist"); + check_button.statusbar = UI_GET_ITEM(gxml, "checkbutton_statusbar"); + check_button.alternation = UI_GET_ITEM(gxml, "checkbutton_alternation"); /* v-- BibleSync --v */ - check_button.bs_debug = - UI_GET_ITEM(gxml, "checkbutton_BSP_nav_debug"); - check_button.bs_presence = - UI_GET_ITEM(gxml, "checkbutton_BSP_presence"); - check_button.bs_mismatch = - UI_GET_ITEM(gxml, "checkbutton_BSP_mismatch"); - check_button.bs_group_tab = - UI_GET_ITEM(gxml, "checkbutton_BSP_group_tab"); - check_button.bs_privacy = - UI_GET_ITEM(gxml, "checkbutton_BSP_privacy"); - - radio_button.bs_mode_off = - UI_GET_ITEM(gxml, "radiobutton_BSP_off"); - radio_button.bs_mode_personal = - UI_GET_ITEM(gxml, "radiobutton_BSP_personal"); - radio_button.bs_mode_speaker = - UI_GET_ITEM(gxml, "radiobutton_BSP_speaker"); - radio_button.bs_mode_audience = - UI_GET_ITEM(gxml, "radiobutton_BSP_audience"); - - radio_button.bs_nav_direct = - UI_GET_ITEM(gxml, "radiobutton_BSP_nav_direct"); - radio_button.bs_nav_verselist = - UI_GET_ITEM(gxml, "radiobutton_BSP_nav_verselist"); - - radio_button.bs_listen_some = - UI_GET_ITEM(gxml, "radiobutton_BSP_listen_some"); - radio_button.bs_listen_all = - UI_GET_ITEM(gxml, "radiobutton_BSP_listen_all"); - radio_button.bs_listen_none = - UI_GET_ITEM(gxml, "radiobutton_BSP_listen_none"); + check_button.bs_debug = UI_GET_ITEM(gxml, "checkbutton_BSP_nav_debug"); + check_button.bs_presence = UI_GET_ITEM(gxml, "checkbutton_BSP_presence"); + check_button.bs_mismatch = UI_GET_ITEM(gxml, "checkbutton_BSP_mismatch"); + check_button.bs_group_tab = UI_GET_ITEM(gxml, "checkbutton_BSP_group_tab"); + check_button.bs_privacy = UI_GET_ITEM(gxml, "checkbutton_BSP_privacy"); + + radio_button.bs_mode_off = UI_GET_ITEM(gxml, "radiobutton_BSP_off"); + radio_button.bs_mode_personal = UI_GET_ITEM(gxml, "radiobutton_BSP_personal"); + radio_button.bs_mode_speaker = UI_GET_ITEM(gxml, "radiobutton_BSP_speaker"); + radio_button.bs_mode_audience = UI_GET_ITEM(gxml, "radiobutton_BSP_audience"); + + radio_button.bs_nav_direct = UI_GET_ITEM(gxml, "radiobutton_BSP_nav_direct"); + radio_button.bs_nav_verselist = UI_GET_ITEM(gxml, "radiobutton_BSP_nav_verselist"); + + radio_button.bs_listen_some = UI_GET_ITEM(gxml, "radiobutton_BSP_listen_some"); + radio_button.bs_listen_all = UI_GET_ITEM(gxml, "radiobutton_BSP_listen_all"); + radio_button.bs_listen_none = UI_GET_ITEM(gxml, "radiobutton_BSP_listen_none"); speaker_window = UI_GET_ITEM(gxml, "speakerwindow"); biblesync_update_speaker(); diff --git a/src/gui/preferences_dialog.h b/src/gui/preferences_dialog.h index 86f739157..eafff2d7e 100644 --- a/src/gui/preferences_dialog.h +++ b/src/gui/preferences_dialog.h @@ -121,37 +121,28 @@ void on_checkbutton11_toggled(GtkToggleButton *togglebutton, gpointer user_data); void on_checkbutton12_toggled(GtkToggleButton *togglebutton, gpointer user_data); -void on_checkbutton_verse_num_bold_toggled(GtkToggleButton * - togglebutton, +void on_checkbutton_verse_num_bold_toggled(GtkToggleButton *togglebutton, gpointer user_data); -void on_checkbutton_verse_num_bracket_toggled(GtkToggleButton * - togglebutton, +void on_checkbutton_verse_num_bracket_toggled(GtkToggleButton *togglebutton, gpointer user_data); -void on_checkbutton_verse_num_superscript_toggled(GtkToggleButton * - togglebutton, - gpointer - user_data); +void on_checkbutton_verse_num_superscript_toggled(GtkToggleButton *togglebutton, + gpointer user_data); void on_checkbutton_scroll_toggled(GtkToggleButton *togglebutton, gpointer user_data); -void on_checkbutton_imageresize_toggled(GtkToggleButton * - togglebutton, +void on_checkbutton_imageresize_toggled(GtkToggleButton *togglebutton, gpointer user_data); -void on_checkbutton_versehighlight_toggled(GtkToggleButton * - togglebutton, +void on_checkbutton_versehighlight_toggled(GtkToggleButton *togglebutton, gpointer user_data); -void on_checkbutton_annotate_highlight_toggled(GtkToggleButton * - togglebutton, +void on_checkbutton_annotate_highlight_toggled(GtkToggleButton *togglebutton, gpointer user_data); -void on_checkbutton_xrefs_in_verse_list_toggled(GtkToggleButton * - togglebutton, - gpointer - user_data); -void on_checkbutton_prayerlist_toggled(GtkToggleButton * - togglebutton, +void on_checkbutton_xrefs_in_verse_list_toggled(GtkToggleButton *togglebutton, + gpointer user_data); +void on_checkbutton_prayerlist_toggled(GtkToggleButton *togglebutton, gpointer user_data); -void on_checkbutton_statusbar_toggled(GtkToggleButton * - togglebutton, +void on_checkbutton_statusbar_toggled(GtkToggleButton *togglebutton, gpointer user_data); +void on_checkbutton_alternation_toggled(GtkToggleButton *togglebutton, + gpointer user_data); void on_basecombobox1_changed(GtkComboBox *combobox, gpointer user_data); diff --git a/src/main/parallel_view.cc b/src/main/parallel_view.cc index e6b0353b5..6e15e63e2 100644 --- a/src/main/parallel_view.cc +++ b/src/main/parallel_view.cc @@ -683,7 +683,8 @@ void main_update_parallel_page(void) is_rtol = main_is_mod_rtol(mod_name); - if (modidx % 2 == 1) { /* alternating background color */ + /* alternating background color */ + if (settings.alternation && (modidx % 2 == 1)) { rowcolor = settings.bible_text_color; textcolor = settings.bible_bg_color; } else { @@ -869,7 +870,7 @@ static void interpolate_parallel_display(SWBuf &text, gchar *key, gint parallel_ text += ""; // alternate background colors. - bgColor = (verse % 2 == 0) + bgColor = (settings.alternation && (verse % 2 == 0)) ? settings.bible_text_color : settings.bible_bg_color; @@ -886,7 +887,7 @@ static void interpolate_parallel_display(SWBuf &text, gchar *key, gint parallel_ if ((verse == cur_verse) && is_bible_text[modidx]) textColor = settings.currentverse_color; else - textColor = (verse % 2 == 0) + textColor = (settings.alternation && (verse % 2 == 0)) ? settings.bible_bg_color : settings.bible_text_color; diff --git a/src/main/settings.c b/src/main/settings.c index b56c57758..5c358d89d 100644 --- a/src/main/settings.c +++ b/src/main/settings.c @@ -1111,6 +1111,13 @@ void load_settings_structure(void) settings.statusbar = 1; } + if ((buf = xml_get_value("misc", "alternation"))) { + settings.alternation = atoi(buf); + } else { + xml_add_new_item_to_section("misc", "alternation", "1"); + settings.alternation = 1; + } + #if 1 settings.browsing = 1; /* unconditional - no longer toggle-able. */ #else diff --git a/src/main/settings.h b/src/main/settings.h index 2e4c2a34d..6901aa162 100644 --- a/src/main/settings.h +++ b/src/main/settings.h @@ -208,6 +208,9 @@ struct _settings /* statusbar setting */ int statusbar; + /* parallel color alternation */ + int alternation; + /* if true parallel tab is showing */ int paratab_showing; diff --git a/ui/prefs.glade b/ui/prefs.glade index 9382882d8..b4c3171ca 100644 --- a/ui/prefs.glade +++ b/ui/prefs.glade @@ -1501,7 +1501,7 @@ True True - Enable Prayer Lists Checkbox + Enable Statusbar Checkbox @@ -1510,6 +1510,26 @@ 10 + + + Parallel color alternation + True + True + False + Parallel window can use alternating foreground/background. + True + True + True + + Enable Parallel Alternation Checkbox + + + + False + False + 11 + + True @@ -1601,7 +1621,7 @@ - 11 + 12 diff --git a/ui/prefs.gtkbuilder b/ui/prefs.gtkbuilder index 2bcc3676d..53e7d8de2 100644 --- a/ui/prefs.gtkbuilder +++ b/ui/prefs.gtkbuilder @@ -1786,7 +1786,7 @@ True - Enable Prayer Lists Checkbox + Enable Statusbar Checkbox @@ -1796,6 +1796,29 @@ 10 + + + Parallel color alternation + True + True + False + Parallel window can use alternating foreground/background. + True + 0 + True + True + + + Enable Parallel Alternation Checkbox + + + + + False + False + 11 + + True @@ -1903,7 +1926,7 @@ True True - 11 + 12 diff --git a/ui/prefs_old.gtkbuilder b/ui/prefs_old.gtkbuilder index ea0b52ea6..794481fbc 100644 --- a/ui/prefs_old.gtkbuilder +++ b/ui/prefs_old.gtkbuilder @@ -1643,7 +1643,7 @@ True - Enable Prayer Lists Checkbox + Enable Statusbar Checkbox @@ -1653,6 +1653,29 @@ 10 + + + Parallel color alternation + True + True + False + Parallel window can use alternating foreground/background. + True + 0 + True + True + + + Enable Statusbar Checkbox + + + + + False + False + 11 + + True @@ -1759,7 +1782,7 @@ - 11 + 12