diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index f60355910..8828fc1df 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -759,10 +759,6 @@ clickable_chat_weblinks (Chat weblinks) bool true # Optional override for chat weblink color. chat_weblink_color (Weblink color) string #8888FF -# Whether or not to display a scrollbar in the chatwindow. -# Recommended for mobile players. -chat_scrollbar (Show chat scrollbar) bool false - # Font size of the recent chat text and chat prompt in point (pt). # Value 0 will use the default font size. chat_font_size (Chat font size) int 0 0 72 diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 4e1b5ae06..f8cfd18b4 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -134,7 +134,6 @@ void set_default_settings() settings->setDefault("occlusion_culler", "bfs"); settings->setDefault("enable_raytraced_culling", "true"); settings->setDefault("chat_weblink_color", "#8888FF"); - settings->setDefault("chat_scrollbar", "true"); // Keymap settings->setDefault("remote_port", "30000"); diff --git a/src/gui/guiChatConsole.cpp b/src/gui/guiChatConsole.cpp index 470216c3b..2235787e9 100644 --- a/src/gui/guiChatConsole.cpp +++ b/src/gui/guiChatConsole.cpp @@ -97,7 +97,6 @@ GUIChatConsole::GUIChatConsole( m_is_ctrl_down = false; m_cache_clickable_chat_weblinks = g_settings->getBool("clickable_chat_weblinks"); - m_scrollbar_enabled = g_settings->getBool("chat_scrollbar"); m_scrollbar = new GUIScrollBar(env, this, -1, core::rect(0, 0, 30, m_height), false, true, tsrc); m_scrollbar->setSubElement(true); m_scrollbar->setLargeStep(1); @@ -235,9 +234,7 @@ void GUIChatConsole::reformatConsole() if (cols <= 0 || rows <= 0) cols = rows = 0; - if (m_scrollbar_enabled) { - m_scrollbar->setRelativePosition(core::rect (m_screensize.X - 32, 0, m_screensize.X, m_height)); - } + m_scrollbar->setRelativePosition(core::rect (m_screensize.X - 32, 0, m_screensize.X, m_height)); recalculateConsolePosition(); m_chat_backend->reformat(cols, rows); @@ -350,7 +347,7 @@ void GUIChatConsole::drawText() core::recti rect; - if (m_scrollbar_enabled && m_scrollbar->isVisible()) + if (m_scrollbar->isVisible()) // leave 4 pixels of space between scrollbar and text rect = core::rect (0, 0, m_screensize.X - 32 - 4, m_height); else @@ -743,7 +740,7 @@ void GUIChatConsole::setVisible(bool visible) m_height = 0; recalculateConsolePosition(); } - m_scrollbar->setVisible(visible && m_scrollbar_enabled); + m_scrollbar->setVisible(visible); } bool GUIChatConsole::weblinkClick(s32 col, s32 row) @@ -818,12 +815,9 @@ void GUIChatConsole::updatePrimarySelection() void GUIChatConsole::updateScrollbar() { - if (!m_scrollbar_enabled) - return; - m_scrollbar->setMin(m_chat_backend->getConsoleBuffer().getTopScrollPos()); m_scrollbar->setMax(m_chat_backend->getConsoleBuffer().getBottomScrollPos()); m_scrollbar->setPos(m_chat_backend->getConsoleBuffer().getScrollPosition()); - m_scrollbar->setVisible(m_scrollbar_enabled && m_scrollbar->getMin() != m_scrollbar->getMax()); + m_scrollbar->setVisible(m_scrollbar->getMin() != m_scrollbar->getMax()); m_scrollbar->setPageSize(m_fontsize.Y * m_chat_backend->getConsoleBuffer().getLineCount()); } \ No newline at end of file diff --git a/src/gui/guiChatConsole.h b/src/gui/guiChatConsole.h index 9a51e9671..d00b1426b 100644 --- a/src/gui/guiChatConsole.h +++ b/src/gui/guiChatConsole.h @@ -142,6 +142,4 @@ private: bool m_cache_clickable_chat_weblinks; // Track if a ctrl key is currently held down bool m_is_ctrl_down; - // Render a scrollbar (mainly for Android) - bool m_scrollbar_enabled; };