Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(chatform): Fixed buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Diadlo authored and zetok committed Jan 27, 2017
1 parent 5381d55 commit aff0c6f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
17 changes: 12 additions & 5 deletions src/widget/form/chatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -928,17 +927,23 @@ 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()
{
const CoreAV* av = Core::getInstance()->getAv();

volButton->setEnabled(av->isCallActive(f));

if (videoButton->isEnabled())
if (volButton->isEnabled())
{
if (av->isCallOutputMuted(f))
{
Expand All @@ -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()
Expand Down
14 changes: 8 additions & 6 deletions src/widget/form/genericchatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit aff0c6f

Please sign in to comment.