Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/user/static/img/screens/rx-applet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/gui/RxApplet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@
// its own visible squelch state, independent of the Flex cache.
m_sqlSlider->setValue(sqlManualLevel());
m_sqlSlider->setEnabled(m_sqlBtn->isEnabled());
m_sqlSlider->setToolTip(usingExternalReceiveSquelch()

Check warning on line 1448 in src/gui/RxApplet.cpp

View workflow job for this annotation

GitHub Actions / Static checks

a11y-disabled-reason-not-announced

`m_sqlSlider` is disabled and given a tooltip reason, but no accessibleDescription (widget) or statusTip (QAction) nearby in the same block. Put the reason on the accessible channel as well as the tooltip. (#5262 M3a doctrine, #4896)
? QStringLiteral("Kiwi SQL threshold (0-99, mapped to a "
"signed dB offset from the receiver noise "
"floor). Increase to require a stronger "
Expand All @@ -1461,14 +1461,14 @@
autoSqlMarginDb(), 5, 20);
m_sqlSlider->setValue(margin);
m_sqlSlider->setEnabled(m_sqlBtn->isEnabled());
m_sqlSlider->setToolTip(

Check warning on line 1464 in src/gui/RxApplet.cpp

View workflow job for this annotation

GitHub Actions / Static checks

a11y-disabled-reason-not-announced

`m_sqlSlider` is disabled and given a tooltip reason, but no accessibleDescription (widget) or statusTip (QAction) nearby in the same block. Put the reason on the accessible channel as well as the tooltip. (#5262 M3a doctrine, #4896)
"Auto SQL margin (5–20 dB). dB above the measured noise "
"floor where the squelch gate opens.");
break;
}
case SqlMode::Off:
m_sqlSlider->setEnabled(false);
m_sqlSlider->setToolTip(

Check warning on line 1471 in src/gui/RxApplet.cpp

View workflow job for this annotation

GitHub Actions / Static checks

a11y-disabled-reason-not-announced

`m_sqlSlider` is disabled and given a tooltip reason, but no accessibleDescription (widget) or statusTip (QAction) nearby in the same block. Put the reason on the accessible channel as well as the tooltip. (#5262 M3a doctrine, #4896)
"Squelch threshold. Increase to require a stronger signal "
"before audio opens.");
break;
Expand Down Expand Up @@ -2087,7 +2087,7 @@
const QString owner = m_radioModel
? m_radioModel->foreignSliceOwnerStation(slotId)
: QString();
btn->setToolTip(owner.isEmpty()

Check warning on line 2090 in src/gui/RxApplet.cpp

View workflow job for this annotation

GitHub Actions / Static checks

a11y-disabled-reason-not-announced

`btn` is disabled and given a tooltip reason, but no accessibleDescription (widget) or statusTip (QAction) nearby in the same block. Put the reason on the accessible channel as well as the tooltip. (#5262 M3a doctrine, #4896)
? QString("Slot %1 — in use by another client")
.arg(QChar('A' + slotId))
: QString("Slot %1 — in use by %2")
Expand Down Expand Up @@ -2117,7 +2117,7 @@
btn->setChecked(false);
btn->setProperty("sliceId", QVariant());
btn->setProperty("slotState", "empty");
btn->setToolTip(QString("Slot %1 — empty").arg(QChar('A' + colourPos)));

Check warning on line 2120 in src/gui/RxApplet.cpp

View workflow job for this annotation

GitHub Actions / Static checks

a11y-disabled-reason-not-announced

`btn` is disabled and given a tooltip reason, but no accessibleDescription (widget) or statusTip (QAction) nearby in the same block. Put the reason on the accessible channel as well as the tooltip. (#5262 M3a doctrine, #4896)
applyStyleIfChanged(btn, colourIdx, buildButtonStyle(colourIdx));
}
// Force a stylesheet re-evaluation so the slotState property change
Expand Down Expand Up @@ -3548,7 +3548,10 @@
btn->setAccessibleName(QStringLiteral("Receive filter %1")
.arg(preset.label));
}
btn->setStyleSheet(kButtonBase() + kBlueActive());
// Three preset columns must leave room for the 60 px AGC slider
// and Auto button within the dock's 248 px viewport.
btn->setStyleSheet(kButtonBase() + kBlueActive()
+ QStringLiteral("QPushButton { padding: 1px; }"));
connect(btn, &QPushButton::clicked, this,
[this, i, customisable, stablePresets, preset](bool) {
if (!m_slice) {
Expand Down
72 changes: 72 additions & 0 deletions tests/auto_agc_threshold_gui_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,24 @@
#include <QDir>
#include <QEventLoop>
#include <QFile>
#include <QFont>
#include <QFontDatabase>
#include <QFontMetrics>
#include <QImage>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QLabel>
#include <QPointer>
#include <QPoint>
#include <QPalette>
#include <QPushButton>
#include <QRect>
#include <QScopeGuard>
#include <QSlider>
#include <QStyle>
#include <QStyleOptionButton>
#include <QStringList>
#include <QVector>
#include <QtTest>
Expand Down Expand Up @@ -325,6 +333,70 @@ private slots:
"Link THEME_TEST_RESOURCES so screenshots use the production theme resources");
}

void compactLayoutFitsDock_data()
{
QTest::addColumn<QString>("fontFamily");
// DejaVu Sans is the row that needs the compact preset padding (#6641);
// a host without it runs only rows that already fit.
QTest::newRow("system") << QString();
const QStringList families = QFontDatabase::families();
for (const QString& family : {QStringLiteral("DejaVu Sans"),
QStringLiteral("Liberation Sans")}) {
if (families.contains(family)) {
QTest::newRow(qPrintable(family)) << family;
}
}
}

void compactLayoutFitsDock()
{
QFETCH(QString, fontFamily);
const QFont defaultFont = QApplication::font();
const auto restoreFont = qScopeGuard([defaultFont] {
QApplication::setFont(defaultFont);
});
if (!fontFamily.isEmpty()) {
QFont font = defaultFont;
font.setFamily(fontFamily);
QApplication::setFont(font);
}

Fixture fixture;
QVERIFY(fixture.capture(QStringLiteral("compact-layout-")
+ (fontFamily.isEmpty() ? QStringLiteral("system") : fontFamily)));
QCOMPARE(fixture.rx.width(), 248);
QVERIFY(fixture.rx.minimumSizeHint().width() <= 248);
QVERIFY(fixture.threshold());
QVERIFY(fixture.threshold()->width() >= 60);
for (QWidget* widget : fixture.rx.findChildren<QWidget*>()) {
if (widget->isVisibleTo(&fixture.rx) && !widget->isWindow()) {
const QRect bounds(widget->mapTo(&fixture.rx, QPoint()), widget->size());
QVERIFY2(fixture.rx.rect().contains(bounds),
qPrintable(widget->accessibleName().isEmpty()
? QString::fromLatin1(widget->metaObject()->className())
: widget->accessibleName()));
}
}

const QStringList presets{QStringLiteral("1.8K"), QStringLiteral("2.1K"),
QStringLiteral("2.4K"), QStringLiteral("2.7K"),
QStringLiteral("2.9K"), QStringLiteral("3.3K")};
int presetCount = 0;
for (QPushButton* button : fixture.rx.findChildren<QPushButton*>()) {
if (presets.contains(button->text())) {
++presetCount;
QVERIFY(button->isVisibleTo(&fixture.rx));
QStyleOptionButton option;
option.initFrom(button);
const QRect contents = button->style()->subElementRect(
QStyle::SE_PushButtonContents, &option, button);
QVERIFY(button->fontMetrics().horizontalAdvance(button->text())
<= contents.width());
}
}
QCOMPARE(presetCount, 6);
}

void bridgeClickWaitsForConfirmedStatus()
{
Fixture fixture;
Expand Down
Loading