mirror of
https://github.com/jtheoof/swappy.git
synced 2024-08-16 10:10:30 +03:00
feat(swappy): copy to clipboard with CTRL+C
This commit is contained in:
parent
e946b241bf
commit
b90500ed34
@ -208,6 +208,8 @@ static void keypress_handler(GtkWidget *widget, GdkEventKey *event,
|
||||
switch_mode_to_arrow(state);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(state->popover->arrow),
|
||||
true);
|
||||
} else if (event->keyval == GDK_KEY_c && event->state & GDK_CONTROL_MASK) {
|
||||
clipboard_copy_drawing_area_to_selection(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "clipboard.h"
|
||||
|
||||
#include "notification.h"
|
||||
|
||||
bool clipboard_copy_drawing_area_to_selection(struct swappy_state *state) {
|
||||
g_debug("generating pixbuf from area");
|
||||
GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
|
||||
@ -10,5 +12,9 @@ bool clipboard_copy_drawing_area_to_selection(struct swappy_state *state) {
|
||||
|
||||
gtk_clipboard_set_image(clipboard, pixbuf);
|
||||
|
||||
char message[MAX_PATH];
|
||||
snprintf(message, MAX_PATH, "Swappshot copied to clipboard\n");
|
||||
notification_send("Swappy", message);
|
||||
|
||||
return true;
|
||||
}
|
Loading…
Reference in New Issue
Block a user