From d7f91f06e55e7cc935a037d2e152dc14d282522c Mon Sep 17 00:00:00 2001 From: Ladislav Foldyna Date: Mon, 16 May 2022 08:45:11 +0200 Subject: [PATCH] Fixed #61 - Bandmap Callsign selection - margin --- ui/BandmapWidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/BandmapWidget.cpp b/ui/BandmapWidget.cpp index e4aff2c4..ed805f34 100644 --- a/ui/BandmapWidget.cpp +++ b/ui/BandmapWidget.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "BandmapWidget.h" #include "ui_BandmapWidget.h" @@ -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 * @@ -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));