diff --git a/src/mumble/VolumeSliderWidgetAction.cpp b/src/mumble/VolumeSliderWidgetAction.cpp index 7553ae68b9f..c9c485319e5 100644 --- a/src/mumble/VolumeSliderWidgetAction.cpp +++ b/src/mumble/VolumeSliderWidgetAction.cpp @@ -4,15 +4,15 @@ // Mumble source tree or at . #include "VolumeSliderWidgetAction.h" +#include "Accessibility.h" #include "InlineWidgets.h" #include "VolumeAdjustment.h" #include "widgets/EventFilters.h" -#include #include VolumeSliderWidgetAction::VolumeSliderWidgetAction(QWidget *parent) - : QWidgetAction(parent), m_volumeSlider(make_qt_unique< QSlider >(Qt::Horizontal, parent)) { + : QWidgetAction(parent), m_volumeSlider(make_qt_unique< SemanticSlider >(parent)) { m_volumeSlider->setMinimum(-30); m_volumeSlider->setMaximum(30); m_volumeSlider->setAccessibleName(tr("Slider for volume adjustment")); @@ -33,9 +33,9 @@ VolumeSliderWidgetAction::VolumeSliderWidgetAction(QWidget *parent) new MouseWheelEventObserver(this, { Qt::ScrollMomentum, Qt::ScrollUpdate, Qt::ScrollEnd }, false); m_volumeSlider->installEventFilter(wheelEventFilter); - connect(m_volumeSlider.get(), &QSlider::valueChanged, this, + connect(m_volumeSlider.get(), &SemanticSlider::valueChanged, this, &VolumeSliderWidgetAction::on_VolumeSlider_valueChanged); - connect(m_volumeSlider.get(), &QSlider::sliderReleased, this, + connect(m_volumeSlider.get(), &SemanticSlider::sliderReleased, this, &VolumeSliderWidgetAction::on_VolumeSlider_changeCompleted); connect(keyEventFilter, &KeyEventObserver::keyEventObserved, this, &VolumeSliderWidgetAction::on_VolumeSlider_changeCompleted); @@ -54,6 +54,8 @@ void VolumeSliderWidgetAction::updateSliderValue(float value) { int dbShift = VolumeAdjustment::toIntegerDBAdjustment(value); m_volumeSlider->setValue(dbShift); updateTooltip(dbShift); + + Mumble::Accessibility::setSliderSemanticValue(m_volumeSlider.get(), QString("%1 %2").arg(dbShift).arg(tr("decibels"))); } void VolumeSliderWidgetAction::updateTooltip(int value) { diff --git a/src/mumble/VolumeSliderWidgetAction.h b/src/mumble/VolumeSliderWidgetAction.h index 25bb408670f..c43368a7e14 100644 --- a/src/mumble/VolumeSliderWidgetAction.h +++ b/src/mumble/VolumeSliderWidgetAction.h @@ -9,8 +9,9 @@ #include #include "QtUtils.h" +#include "widgets/SemanticSlider.h" -class QSlider; +class SemanticSlider; class VolumeSliderWidgetAction : public QWidgetAction { Q_OBJECT @@ -19,7 +20,7 @@ class VolumeSliderWidgetAction : public QWidgetAction { VolumeSliderWidgetAction(QWidget *parent = nullptr); protected: - qt_unique_ptr< QSlider > m_volumeSlider; + qt_unique_ptr< SemanticSlider > m_volumeSlider; void updateSliderValue(float value); void displayTooltip(int value);