X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2FguiTable.cpp;h=1543497ab3c5bcb7433b11c71e8b1af22ea151f9;hb=8852333eb3042580592ade478e5def20f8ed5d4c;hp=e2da4eadaab58ba494f98ef2eb54592913f7db6d;hpb=d1ee708db2bd41cf46f5cafc54053e54f47fbac9;p=oweals%2Fminetest.git diff --git a/src/guiTable.cpp b/src/guiTable.cpp index e2da4eada..1543497ab 100644 --- a/src/guiTable.cpp +++ b/src/guiTable.cpp @@ -33,6 +33,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/string.h" #include "util/numeric.h" #include "guiFormSpecMenu.h" // for parseColor() +#include "main.h" +#include "settings.h" // for settings +#include "porting.h" // for dpi /* GUITable @@ -89,6 +92,14 @@ GUITable::GUITable(gui::IGUIEnvironment *env, setTabStop(true); setTabOrder(-1); updateAbsolutePosition(); + + core::rect relative_rect = m_scrollbar->getRelativePosition(); + s32 width = (relative_rect.getWidth()/(2.0/3.0)) * porting::getDisplayDensity() * + g_settings->getFloat("gui_scaling"); + m_scrollbar->setRelativePosition(core::rect( + relative_rect.LowerRightCorner.X-width,relative_rect.UpperLeftCorner.Y, + relative_rect.LowerRightCorner.X,relative_rect.LowerRightCorner.Y + )); } GUITable::~GUITable() @@ -833,7 +844,7 @@ bool GUITable::OnEvent(const SEvent &event) if (event.MouseInput.Event == EMIE_MOUSE_WHEEL) { m_scrollbar->setPos(m_scrollbar->getPos() + - (event.MouseInput.Wheel < 0 ? -1 : 1) * + (event.MouseInput.Wheel < 0 ? -3 : 3) * - (s32) m_rowheight / 2); return true; }