mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-31 05:02:26 -04:00
Another try at getting yellow highlighting correct in Active Stations window.
This commit is contained in:
parent
9545c8eaa2
commit
4e935e01f3
@ -93,18 +93,27 @@ void ActiveStations::displayRecentStations(QString mode, QString const& t)
|
|||||||
m_clickOK=false;
|
m_clickOK=false;
|
||||||
ui->RecentStationsPlainTextEdit->setPlainText(t);
|
ui->RecentStationsPlainTextEdit->setPlainText(t);
|
||||||
|
|
||||||
//Yellow background for Q65-30x decodes:
|
//White background for Q65-60x decodes, yellow for Q65-30x:
|
||||||
int istart=0;
|
int i0=0;
|
||||||
while(istart<t.length()) {
|
int i1=0;
|
||||||
int npos=t.indexOf(QRegularExpression(" 30[ABCD] "), istart);
|
int npos=0;
|
||||||
if(npos<0) break;
|
int nlines=t.count("\n");
|
||||||
QTextCursor cursor=ui->RecentStationsPlainTextEdit->textCursor();
|
QTextCursor cursor=ui->RecentStationsPlainTextEdit->textCursor();
|
||||||
cursor.setPosition(npos);
|
QTextCharFormat fmt;
|
||||||
cursor.select(QTextCursor::LineUnderCursor);
|
for(int i=0; i<nlines; i++) {
|
||||||
QTextCharFormat fmt;
|
i1=t.indexOf("\n",i0);
|
||||||
fmt.setBackground(QBrush(Qt::yellow));
|
npos=t.indexOf(QRegularExpression(" 30[ABCD] "), i0);
|
||||||
|
if(npos>0) {
|
||||||
|
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);
|
cursor.setCharFormat(fmt);
|
||||||
istart=npos+10;
|
i0=i1+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_clickOK=bClickOK;
|
m_clickOK=bClickOK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user