From 397ba4d4edd74d79dce3010fa30e2c3a334cffdb Mon Sep 17 00:00:00 2001
From: Mark Roman Miller <725mrm@gmail.com>
Date: Wed, 18 Dec 2019 21:06:26 -0600
Subject: [PATCH] replace accelerator for activate_default
---
src/gui/dialog/GotoDialog.cpp | 6 ++++--
ui/goto.glade | 20 ++++++++++----------
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/gui/dialog/GotoDialog.cpp b/src/gui/dialog/GotoDialog.cpp
index 63e5cbce..f9cf5484 100644
--- a/src/gui/dialog/GotoDialog.cpp
+++ b/src/gui/dialog/GotoDialog.cpp
@@ -16,10 +16,12 @@ auto GotoDialog::getSelectedPage() const -> int
void GotoDialog::show(GtkWindow* parent)
{
gtk_window_set_transient_for(GTK_WINDOW(this->window), parent);
+ gtk_entry_set_activates_default(GTK_ENTRY(get("spinPage")), TRUE);
+
int returnCode = gtk_dialog_run(GTK_DIALOG(this->window));
- gtk_widget_hide(this->window);
+ gtk_widget_hide(this->window);
- if (returnCode == 2)
+ if (returnCode == GTK_RESPONSE_OK)
{
this->selectedPage = gtk_spin_button_get_value(GTK_SPIN_BUTTON(get("spinPage")));
}
diff --git a/ui/goto.glade b/ui/goto.glade
index cf990fc3..c7e09b49 100644
--- a/ui/goto.glade
+++ b/ui/goto.glade
@@ -13,7 +13,6 @@
5
Go to Page
False
- True
True
dialog
@@ -32,12 +31,12 @@
False
end
-
-
+
gtk-ok
- False
+ gotookbutton
True
True
+ True
+ True
True
True
-
False
@@ -114,8 +114,8 @@
- button1
- button2
+ gotocancelbutton
+ gotookbutton