1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Touch UI support for desktop builds (#10729)

This commit is contained in:
TheBrokenRail 2021-09-26 12:04:09 -04:00 committed by GitHub
parent 9f85862b7c
commit 3dcf9e963e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 89 additions and 51 deletions

View file

@ -308,7 +308,7 @@ void GUIFormSpecMenu::parseSize(parserData* data, const std::string &element)
data->invsize.Y = MYMAX(0, stof(parts[1]));
lockSize(false);
#ifndef __ANDROID__
#ifndef HAVE_TOUCHSCREENGUI
if (parts.size() == 3) {
if (parts[2] == "true") {
lockSize(true,v2u32(800,600));
@ -3278,7 +3278,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
((15.0 / 13.0) * (0.85 + mydata.invsize.Y));
}
#ifdef __ANDROID__
#ifdef HAVE_TOUCHSCREENGUI
// In Android, the preferred imgsize should be larger to accommodate the
// smaller screensize.
double prefer_imgsize = padded_screensize.Y / 10 * gui_scaling;
@ -3741,7 +3741,7 @@ void GUIFormSpecMenu::showTooltip(const std::wstring &text,
v2u32 screenSize = Environment->getVideoDriver()->getScreenSize();
int tooltip_offset_x = m_btn_height;
int tooltip_offset_y = m_btn_height;
#ifdef __ANDROID__
#ifdef HAVE_TOUCHSCREENGUI
tooltip_offset_x *= 3;
tooltip_offset_y = 0;
if (m_pointer.X > (s32)screenSize.X / 2)