From 4e935e01f33b7500afec35a9b083179cbea927c3 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 20 Dec 2023 17:22:05 -0500 Subject: [PATCH] Another try at getting yellow highlighting correct in Active Stations window. --- widgets/activeStations.cpp | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/widgets/activeStations.cpp b/widgets/activeStations.cpp index f202c984e..9bfa4f755 100644 --- a/widgets/activeStations.cpp +++ b/widgets/activeStations.cpp @@ -93,18 +93,27 @@ void ActiveStations::displayRecentStations(QString mode, QString const& t) m_clickOK=false; ui->RecentStationsPlainTextEdit->setPlainText(t); -//Yellow background for Q65-30x decodes: - int istart=0; - while(istartRecentStationsPlainTextEdit->textCursor(); - cursor.setPosition(npos); - cursor.select(QTextCursor::LineUnderCursor); - QTextCharFormat fmt; - fmt.setBackground(QBrush(Qt::yellow)); +//White background for Q65-60x decodes, yellow for Q65-30x: + int i0=0; + int i1=0; + int npos=0; + int nlines=t.count("\n"); + QTextCursor cursor=ui->RecentStationsPlainTextEdit->textCursor(); + QTextCharFormat fmt; + for(int i=0; i0) { + cursor.setPosition(npos); + cursor.select(QTextCursor::LineUnderCursor); + fmt.setBackground(QBrush(Qt::yellow)); + } else { + cursor.setPosition(i0+10); + cursor.select(QTextCursor::LineUnderCursor); + fmt.setBackground(QBrush(Qt::white)); + } cursor.setCharFormat(fmt); - istart=npos+10; + i0=i1+1; } m_clickOK=bClickOK;