#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
setTabStop(true);
setTabOrder(-1);
updateAbsolutePosition();
+
+ core::rect<s32> 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<s32>(
+ relative_rect.LowerRightCorner.X-width,relative_rect.UpperLeftCorner.Y,
+ relative_rect.LowerRightCorner.X,relative_rect.LowerRightCorner.Y
+ ));
}
GUITable::~GUITable()
// j is always a column index, 0-based
// k is another index, for example an option index
+ // Handle a stupid error case... (issue #1187)
+ if (columns.empty()) {
+ TableColumn text_column;
+ text_column.type = "text";
+ TableColumns new_columns;
+ new_columns.push_back(text_column);
+ setTable(options, new_columns, content);
+ return;
+ }
+
// Handle table options
video::SColor default_color(255, 255, 255, 255);
s32 opendepth = 0;
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;
}