1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02: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
16 changed files with 89 additions and 51 deletions

View File

@@ -28,6 +28,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "guiEditBoxWithScrollbar.h"
#include "porting.h"
#ifdef HAVE_TOUCHSCREENGUI
#include "client/renderingengine.h"
#endif
#include "gettext.h"
// Continuing from guiPasswordChange.cpp
@@ -45,7 +49,7 @@ GUIConfirmRegistration::GUIConfirmRegistration(gui::IGUIEnvironment *env,
m_client(client), m_playername(playername), m_password(password),
m_aborted(aborted), m_tsrc(tsrc)
{
#ifdef __ANDROID__
#ifdef HAVE_TOUCHSCREENGUI
m_touchscreen_visible = false;
#endif
}
@@ -73,8 +77,8 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
/*
Calculate new sizes and positions
*/
#ifdef __ANDROID__
const float s = m_gui_scale * porting::getDisplayDensity() / 2;
#ifdef HAVE_TOUCHSCREENGUI
const float s = m_gui_scale * RenderingEngine::getDisplayDensity() / 2;
#else
const float s = m_gui_scale;
#endif