mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-08-18 13:42:30 -04:00
Fix several color highlighting anomalies.
This commit is contained in:
parent
201b29993c
commit
3718f8d3aa
@ -165,7 +165,6 @@ QString DisplayText::appendWorkedB4(QString message, QString const& callsign, QS
|
|||||||
bool gridB4;
|
bool gridB4;
|
||||||
bool gridB4onBand;
|
bool gridB4onBand;
|
||||||
|
|
||||||
|
|
||||||
if(call.length()==2) {
|
if(call.length()==2) {
|
||||||
int i0=message.indexOf("CQ "+call);
|
int i0=message.indexOf("CQ "+call);
|
||||||
call=message.mid(i0+6,-1);
|
call=message.mid(i0+6,-1);
|
||||||
@ -175,9 +174,14 @@ QString DisplayText::appendWorkedB4(QString message, QString const& callsign, QS
|
|||||||
if(call.length()<3) return message;
|
if(call.length()<3) return message;
|
||||||
if(!call.contains(QRegExp("[0-9]|[A-Z]"))) return message;
|
if(!call.contains(QRegExp("[0-9]|[A-Z]"))) return message;
|
||||||
|
|
||||||
|
if(grid=="") {
|
||||||
|
gridB4=true;
|
||||||
|
gridB4onBand=true;
|
||||||
|
} else {
|
||||||
logBook.match(/*in*/call,grid,/*out*/countryName,callWorkedBefore,countryWorkedBefore,gridB4);
|
logBook.match(/*in*/call,grid,/*out*/countryName,callWorkedBefore,countryWorkedBefore,gridB4);
|
||||||
logBook.match(/*in*/call,grid,/*out*/countryName,callB4onBand,countryB4onBand,gridB4onBand,
|
logBook.match(/*in*/call,grid,/*out*/countryName,callB4onBand,countryB4onBand,gridB4onBand,
|
||||||
/*in*/ currentBand);
|
/*in*/ currentBand);
|
||||||
|
}
|
||||||
|
|
||||||
message = message.trimmed ();
|
message = message.trimmed ();
|
||||||
QString appendage{""};
|
QString appendage{""};
|
||||||
@ -269,11 +273,13 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
|
|||||||
bg = m_color_CQ;
|
bg = m_color_CQ;
|
||||||
}
|
}
|
||||||
if(bCQonly and !CQcall) return;
|
if(bCQonly and !CQcall) return;
|
||||||
if (myCall != "" and (
|
if (myCall != "" and (decodedText.indexOf (" " + myCall + " ") >= 0
|
||||||
decodedText.indexOf (" " + myCall + " ") >= 0
|
|
||||||
or decodedText.indexOf (" " + myCall + "/") >= 0
|
or decodedText.indexOf (" " + myCall + "/") >= 0
|
||||||
|
or decodedText.indexOf ("<" + myCall + "/") >= 0
|
||||||
or decodedText.indexOf ("/" + myCall + " ") >= 0
|
or decodedText.indexOf ("/" + myCall + " ") >= 0
|
||||||
|
or decodedText.indexOf ("/" + myCall + ">") >= 0
|
||||||
or decodedText.indexOf ("<" + myCall + " ") >= 0
|
or decodedText.indexOf ("<" + myCall + " ") >= 0
|
||||||
|
or decodedText.indexOf ("<" + myCall + ">") >= 0
|
||||||
or decodedText.indexOf (" " + myCall + ">") >= 0)) {
|
or decodedText.indexOf (" " + myCall + ">") >= 0)) {
|
||||||
bg = m_color_MyCall;
|
bg = m_color_MyCall;
|
||||||
}
|
}
|
||||||
@ -367,7 +373,8 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayText::highlight_callsign (QString const& callsign, QColor const& bg, QColor const& fg, bool last_only)
|
void DisplayText::highlight_callsign (QString const& callsign, QColor const& bg,
|
||||||
|
QColor const& fg, bool last_only)
|
||||||
{
|
{
|
||||||
QTextCharFormat old_format {currentCharFormat ()};
|
QTextCharFormat old_format {currentCharFormat ()};
|
||||||
QTextCursor cursor {document ()};
|
QTextCursor cursor {document ()};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user