1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

feat(audio): Adding shortut SHIFT+` (~ tilde) for muting mic.

This commit is contained in:
fancyfarmer 2022-07-04 22:44:15 +02:00 committed by Anthony Bilinski
parent a6d15140b1
commit 3ecf2e03c4
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
2 changed files with 14 additions and 0 deletions

View File

@ -58,6 +58,7 @@
#include <QScrollBar>
#include <QSplitter>
#include <QStringBuilder>
#include <QShortcut>
#include <cassert>
@ -221,6 +222,9 @@ ChatForm::ChatForm(Profile& profile_, Friend* chatFriend, IChatLog& chatLog_,
setAcceptDrops(true);
retranslateUi();
Translator::registerHandler(std::bind(&ChatForm::retranslateUi, this), this);
// shortcut for mute (SHIFT+ `), (SHIFT + grave accent, gives tilde)
new QShortcut(Qt::SHIFT | 0x60, this, SLOT(onMicMuteShortcutToggle()));
}
ChatForm::~ChatForm()
@ -458,6 +462,15 @@ void ChatForm::onMicMuteToggle()
updateMuteMicButton();
}
void ChatForm::onMicMuteShortcutToggle()
{
CoreAV* av = core.getAv();
if (av->isCallActive(f))
{
onMicMuteToggle();
}
}
void ChatForm::onVolMuteToggle()
{
CoreAV* av = core.getAv();

View File

@ -102,6 +102,7 @@ private slots:
void onAnswerCallTriggered(bool video);
void onRejectCallTriggered();
void onMicMuteToggle();
void onMicMuteShortcutToggle();
void onVolMuteToggle();
void onFriendStatusChanged(const ToxPk& friendPk, Status::Status status);