mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-02-05 09:04:55 +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
17
callbacks.c
17
callbacks.c
|
@ -556,13 +556,18 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data)
|
|||
if (selection != NULL) {
|
||||
gtk_clipboard_set_text(gtk_clipboard_get(*selection), text, -1);
|
||||
|
||||
char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
|
||||
char* escaped_text = g_markup_printf_escaped(
|
||||
_("Copied selected text to clipboard: %s"), stripped_text);
|
||||
g_free(stripped_text);
|
||||
bool notification = true;
|
||||
girara_setting_get(zathura->ui.session, "selection-notification", ¬ification);
|
||||
|
||||
girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_text);
|
||||
g_free(escaped_text);
|
||||
if (notification == true) {
|
||||
char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
|
||||
char* escaped_text = g_markup_printf_escaped(
|
||||
_("Copied selected text to clipboard: %s"), stripped_text);
|
||||
g_free(stripped_text);
|
||||
|
||||
girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_text);
|
||||
g_free(escaped_text);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
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);
|
||||
bool_value = true;
|
||||
girara_setting_add(gsession, "selection-notification", &bool_value, BOOLEAN, false, _("Enable notification after selecting text"), NULL, NULL);
|
||||
|
||||
#define DEFAULT_SHORTCUTS(mode) \
|
||||
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.
|
||||
|
||||
* Value type: Boolean
|
||||
* Default value: False
|
||||
* Default value: false
|
||||
|
||||
zoom-max
|
||||
^^^^^^^^
|
||||
|
@ -880,6 +880,13 @@ middle mouse button, or the Shift-Insert key combination.
|
|||
* Value type: String
|
||||
* Default value: primary
|
||||
|
||||
selection-notification
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Defines if a notification should be displayed after selecting text.
|
||||
|
||||
* Value type: Boolean
|
||||
* Default value: true
|
||||
|
||||
synctex
|
||||
^^^^^^^
|
||||
En/Disables SyncTeX backward synchronization support.
|
||||
|
|
Loading…
Reference in a new issue