mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-02-11 01:34:56 +01:00
Add setting to hide notifications after text selection
This commit is contained in:
parent
8e0514bc4f
commit
8f05b636f0
3 changed files with 21 additions and 7 deletions
|
@ -556,6 +556,10 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data)
|
||||||
if (selection != NULL) {
|
if (selection != NULL) {
|
||||||
gtk_clipboard_set_text(gtk_clipboard_get(*selection), text, -1);
|
gtk_clipboard_set_text(gtk_clipboard_get(*selection), text, -1);
|
||||||
|
|
||||||
|
bool notification = true;
|
||||||
|
girara_setting_get(zathura->ui.session, "selection-notification", ¬ification);
|
||||||
|
|
||||||
|
if (notification == true) {
|
||||||
char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
|
char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
|
||||||
char* escaped_text = g_markup_printf_escaped(
|
char* escaped_text = g_markup_printf_escaped(
|
||||||
_("Copied selected text to clipboard: %s"), stripped_text);
|
_("Copied selected text to clipboard: %s"), stripped_text);
|
||||||
|
@ -564,6 +568,7 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data)
|
||||||
girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_text);
|
girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_text);
|
||||||
g_free(escaped_text);
|
g_free(escaped_text);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_free(selection);
|
g_free(selection);
|
||||||
}
|
}
|
||||||
|
|
2
config.c
2
config.c
|
@ -229,6 +229,8 @@ config_load_default(zathura_t* zathura)
|
||||||
girara_setting_add(gsession, "dbus-service", &bool_value, BOOLEAN, false, _("Enable D-Bus service"), NULL, NULL);
|
girara_setting_add(gsession, "dbus-service", &bool_value, BOOLEAN, false, _("Enable D-Bus service"), NULL, NULL);
|
||||||
string_value = "primary";
|
string_value = "primary";
|
||||||
girara_setting_add(gsession, "selection-clipboard", string_value, STRING, false, _("The clipboard into which mouse-selected data will be written"), NULL, NULL);
|
girara_setting_add(gsession, "selection-clipboard", string_value, STRING, false, _("The clipboard into which mouse-selected data will be written"), NULL, NULL);
|
||||||
|
bool_value = true;
|
||||||
|
girara_setting_add(gsession, "selection-notification", &bool_value, BOOLEAN, false, _("Enable notification after selecting text"), NULL, NULL);
|
||||||
|
|
||||||
#define DEFAULT_SHORTCUTS(mode) \
|
#define DEFAULT_SHORTCUTS(mode) \
|
||||||
girara_shortcut_add(gsession, 0, GDK_KEY_a, NULL, sc_adjust_window, (mode), ZATHURA_ADJUST_BESTFIT, NULL); \
|
girara_shortcut_add(gsession, 0, GDK_KEY_a, NULL, sc_adjust_window, (mode), ZATHURA_ADJUST_BESTFIT, NULL); \
|
||||||
|
|
|
@ -846,7 +846,7 @@ zoom-center
|
||||||
En/Disables horizontally centered zooming.
|
En/Disables horizontally centered zooming.
|
||||||
|
|
||||||
* Value type: Boolean
|
* Value type: Boolean
|
||||||
* Default value: False
|
* Default value: false
|
||||||
|
|
||||||
zoom-max
|
zoom-max
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
|
@ -880,6 +880,13 @@ middle mouse button, or the Shift-Insert key combination.
|
||||||
* Value type: String
|
* Value type: String
|
||||||
* Default value: primary
|
* Default value: primary
|
||||||
|
|
||||||
|
selection-notification
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Defines if a notification should be displayed after selecting text.
|
||||||
|
|
||||||
|
* Value type: Boolean
|
||||||
|
* Default value: true
|
||||||
|
|
||||||
synctex
|
synctex
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
En/Disables SyncTeX backward synchronization support.
|
En/Disables SyncTeX backward synchronization support.
|
||||||
|
|
Loading…
Reference in a new issue