Răsfoiți Sursa

tools: grab focus on resource name when the dialog is created

Daniele Bartolini 2 ani în urmă
părinte
comite
d3f3d94d89

+ 7 - 0
tools/level_editor/font_import_dialog.vala

@@ -268,6 +268,13 @@ public class FontImportDialog : Gtk.Dialog
 		this.add_button("OK", Gtk.ResponseType.OK);
 		this.response.connect(on_response);
 		this.destroy.connect(on_destroy);
+		this.map_event.connect(on_map_event);
+	}
+
+	private bool on_map_event(Gdk.EventAny ev)
+	{
+		_font_name.grab_focus();
+		return Gdk.EVENT_PROPAGATE;
 	}
 
 	private void on_response(Gtk.Dialog source, int response_id)

+ 7 - 0
tools/level_editor/sprite_import_dialog.vala

@@ -492,6 +492,13 @@ public class SpriteImportDialog : Gtk.Dialog
 		this.add_button("Cancel", Gtk.ResponseType.CANCEL);
 		this.add_button("OK", Gtk.ResponseType.OK);
 		this.response.connect(on_response);
+		this.map_event.connect(on_map_event);
+	}
+
+	private bool on_map_event(Gdk.EventAny ev)
+	{
+		_unit_name.grab_focus();
+		return Gdk.EVENT_PROPAGATE;
 	}
 
 	private void on_response(Gtk.Dialog source, int response_id)