mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-10-31 07:25:22 +01:00 
			
		
		
		
	Android: Add field_enter_after_edit[] formspec element (#13836)
				
					
				
			This commit is contained in:
		| @@ -833,7 +833,7 @@ function store.get_formspec(dlgdata) | ||||
|  | ||||
| 		"container[0.375,0.375]", | ||||
| 		"field[0,0;7.225,0.8;search_string;;", core.formspec_escape(search_string), "]", | ||||
| 		"field_close_on_enter[search_string;false]", | ||||
| 		"field_enter_after_edit[search_string;true]", | ||||
| 		"image_button[7.3,0;0.8,0.8;", core.formspec_escape(defaulttexturedir .. "search.png"), ";search;]", | ||||
| 		"image_button[8.125,0;0.8,0.8;", core.formspec_escape(defaulttexturedir .. "clear.png"), ";clear;]", | ||||
| 		"dropdown[9.175,0;2.7875,0.8;type;", table.concat(filter_types_titles, ","), ";", filter_type, "]", | ||||
|   | ||||
| @@ -84,6 +84,7 @@ local function make_field(converter, validator, stringifier) | ||||
|  | ||||
| 				local fs = ("field[0,0.3;%f,0.8;%s;%s;%s]"):format( | ||||
| 					avail_w - 1.5, setting.name, get_label(setting), core.formspec_escape(value)) | ||||
| 				fs = fs .. ("field_enter_after_edit[%s;true]"):format(setting.name) | ||||
| 				fs = fs .. ("button[%f,0.3;1.5,0.8;%s;%s]"):format(avail_w - 1.5, "set_" .. setting.name, fgettext("Set")) | ||||
|  | ||||
| 				return fs, 1.1 | ||||
|   | ||||
| @@ -477,6 +477,7 @@ local function get_formspec(dialogdata) | ||||
|  | ||||
| 		"field[0.25,0.25;", tostring(search_width), ",0.75;search_query;;", | ||||
| 			core.formspec_escape(dialogdata.query or ""), "]", | ||||
| 		"field_enter_after_edit[search_query;true]", | ||||
| 		"container[", tostring(search_width + 0.25), ", 0.25]", | ||||
| 			"image_button[0,0;0.75,0.75;", core.formspec_escape(defaulttexturedir .. "search.png"), ";search;]", | ||||
| 			"image_button[0.75,0;0.75,0.75;", core.formspec_escape(defaulttexturedir .. "clear.png"), ";search_clear;]", | ||||
|   | ||||
| @@ -67,6 +67,7 @@ local function get_formspec(tabview, name, tabdata) | ||||
| 	local retval = | ||||
| 		-- Search | ||||
| 		"field[0.25,0.25;7,0.75;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" .. | ||||
| 		"field_enter_after_edit[te_search;true]" .. | ||||
| 		"container[7.25,0.25]" .. | ||||
| 		"image_button[0,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "search.png") .. ";btn_mp_search;]" .. | ||||
| 		"image_button[0.75,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "clear.png") .. ";btn_mp_clear;]" .. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user