Show speaking waves for locally muted radio members
This commit is contained in:
1 parent
61818572cc
commit
d5174262d8
3 files changed
+16
-8
No files matched your search
@@ -23,7 +23,7 @@ static QRect radioMuteButtonRect(const QRect& row) {
|
||||
return QRect(row.right() - 63, row.center().y() - 14, 28, 28);
|
||||
}
|
||||
|
||||
// Волны показывают передачу, красное перечёркивание имеет приоритет при локальном mute.
|
||||
// Волны показывают передачу независимо от локального mute; перечёркивание сохраняется при речи.
|
||||
static void drawRadioMuteButton(QPainter* painter, const QRect& button, bool muted, bool speaking) {
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing);
|
||||
@@ -35,7 +35,7 @@ static void drawRadioMuteButton(QPainter* painter, const QRect& button, bool mut
|
||||
painter->fillPath(speaker, color);
|
||||
painter->setPen(QPen(color, 1.8, Qt::SolidLine, Qt::RoundCap)); painter->setBrush(Qt::NoBrush);
|
||||
if (muted) painter->drawLine(QPointF(-10, 10), QPointF(10, -10));
|
||||
else if (speaking) {
|
||||
if (speaking) {
|
||||
painter->drawArc(QRectF(-3, -5, 10, 10), -60 * 16, 120 * 16);
|
||||
painter->drawArc(QRectF(-6, -8, 16, 16), -60 * 16, 120 * 16);
|
||||
}
|
||||
@@ -176,7 +176,8 @@ bool AccountDelegate::helpEvent(QHelpEvent* event, QAbstractItemView* view, cons
|
||||
if (event && radioMuteButtonRect(option.rect).contains(event->pos())) {
|
||||
const bool muted = index.data(Qt::UserRole + 3).toInt() & CHAT_MEMBER_FLAG_RADIO_MUTED;
|
||||
const bool speaking = index.data(MemberListModel::RadioSpeakingRole).toBool();
|
||||
QString text = QCoreApplication::translate("ChatGui", muted ? "Radio: muted" : speaking ? "Radio: speaking" : "Radio: silent");
|
||||
QString text = QCoreApplication::translate("ChatGui", speaking ? "Radio: speaking" : "Radio: silent");
|
||||
if (muted) text += " · " + QCoreApplication::translate("ChatGui", "Radio: muted");
|
||||
if (!index.data(Qt::UserRole + 2).toBool()) text += '\n' + QCoreApplication::translate("ChatGui",
|
||||
muted ? "Listen to this member in radio" : "Mute this member in radio");
|
||||
QToolTip::showText(event->globalPos(), text, view);
|
||||
|
||||
Reference in new issue
Block a user