From bd88cc755d7b3d8f41d7caf8efb99dc88dc34aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Moreno?= Date: Mon, 6 Nov 2017 09:24:23 +0100 Subject: [PATCH] Focus the ok button in the paste image dialog --- src/app.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 00f359a4..31a23528 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1109,13 +1109,14 @@ impl AppOp { img.set_from_pixbuf(&pb); img.show(); dialog.get_content_area().add(&img); - dialog.show(); + dialog.present(); if let Some(hbar) = dialog.get_header_bar() { let bar = hbar.downcast::().unwrap(); let closebtn = gtk::Button::new_with_label("Cancel"); let okbtn = gtk::Button::new_with_label("Send"); okbtn.get_style_context().unwrap().add_class("suggested-action"); + bar.set_show_close_button(false); bar.pack_start(&closebtn); bar.pack_end(&okbtn); @@ -1135,6 +1136,8 @@ impl AppOp { } d.destroy(); }); + + okbtn.grab_focus(); } } }