replace accelerator for activate_default

presentation
Mark Roman Miller 6 years ago
parent 6726c65db1
commit 397ba4d4ed
  1. 6
      src/gui/dialog/GotoDialog.cpp
  2. 20
      ui/goto.glade

@ -16,10 +16,12 @@ auto GotoDialog::getSelectedPage() const -> int
void GotoDialog::show(GtkWindow* parent) void GotoDialog::show(GtkWindow* parent)
{ {
gtk_window_set_transient_for(GTK_WINDOW(this->window), 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)); 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"))); this->selectedPage = gtk_spin_button_get_value(GTK_SPIN_BUTTON(get("spinPage")));
} }

@ -13,7 +13,6 @@
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="title" translatable="yes">Go to Page</property> <property name="title" translatable="yes">Go to Page</property>
<property name="resizable">False</property> <property name="resizable">False</property>
<property name="modal">True</property>
<property name="destroy_with_parent">True</property> <property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<child> <child>
@ -32,12 +31,12 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child> <child>
<object class="GtkButton" id="button1"> <object class="GtkButton" id="gotocancelbutton">
<property name="label">gtk-close</property> <property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property> <property name="name">gotocancelbutton</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
<packing> <packing>
@ -47,14 +46,15 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="button2"> <object class="GtkButton" id="gotookbutton">
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="use_action_appearance">False</property> <property name="name">gotookbutton</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<accelerator key="Return" signal="activate"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -114,8 +114,8 @@
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="1">button1</action-widget> <action-widget response="-6">gotocancelbutton</action-widget>
<action-widget response="2">button2</action-widget> <action-widget response="-5">gotookbutton</action-widget>
</action-widgets> </action-widgets>
</object> </object>
</interface> </interface>

Loading…
Cancel
Save