mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Make non-formspec modal menus respect gui scale (#7850)
This commit is contained in:
parent
8ba64e43fe
commit
9519d57017
8 changed files with 106 additions and 99 deletions
|
@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "modalMenu.h"
|
||||
#include "gettext.h"
|
||||
#include "porting.h"
|
||||
#include "settings.h"
|
||||
|
||||
#ifdef HAVE_TOUCHSCREENGUI
|
||||
#include "touchscreengui.h"
|
||||
|
@ -37,6 +38,11 @@ GUIModalMenu::GUIModalMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent,
|
|||
#endif
|
||||
m_menumgr(menumgr)
|
||||
{
|
||||
m_gui_scale = g_settings->getFloat("gui_scaling");
|
||||
#ifdef __ANDROID__
|
||||
float d = porting::getDisplayDensity();
|
||||
m_gui_scale *= 1.1 - 0.3 * d + 0.2 * d * d;
|
||||
#endif
|
||||
setVisible(true);
|
||||
Environment->setFocus(this);
|
||||
m_menumgr->createdMenu(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue