Skip to content

Commit

Permalink
Fixed #61 - Bandmap Callsign selection - margin
Browse files Browse the repository at this point in the history
  • Loading branch information
foldynl committed May 16, 2022
1 parent 75c4199 commit d7f91f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/BandmapWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <QGraphicsTextItem>
#include <QMutableMapIterator>
#include <QMenu>
#include <QTextDocument>

#include "BandmapWidget.h"
#include "ui_BandmapWidget.h"
Expand Down Expand Up @@ -168,7 +169,7 @@ void BandmapWidget::updateStations()
for (; lower != upper; lower++)
{
double freq_y = ((lower.key() - band.start) / step) * 10;
double text_y = std::max(min_y, freq_y);
double text_y = std::max(min_y + 5, freq_y);

/*************************
* Draw Line to Callsign *
Expand All @@ -182,13 +183,15 @@ void BandmapWidget::updateStations()
QString callsignTmp = lower.value().callsign;
QString timeTmp = lower.value().time.toString(locale.timeFormat(QLocale::ShortFormat));

QGraphicsTextItem* text = bandmapScene->addText(callsignTmp + " [" + timeTmp +"]");
QGraphicsTextItem* text = bandmapScene->addText(callsignTmp + " @ " + timeTmp);
text->document()->setDocumentMargin(0);
text->setPos(40, text_y - (text->boundingRect().height() / 2));
text->setFlags(QGraphicsItem::ItemIsFocusable |
QGraphicsItem::ItemIsSelectable |
text->flags());
text->setProperty("freq", lower.key());


min_y = text_y + text->boundingRect().height() / 2;

QColor textColor = Data::statusToColor(lower.value().status, qApp->palette().color(QPalette::Text));
Expand Down

0 comments on commit d7f91f0

Please sign in to comment.