parent
adc89f7977
commit
7c5e3cac6a
|
@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include "client/renderingengine.h"
|
||||||
#include "modalMenu.h"
|
#include "modalMenu.h"
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
#include "porting.h"
|
#include "porting.h"
|
||||||
|
@ -26,7 +27,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREENGUI
|
#ifdef HAVE_TOUCHSCREENGUI
|
||||||
#include "touchscreengui.h"
|
#include "touchscreengui.h"
|
||||||
#include "client/renderingengine.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
@ -41,10 +41,13 @@ GUIModalMenu::GUIModalMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent,
|
||||||
m_remap_dbl_click(remap_dbl_click)
|
m_remap_dbl_click(remap_dbl_click)
|
||||||
{
|
{
|
||||||
m_gui_scale = std::max(g_settings->getFloat("gui_scaling"), 0.5f);
|
m_gui_scale = std::max(g_settings->getFloat("gui_scaling"), 0.5f);
|
||||||
|
const float screen_dpi_scale = RenderingEngine::getDisplayDensity();
|
||||||
#ifdef HAVE_TOUCHSCREENGUI
|
#ifdef HAVE_TOUCHSCREENGUI
|
||||||
float d = RenderingEngine::getDisplayDensity();
|
m_gui_scale *= 1.1f - 0.3f * screen_dpi_scale + 0.2f * screen_dpi_scale * screen_dpi_scale;
|
||||||
m_gui_scale *= 1.1 - 0.3 * d + 0.2 * d * d;
|
#else
|
||||||
|
m_gui_scale *= screen_dpi_scale;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
Environment->setFocus(this);
|
Environment->setFocus(this);
|
||||||
m_menumgr->createdMenu(this);
|
m_menumgr->createdMenu(this);
|
||||||
|
|
Loading…
Reference in New Issue