make the recolor colors changeable too

This commit is contained in:
Sebastian Ramacher 2012-02-14 14:53:45 +01:00
parent 9d04a7bfcf
commit 2f38126a7a
2 changed files with 8 additions and 20 deletions

View File

@ -28,6 +28,10 @@ cb_color_change(girara_session_t* session, const char* name, girara_setting_type
gdk_color_parse(string_value, &(zathura->ui.colors.highlight_color));
} else if (g_strcmp0(name, "highlight-active-active") == 0) {
gdk_color_parse(string_value, &(zathura->ui.colors.highlight_color_active));
} else if (g_strcmp0(name, "recolor-darkcolor") == 0) {
gdk_color_parse(string_value, &(zathura->ui.colors.recolor_dark_color));
} else if (g_strcmp0(name, "recolor-lightcolor") == 0) {
gdk_color_parse(string_value, &(zathura->ui.colors.recolor_light_color));
}
/* TODO: cause a redraw here? */
@ -74,11 +78,10 @@ config_load_default(zathura_t* zathura)
int_value = 1000;
girara_setting_add(gsession, "zoom-max", &int_value, INT, false, "Zoom maximum", NULL, NULL);
string_value = "#FFFFFF";
girara_setting_add(gsession, "recolor-darkcolor", string_value, STRING, false, "Recoloring (dark color)", NULL, NULL);
string_value = "#000000";
girara_setting_add(gsession, "recolor-lightcolor", string_value, STRING, false, "Recoloring (light color)", NULL, NULL);
girara_setting_add(gsession, "recolor-darkcolor", NULL, STRING, false, "Recoloring (dark color)", cb_color_change, NULL);
girara_setting_set(gsession, "recolor-darkcolor", "#FFFFFF");
girara_setting_add(gsession, "recolor-lightcolor", NULL, STRING, false, "Recoloring (light color)", cb_color_change, NULL);
girara_setting_set(gsession, "recolor-lightcolor", "#000000");
girara_setting_add(gsession, "highlight-color", NULL, STRING, false, "Color for highlighting", cb_color_change, NULL);
girara_setting_set(gsession, "highlight-color", "#9FBC00");
girara_setting_add(gsession, "highlight-active-color", NULL, STRING, false, "Color for highlighting (active)", cb_color_change, NULL);

View File

@ -229,21 +229,6 @@ zathura_init(int argc, char* argv[])
gtk_table_set_row_spacings(GTK_TABLE(zathura->ui.page_widget), zathura->global.page_padding);
gtk_table_set_col_spacings(GTK_TABLE(zathura->ui.page_widget), zathura->global.page_padding);
/* parse colors */
char* string_value = NULL;
girara_setting_get(zathura->ui.session, "recolor-darkcolor", &string_value);
if (string_value != NULL) {
gdk_color_parse(string_value, &(zathura->ui.colors.recolor_dark_color));
g_free(string_value);
}
string_value = NULL;
girara_setting_get(zathura->ui.session, "recolor-lightcolor", &string_value);
if (string_value != NULL) {
gdk_color_parse(string_value, &(zathura->ui.colors.recolor_light_color));
g_free(string_value);
}
/* database */
zathura->database = zathura_db_init(zathura->config.data_dir);
if (zathura->database == NULL) {