summaryrefslogtreecommitdiff
path: root/src/gui/widgets/chattab.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-09 14:40:35 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-09 17:14:25 +0100
commita97602889753f596e9738104bc0f9b6ab424f7a7 (patch)
tree31008b27c0e73fc362848b3b66af673cc6721c68 /src/gui/widgets/chattab.cpp
parentb5e416f8cd52f69ff1edd832ee10bac550544ef6 (diff)
downloadmana-a97602889753f596e9738104bc0f9b6ab424f7a7.tar.gz
mana-a97602889753f596e9738104bc0f9b6ab424f7a7.tar.bz2
mana-a97602889753f596e9738104bc0f9b6ab424f7a7.tar.xz
mana-a97602889753f596e9738104bc0f9b6ab424f7a7.zip
Optimized BrowserBox
* Introduced a LayoutContext that conveniently allows for relayouting all rows, or just a single one when it is added. BrowserBox::addRow no longer relayouts all the rows. * BrowserLink and LinePart are now merged into a new TextRow struct, so they can be conveniently dropped when the row limit has been reached. * Removed "opaque" option, which was enabled by default but disabled for all BrowserBox instances. * Removed "always update" option, and instead start delaying relayouting automatically when there are a lot of rows (> 100 currently). * Update window now also has text wrapping enabled. Closes #50
Diffstat (limited to 'src/gui/widgets/chattab.cpp')
-rw-r--r--src/gui/widgets/chattab.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 1979ecbd..6687198e 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -49,15 +49,13 @@
#define MAX_WORD_SIZE 50
-ChatTab::ChatTab(const std::string &name) : Tab()
+ChatTab::ChatTab(const std::string &name)
{
setCaption(name);
mTextOutput = new BrowserBox(BrowserBox::AUTO_WRAP);
- mTextOutput->setOpaque(false);
- mTextOutput->setMaxRow((int) config.getIntValue("ChatLogLength"));
+ mTextOutput->setMaxRows((int) config.getIntValue("ChatLogLength"));
mTextOutput->setLinkHandler(chatWindow->mItemLinkHandler);
- mTextOutput->setAlwaysUpdate(false);
mScrollArea = new ScrollArea(mTextOutput);
mScrollArea->setScrollPolicy(gcn::ScrollArea::SHOW_NEVER,