Author: cazfi
Date: Tue Oct 27 21:47:24 2015
New Revision: 30252

URL: http://svn.gna.org/viewcvs/freeciv?rev=30252&view=rev
Log:
Accept city name suggestion with Enter in sdl2-client.

See patch #6477

Modified:
    branches/S2_6/client/gui-sdl2/mapctrl.c

Modified: branches/S2_6/client/gui-sdl2/mapctrl.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl2/mapctrl.c?rev=30252&r1=30251&r2=30252&view=diff
==============================================================================
--- branches/S2_6/client/gui-sdl2/mapctrl.c     (original)
+++ branches/S2_6/client/gui-sdl2/mapctrl.c     Tue Oct 27 21:47:24 2015
@@ -2705,11 +2705,13 @@
 /**************************************************************************
   User interacted with the Ok button of the new city dialog.
 **************************************************************************/
-static int newcity_ok_callback(struct widget *pOk_Button)
-{
-  if (Main.event.button.button == SDL_BUTTON_LEFT) {
-
-    finish_city(pOk_Button->data.tile, 
pNewCity_Dlg->pBeginWidgetList->string_utf8->text);
+static int newcity_ok_callback(struct widget *ok_button)
+{
+  if (Main.event.type == SDL_KEYDOWN
+      || (Main.event.type == SDL_MOUSEBUTTONDOWN
+          && Main.event.button.button == SDL_BUTTON_LEFT)) {
+
+    finish_city(ok_button->data.tile, 
pNewCity_Dlg->pBeginWidgetList->string_utf8->text);
 
     popdown_window_group_dialog(pNewCity_Dlg->pBeginWidgetList,
                                 pNewCity_Dlg->pEndWidgetList);
@@ -2798,7 +2800,7 @@
     create_themeicon_button_from_chars(current_theme->Small_OK_Icon, 
pWindow->dst,
                                        _("OK"), adj_font(10), 0);
   pOK_Button->action = newcity_ok_callback;
-  pOK_Button->key = SDLK_RETURN;  
+  pOK_Button->key = SDLK_RETURN;
   pOK_Button->data.tile = unit_tile(pUnit);
 
   area.h += pOK_Button->size.h;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to