Commit 438c9cdc authored by Sebastian Ramacher's avatar Sebastian Ramacher
Browse files

Add statusbar-basename option



Thanks to oblique for the patch.
Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 1c701851
......@@ -208,6 +208,8 @@ config_load_default(zathura_t* zathura)
bool_value = false;
girara_setting_add(gsession, "window-title-basename", &bool_value, BOOLEAN, false, _("Use basename of the file in the window title"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "statusbar-basename", &bool_value, BOOLEAN, false, _("Use basename of the file in the statusbar"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "synctex", &bool_value, BOOLEAN, false, _("Enable synctex support"), NULL, NULL);
/* define default shortcuts */
......
......@@ -581,7 +581,15 @@ document_open(zathura_t* zathura, const char* path, const char* password)
}
/* update statusbar */
girara_statusbar_item_set_text(zathura->ui.session, zathura->ui.statusbar.file, file_path);
bool basename_only = false;
girara_setting_get(zathura->ui.session, "statusbar-basename", &basename_only);
if (basename_only == false) {
girara_statusbar_item_set_text(zathura->ui.session, zathura->ui.statusbar.file, file_path);
} else {
char* tmp = g_path_get_basename(file_path);
girara_statusbar_item_set_text(zathura->ui.session, zathura->ui.statusbar.file, tmp);
g_free(tmp);
}
/* install file monitor */
gchar* file_uri = g_filename_to_uri(file_path, NULL, NULL);
......@@ -690,7 +698,7 @@ document_open(zathura_t* zathura, const char* path, const char* password)
zathura_bookmarks_load(zathura, file_path);
/* update title */
bool basename_only = false;
basename_only = false;
girara_setting_get(zathura->ui.session, "window-title-basename", &basename_only);
if (basename_only == false) {
girara_set_window_title(zathura->ui.session, file_path);
......
......@@ -658,6 +658,13 @@ Use basename of the file in the window title.
* Value type: Boolean
* Default value: false
statusbar-basename
^^^^^^^^^^^^^^^^^^
Use basename of the file in the statusbar.
* Value type: Boolean
* Default value: false
zoom-center
^^^^^^^^^^^
En/Disables horizontally centered zooming
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment