forked from mumble-voip/mumble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX(a11y): Add semantic description to sliders in Settings
- Loading branch information
Showing
7 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2023-2024 The Mumble Developers. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file at the root of the | ||
// Mumble source tree or at <https://www.mumble.info/LICENSE>. | ||
|
||
#include "SemanticSlider.h" | ||
|
||
SemanticSlider::SemanticSlider(QWidget *parent = nullptr) : QSlider(parent), m_semanticValue("") { | ||
} | ||
|
||
QString SemanticSlider::text(Text t, int child) const { | ||
if (!slider()->isVisible()) { | ||
return QSlider::text(t, child); | ||
} | ||
|
||
if (t == Value && !m_semanticValue.isEmpty()) { | ||
return m_semanticValue; | ||
} | ||
|
||
return QSlider::text(t, child); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2023-2024 The Mumble Developers. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file at the root of the | ||
// Mumble source tree or at <https://www.mumble.info/LICENSE>. | ||
|
||
#ifndef MUMBLE_MUMBLE_WIDGETS_SEMANTICSLIDER_H_ | ||
#define MUMBLE_MUMBLE_WIDGETS_SEMANTICSLIDER_H_ | ||
|
||
#include <QString> | ||
#include <QWidget> | ||
#include <QtWidgets/QSlider> | ||
|
||
class SemanticSlider : public QSlider { | ||
Q_OBJECT | ||
|
||
public: | ||
SemanticSlider(QWidget *parent = nullptr); | ||
QString text(Text t, int child) const; | ||
|
||
QString m_semanticValue; | ||
}; | ||
|
||
#endif |