1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Consistent width for internal scrollbars of formspec elements (#14689)

also: Make sure that very short, wide scrollbars are still usable
This commit is contained in:
grorp 2024-05-24 12:10:19 +02:00 committed by GitHub
parent 6c0b8229ec
commit d5fc040d2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -274,10 +274,10 @@ void GUIScrollBar::setPosRaw(const s32 &pos)
s32 thumb_min = 0;
if (is_horizontal) {
thumb_min = RelativeRect.getHeight();
thumb_min = std::min(RelativeRect.getHeight(), RelativeRect.getWidth() / 2);
thumb_area = RelativeRect.getWidth() - border_size * 2;
} else {
thumb_min = RelativeRect.getWidth();
thumb_min = std::min(RelativeRect.getWidth(), RelativeRect.getHeight() / 2);
thumb_area = RelativeRect.getHeight() - border_size * 2;
}

View file

@ -60,7 +60,7 @@ GUITable::GUITable(gui::IGUIEnvironment *env,
m_rowheight = MYMAX(m_rowheight, 1);
}
const s32 s = skin->getSize(gui::EGDS_SCROLLBAR_SIZE) * 1.5f;
const s32 s = skin->getSize(gui::EGDS_SCROLLBAR_SIZE);
m_scrollbar = new GUIScrollBar(Environment, this, -1,
core::rect<s32>(RelativeRect.getWidth() - s,
0,