Add statusbar-basename option

Thanks to oblique for the patch.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2013-02-28 16:20:54 +01:00
parent 1c70185171
commit 438c9cdc9f
3 changed files with 19 additions and 2 deletions

View file

@ -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 */

View file

@ -581,7 +581,15 @@ document_open(zathura_t* zathura, const char* path, const char* password)
}
/* update statusbar */
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);

View file

@ -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