mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-16 08:55:50 +01:00
Add statusbar-basename option
Thanks to oblique for the patch. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
1c70185171
commit
438c9cdc9f
3 changed files with 19 additions and 2 deletions
2
config.c
2
config.c
|
@ -208,6 +208,8 @@ config_load_default(zathura_t* zathura)
|
||||||
bool_value = false;
|
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);
|
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;
|
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);
|
girara_setting_add(gsession, "synctex", &bool_value, BOOLEAN, false, _("Enable synctex support"), NULL, NULL);
|
||||||
|
|
||||||
/* define default shortcuts */
|
/* define default shortcuts */
|
||||||
|
|
10
zathura.c
10
zathura.c
|
@ -581,7 +581,15 @@ document_open(zathura_t* zathura, const char* path, const char* password)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update statusbar */
|
/* 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);
|
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 */
|
/* install file monitor */
|
||||||
gchar* file_uri = g_filename_to_uri(file_path, NULL, NULL);
|
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);
|
zathura_bookmarks_load(zathura, file_path);
|
||||||
|
|
||||||
/* update title */
|
/* update title */
|
||||||
bool basename_only = false;
|
basename_only = false;
|
||||||
girara_setting_get(zathura->ui.session, "window-title-basename", &basename_only);
|
girara_setting_get(zathura->ui.session, "window-title-basename", &basename_only);
|
||||||
if (basename_only == false) {
|
if (basename_only == false) {
|
||||||
girara_set_window_title(zathura->ui.session, file_path);
|
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
|
* Value type: Boolean
|
||||||
* Default value: false
|
* Default value: false
|
||||||
|
|
||||||
|
statusbar-basename
|
||||||
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
Use basename of the file in the statusbar.
|
||||||
|
|
||||||
|
* Value type: Boolean
|
||||||
|
* Default value: false
|
||||||
|
|
||||||
zoom-center
|
zoom-center
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
En/Disables horizontally centered zooming
|
En/Disables horizontally centered zooming
|
||||||
|
|
Loading…
Reference in a new issue