1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

split enable_touch to touch_controls (for touchscreen controls) and touch_gui

touch_gui provide adjustment to the interface, so it's more touch
friendly

Signed-off-by: David Heidelberg <david@ixit.cz>
This commit is contained in:
Gregor Parzefall 2024-06-02 12:58:41 -07:00 committed by grorp
parent 1977517d7a
commit 3a59fabefe
11 changed files with 57 additions and 47 deletions

View file

@ -22,13 +22,13 @@ end
local function get_loading_formspec()
local ENABLE_TOUCH = core.settings:get_bool("enable_touch")
local w = ENABLE_TOUCH and 14 or 7
local TOUCH_GUI = core.settings:get_bool("touch_gui")
local w = TOUCH_GUI and 14 or 7
local formspec = {
"formspec_version[3]",
"size[", w, ",9.05]",
ENABLE_TOUCH and "padding[0.01,0.01]" or "position[0.5,0.55]",
TOUCH_GUI and "padding[0.01,0.01]" or "position[0.5,0.55]",
"label[3,4.525;", fgettext("Loading..."), "]",
}
return table.concat(formspec)
@ -110,18 +110,18 @@ local function get_formspec(data)
message_bg = mt_color_orange
end
local ENABLE_TOUCH = core.settings:get_bool("enable_touch")
local TOUCH_GUI = core.settings:get_bool("touch_gui")
local w = ENABLE_TOUCH and 14 or 7
local w = TOUCH_GUI and 14 or 7
local padded_w = w - 2*0.375
local dropdown_w = ENABLE_TOUCH and 10.2 or 4.25
local dropdown_w = TOUCH_GUI and 10.2 or 4.25
local button_w = (padded_w - 0.25) / 3
local button_pad = button_w / 2
local formspec = {
"formspec_version[3]",
"size[", w, ",9.05]",
ENABLE_TOUCH and "padding[0.01,0.01]" or "position[0.5,0.55]",
TOUCH_GUI and "padding[0.01,0.01]" or "position[0.5,0.55]",
"style[title;border=false]",
"box[0,0;", w, ",0.8;#3333]",
"button[0,0;", w, ",0.8;title;", fgettext("Install $1", package.title) , "]",