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

fix(chatform): Fixed buttons

This commit is contained in:
Diadlo 2016-08-29 16:48:38 +03:00 committed by Zetok Zalbavar
parent 5381d55e94
commit aff0c6f3a5
No known key found for this signature in database
GPG Key ID: C953D3880212068A
2 changed files with 20 additions and 11 deletions

View File

@ -914,7 +914,6 @@ void ChatForm::updateMuteMicButton()
const CoreAV* av = Core::getInstance()->getAv();
micButton->setEnabled(av->isCallActive(f));
if (micButton->isEnabled())
{
if (av->isCallInputMuted(f))
@ -928,8 +927,15 @@ void ChatForm::updateMuteMicButton()
micButton->setToolTip(tr("Mute microphone"));
}
}
else
{
micButton->setObjectName("");
micButton->setToolTip(tr("Microphone can be muted only during a call"));
}
micButton->setStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/micButton/micButton.css")));
QString stylePath = QStringLiteral(":/ui/micButton/micButton.css");
QString style = Style::getStylesheet(stylePath);
micButton->setStyleSheet(style);
}
void ChatForm::updateMuteVolButton()
@ -937,8 +943,7 @@ void ChatForm::updateMuteVolButton()
const CoreAV* av = Core::getInstance()->getAv();
volButton->setEnabled(av->isCallActive(f));
if (videoButton->isEnabled())
if (volButton->isEnabled())
{
if (av->isCallOutputMuted(f))
{
@ -957,7 +962,9 @@ void ChatForm::updateMuteVolButton()
volButton->setToolTip(tr("Sound can be disabled only during a call"));
}
volButton->setStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/volButton/volButton.css")));
QString stylePath = QStringLiteral(":/ui/volButton/volButton.css");
QString style = Style::getStylesheet(stylePath);
volButton->setStyleSheet(style);
}
void ChatForm::startCounter()

View File

@ -94,14 +94,17 @@ GenericChatForm::GenericChatForm(QWidget* parent)
screenshotButton = new QPushButton;
callButton = new QPushButton();
callButton->setFixedSize(50,40);
videoButton = new QPushButton();
videoButton->setFixedSize(50,40);
volButton = new QPushButton();
//volButton->setFixedSize(25,20);
volButton->setToolTip("");
volButton->setFixedSize(22, 18);
micButton = new QPushButton();
// micButton->setFixedSize(25,20);
micButton->setToolTip("");
micButton->setFixedSize(22, 18);
// TODO: Make updateCallButtons (see ChatForm) abstract
// and call here to set tooltips.
fileFlyout = new FlyoutOverlayWidget;
QHBoxLayout *fileLayout = new QHBoxLayout(fileFlyout);
@ -162,9 +165,8 @@ GenericChatForm::GenericChatForm(QWidget* parent)
headTextLayout->addWidget(nameLabel);
headTextLayout->addStretch();
micButtonsLayout->setSpacing(0);
micButtonsLayout->setSpacing(4);
micButtonsLayout->addWidget(micButton, Qt::AlignTop | Qt::AlignRight);
micButtonsLayout->addSpacing(4);
micButtonsLayout->addWidget(volButton, Qt::AlignTop | Qt::AlignRight);
buttonsLayout->addLayout(micButtonsLayout, 0, 0, 2, 1, Qt::AlignTop | Qt::AlignRight);