mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-24 10:22:26 -04:00
Fix the root cause of a long-standing error that caused "Start new period decodes at top" to stop working properly after some time, as a replacement for the previous workaround.
(cherry picked from commit d9af0541487c3bf982fe895ca511265ddee6f865)
This commit is contained in:
parent
343c339de0
commit
aab90a94e4
@ -213,25 +213,8 @@ void DisplayText::insertText(QString const& text, QColor bg, QColor fg
|
|||||||
|
|
||||||
void DisplayText::extend_vertical_scrollbar (int min, int max)
|
void DisplayText::extend_vertical_scrollbar (int min, int max)
|
||||||
{
|
{
|
||||||
static int mod_last;
|
|
||||||
static int height;
|
|
||||||
if (high_volume_ && m_config && m_config->decodes_from_top ())
|
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_)
|
if (max && max != modified_vertical_scrollbar_max_)
|
||||||
{
|
{
|
||||||
setViewportMargins (0,4,0,0); // ensure first line is readable
|
setViewportMargins (0,4,0,0); // ensure first line is readable
|
||||||
@ -247,6 +230,10 @@ void DisplayText::extend_vertical_scrollbar (int min, int max)
|
|||||||
|
|
||||||
void DisplayText::new_period ()
|
void DisplayText::new_period ()
|
||||||
{
|
{
|
||||||
|
if (m_config->decodes_from_top ()) {
|
||||||
|
document ()->setMaximumBlockCount (4800);
|
||||||
|
document ()->setMaximumBlockCount (5000);
|
||||||
|
}
|
||||||
extend_vertical_scrollbar (verticalScrollBar ()->minimum (), verticalScrollBar ()->maximum ());
|
extend_vertical_scrollbar (verticalScrollBar ()->minimum (), verticalScrollBar ()->maximum ());
|
||||||
if (high_volume_ && m_config && m_config->decodes_from_top () && !vertical_scroll_connection_)
|
if (high_volume_ && m_config && m_config->decodes_from_top () && !vertical_scroll_connection_)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user