Skip to content

Commit df188f3

Browse files
committed
Bandmap: Reducing the space required in the bandmap
1 parent 20d65d5 commit df188f3

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

ui/BandmapWidget.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void BandmapWidget::update()
140140

141141
int steps = static_cast<int>(round((currentBand.end - currentBand.start) / step));
142142

143-
ui->graphicsView->setFixedSize(330, steps * PIXELSPERSTEP + 30);
143+
ui->graphicsView->setFixedSize(270, steps * PIXELSPERSTEP + 30);
144144

145145
/****************/
146146
/* Draw bandmap */
@@ -163,13 +163,13 @@ void BandmapWidget::update()
163163
if (i % 5 == 0)
164164
{
165165
QGraphicsTextItem* text = bandmapScene->addText(QString::number(plottedFreq, 'f', digits));
166-
text->setPos(- (text->boundingRect().width()) - 10,
166+
text->setPos(- (text->boundingRect().width()) - 5,
167167
i * PIXELSPERSTEP - (text->boundingRect().height() / 2));
168168
}
169169
}
170170

171171
const QString &endFreqDigits= QString::number(currentBand.end + step*steps, 'f', digits);
172-
bandmapScene->setSceneRect(160 - (endFreqDigits.size() * PIXELSPERSTEP),
172+
bandmapScene->setSceneRect(135 - (endFreqDigits.size() * PIXELSPERSTEP),
173173
0,
174174
0,
175175
steps * PIXELSPERSTEP + 10);

ui/BandmapWidget.ui

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>451</width>
9+
<width>283</width>
1010
<height>662</height>
1111
</rect>
1212
</property>
@@ -77,12 +77,18 @@
7777
<item>
7878
<widget class="QLabel" name="clearSpotOlderLabel">
7979
<property name="text">
80-
<string>Clear older than</string>
80+
<string>Clear older</string>
8181
</property>
8282
</widget>
8383
</item>
8484
<item>
8585
<widget class="QSpinBox" name="clearSpotOlderSpin">
86+
<property name="sizePolicy">
87+
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
88+
<horstretch>0</horstretch>
89+
<verstretch>0</verstretch>
90+
</sizepolicy>
91+
</property>
8692
<property name="focusPolicy">
8793
<enum>Qt::ClickFocus</enum>
8894
</property>
@@ -135,7 +141,7 @@
135141
<rect>
136142
<x>0</x>
137143
<y>0</y>
138-
<width>451</width>
144+
<width>283</width>
139145
<height>591</height>
140146
</rect>
141147
</property>

0 commit comments

Comments
 (0)