diff --git a/config.c b/config.c index 3a3e3d6..d46fca2 100644 --- a/config.c +++ b/config.c @@ -60,8 +60,8 @@ config_load_default(zathura_t* zathura) girara_setting_add(gsession, "highlight-transparency", &float_value, FLOAT, false, "Transparency for highlighting", NULL, NULL); bool_value = true; girara_setting_add(gsession, "render-loading", &bool_value, BOOLEAN, false, "Render 'Loading ...'", NULL, NULL); - int_value = ADJUST_BESTFIT; - girara_setting_add(gsession, "adjust-open", &int_value, INT, false, "Adjust to when opening file", NULL, NULL); + string_value = "best-fit"; + girara_setting_add(gsession, "adjust-open", string_value, STRING, false, "Adjust to when opening file", NULL, NULL); /* define default shortcuts */ girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_c, NULL, sc_abort, 0, 0, NULL); diff --git a/document.c b/document.c index dcab1a5..b7533a1 100644 --- a/document.c +++ b/document.c @@ -346,10 +346,17 @@ zathura_document_open(zathura_t* zathura, const char* path, const char* password g_signal_connect(G_OBJECT(document->file_monitor.monitor), "changed", G_CALLBACK(cb_file_monitor), zathura->ui.session); - /* apply open adjustment */ - int adjust_open = ADJUST_BESTFIT; - girara_setting_get(zathura->ui.session, "adjust-open", &adjust_open); + char* adjust_open = "best-fit"; + document->adjust_mode = ADJUST_BESTFIT; + if (girara_setting_get(zathura->ui.session, "adjust-open", &(adjust_open)) == true) { + if (g_strcmp0(adjust_open, "best-fit") == 0) { + document->adjust_mode = ADJUST_BESTFIT; + } else if (g_strcmp0(adjust_open, "width") == 0) { + document->adjust_mode = ADJUST_WIDTH; + } + g_free(adjust_open); + } g_free(file_uri);