1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Use our GUIButton in our GUIScrollBar

Note that GUIScrollBar needs an ISimpleTextureSource now due to button styling.
This commit is contained in:
Desour 2023-08-09 01:08:16 +02:00 committed by sfan5
parent 9d62abbe46
commit 91c0439922
8 changed files with 43 additions and 25 deletions

View file

@ -25,9 +25,10 @@ numerical
//! constructor
GUIEditBoxWithScrollBar::GUIEditBoxWithScrollBar(const wchar_t* text, bool border,
IGUIEnvironment* environment, IGUIElement* parent, s32 id,
const core::rect<s32>& rectangle, bool writable, bool has_vscrollbar)
const core::rect<s32>& rectangle, ISimpleTextureSource *tsrc,
bool writable, bool has_vscrollbar)
: GUIEditBox(environment, parent, id, rectangle, border, writable),
m_background(true), m_bg_color_used(false)
m_background(true), m_bg_color_used(false), m_tsrc(tsrc)
{
#ifdef _DEBUG
setDebugName("GUIEditBoxWithScrollBar");
@ -635,7 +636,7 @@ void GUIEditBoxWithScrollBar::createVScrollBar()
irr::core::rect<s32> scrollbarrect = m_frame_rect;
scrollbarrect.UpperLeftCorner.X += m_frame_rect.getWidth() - m_scrollbar_width;
m_vscrollbar = new GUIScrollBar(Environment, getParent(), -1,
scrollbarrect, false, true);
scrollbarrect, false, true, m_tsrc);
m_vscrollbar->setVisible(false);
m_vscrollbar->setSmallStep(3 * fontHeight);