mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 12:26:01 +01:00
Fix adjust-open setting
This commit is contained in:
parent
900516d1f1
commit
3fec0ed485
2 changed files with 12 additions and 5 deletions
4
config.c
4
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);
|
||||
|
|
13
document.c
13
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue