1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-26 18:21:04 +00:00

Add chat console scrollbar (#15104)

This commit is contained in:
chmodsayshello 2025-01-12 14:49:01 +01:00 committed by GitHub
parent d15214af52
commit d4a6df3389
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 65 additions and 16 deletions

View file

@ -8,8 +8,10 @@
#include "modalMenu.h"
#include "chat.h"
#include "config.h"
#include "irr_ptr.h"
class Client;
class GUIScrollBar;
class GUIChatConsole : public gui::IGUIElement
{
@ -20,7 +22,6 @@ public:
ChatBackend* backend,
Client* client,
IMenuManager* menumgr);
virtual ~GUIChatConsole();
// Open the console (height = desired fraction of screen size)
// This doesn't open immediately but initiates an animation.
@ -76,10 +77,13 @@ private:
// If the selected text changed, we need to update the (X11) primary selection.
void updatePrimarySelection();
void updateScrollbar(bool update_size = false);
private:
ChatBackend* m_chat_backend;
Client* m_client;
IMenuManager* m_menumgr;
irr_ptr<GUIScrollBar> m_scrollbar;
// current screen size
v2u32 m_screensize;
@ -116,7 +120,7 @@ private:
video::SColor m_background_color = video::SColor(255, 0, 0, 0);
// font
gui::IGUIFont *m_font = nullptr;
irr_ptr<gui::IGUIFont> m_font;
v2u32 m_fontsize;
// Enable clickable chat weblinks