Fix rx/tx frequency overlay punctuation and make label background transparent

This commit is contained in:
Bill Somerville 2021-05-08 23:51:16 +01:00
parent 356946d9ab
commit 7b98a0c585
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
2 changed files with 61 additions and 52 deletions

View File

@ -15,8 +15,6 @@ WideGraph::WideGraph(QWidget *parent) :
this->setMaximumHeight(880); this->setMaximumHeight(880);
ui->widePlot->setMaximumHeight(800); ui->widePlot->setMaximumHeight(800);
m_bIQxt=false; m_bIQxt=false;
ui->labFreq->setStyleSheet( \
"QLabel { background-color : black; color : yellow; }");
connect(ui->widePlot, SIGNAL(freezeDecode1(int)),this, connect(ui->widePlot, SIGNAL(freezeDecode1(int)),this,
SLOT(wideFreezeDecode(int))); SLOT(wideFreezeDecode(int)));
@ -60,7 +58,7 @@ void WideGraph::resizeEvent(QResizeEvent* ) //resizeEvent()
if(!size().isValid()) return; if(!size().isValid()) return;
int w = size().width(); int w = size().width();
int h = size().height(); int h = size().height();
ui->labFreq->setGeometry(QRect(w-160,h-100,131,41)); ui->labFreq->setGeometry(QRect(w-256,h-100,227,41));
} }
void WideGraph::saveSettings() void WideGraph::saveSettings()
@ -372,8 +370,10 @@ void WideGraph::tx570()
void WideGraph::updateFreqLabel() void WideGraph::updateFreqLabel()
{ {
auto rxFreq = QString {"%1"}.arg (ui->widePlot->rxFreq (), 10, 'f', 6).insert (7, '.'); auto rxFreq = QString {"%1"}.arg (ui->widePlot->rxFreq (), 10, 'f', 6);
auto txFreq = QString {"%1"}.arg (ui->widePlot->txFreq (), 10, 'f', 6).insert (7, '.'); auto txFreq = QString {"%1"}.arg (ui->widePlot->txFreq (), 10, 'f', 6);
rxFreq.insert (rxFreq.size () - 3, '.');
txFreq.insert (txFreq.size () - 3, '.');
ui->labFreq->setText (QString {"Rx: %1\nTx: %2"}.arg (rxFreq, txFreq)); ui->labFreq->setText (QString {"Rx: %1\nTx: %2"}.arg (rxFreq, txFreq));
} }

View File

@ -14,8 +14,6 @@
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="CPlotter" name="widePlot"> <widget class="CPlotter" name="widePlot">
<property name="enabled"> <property name="enabled">
@ -45,9 +43,9 @@
<widget class="QLabel" name="labFreq"> <widget class="QLabel" name="labFreq">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>1015</x> <x>940</x>
<y>230</y> <y>230</y>
<width>131</width> <width>211</width>
<height>41</height> <height>41</height>
</rect> </rect>
</property> </property>
@ -56,13 +54,24 @@
<pointsize>12</pointsize> <pointsize>12</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet">
<string notr="true">QLabel {
background-color: rgba(0, 0, 0, 0);
color: yellow;
}</string>
</property>
<property name="text"> <property name="text">
<string>Rx: 144.118.200 <string>Rx: 144.118.200
Tx: 144.127.317</string> Tx: 144.127.317</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>