From 9519d57017cfa28eb4f2fbf3c780f826017bbb00 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Mon, 26 Nov 2018 21:55:24 +0000 Subject: Make non-formspec modal menus respect gui scale (#7850) --- src/gui/modalMenu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gui/modalMenu.cpp') diff --git a/src/gui/modalMenu.cpp b/src/gui/modalMenu.cpp index d8df2540c..4ffe88800 100644 --- a/src/gui/modalMenu.cpp +++ b/src/gui/modalMenu.cpp @@ -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); -- cgit v1.2.3