diff options
| author | Christoph Berg <myon@debian.org> | 2023-01-08 21:38:57 +0100 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2023-01-08 21:38:57 +0100 |
| commit | feb1845d2d46452ef74746657a6f89845b1b7ac9 (patch) | |
| tree | 5d1ff0ae92c5bd7c984a727b26116f6b6564f75a /widgets/displaytext.cpp | |
| parent | 4bbf5124f399f0b7c2f9f95def8a6ff9dc22315e (diff) | |
| parent | 1a98fb3da0d436b86c887261b39f77bfd3911fd5 (diff) | |
Update upstream source from tag 'upstream/2.6.0+repack'
Update to upstream version '2.6.0+repack'
with Debian dir 52967dc66c3025ae0e5ce99989c650a8d2a8ebac
Diffstat (limited to 'widgets/displaytext.cpp')
| -rwxr-xr-x | widgets/displaytext.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index 2a75c2da..c34c0058 100755 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -19,6 +19,7 @@ #include "Network/LotWUsers.hpp"
#include "models/DecodeHighlightingModel.hpp"
#include "logbook/logbook.h"
+#include "Logger.hpp"
#include "qt_helpers.hpp"
#include "moc_displaytext.cpp"
@@ -212,9 +213,25 @@ void DisplayText::insertText(QString const& text, QColor bg, QColor fg void DisplayText::extend_vertical_scrollbar (int min, int max)
{
- if (high_volume_
- && m_config && m_config->decodes_from_top ())
+ static int mod_last;
+ static int height;
+ if (high_volume_ && m_config && m_config->decodes_from_top ())
{
+ auto m = modified_vertical_scrollbar_max_;
+ if (m != mod_last) { height = m - mod_last;mod_last = m; }
+ //auto vp_margins2 = viewportMargins ();
+ if (height == 0 && m > viewport()->height()) height = abs( - viewport()->height());
+ //LOG_INFO ("scrollbar min=" << min << " max=" << max << " mod=" << modified_vertical_scrollbar_max_ << " height=" << viewport()->height() << " top=" << vp_margins2.top() << " bottom=" << vp_margins2.bottom()) << " height=" << height << " mod_last=" << mod_last;
+ if (max > 60000)
+ {
+ QString tmp = toPlainText();
+ while (tmp != NULL && tmp.length() > 100 && max > 50000)
+ {
+ tmp.remove(0, tmp.indexOf("\n")+1);
+ max -= height;
+ }
+ setPlainText(tmp);
+ }
if (max && max != modified_vertical_scrollbar_max_)
{
auto vp_margins = viewportMargins ();
|
