Commit 0147bf1b authored by Andreas Traczyk's avatar Andreas Traczyk

ui: fix hide/show callPanel

Change-Id: I9f593bb84cb4e073119ceeae3e22b0a6700ed7be
parent 2965014a
......@@ -217,8 +217,7 @@ CallWidget::CallWidget(QWidget* parent) :
ui->messageView->buildView();
// hide the call stack
ui->callStackWidget->hide();
ui->messagingHeaderWidget->show();
setCallPanelVisibility(false);
ui->containerWidget->setVisible(false);
}
......@@ -640,7 +639,7 @@ void CallWidget::slotShowCallView(const std::string& accountId,
Q_UNUSED(accountId);
Q_UNUSED(convInfo);
qDebug() << "slotShowCallView";
showCallPanel();
setCallPanelVisibility(true);
ui->callStackWidget->setCurrentWidget(ui->videoPage);
ui->videoWidget->showChatviewIfToggled();
hideMiniSpinner();
......@@ -672,7 +671,7 @@ void CallWidget::slotShowIncomingCallView(const std::string& accountId,
miniSpinner_->start();
ui->spinnerLabel->show();
ui->callStackWidget->setCurrentWidget(ui->outgoingCallPage);
showCallPanel();
setCallPanelVisibility(true);
}
} else {
if (!QApplication::focusWidget()) {
......@@ -685,10 +684,10 @@ void CallWidget::slotShowIncomingCallView(const std::string& accountId,
auto accountProperties = LRCInstance::accountModel().getAccountConfig(selectedAccountId);
if (accountProperties.autoAnswer) {
ui->callStackWidget->setCurrentWidget(ui->videoPage);
showCallPanel();
setCallPanelVisibility(true);
} else if (isCallSelected) {
ui->callStackWidget->setCurrentWidget(ui->incomingCallPage);
showCallPanel();
setCallPanelVisibility(true);
}
}
......@@ -719,8 +718,7 @@ void CallWidget::slotShowChatView(const std::string& accountId,
Q_UNUSED(accountId);
Q_UNUSED(convInfo);
ui->callStackWidget->hide();
ui->messagingHeaderWidget->show();
setCallPanelVisibility(false);
showConversationView();
}
......@@ -1078,11 +1076,10 @@ CallWidget::selectConversation(const QModelIndex& index)
auto conversation = Utils::getConversationFromUid(convUid, *currentConversationModel);
const auto item = currentConversationModel->filteredConversation(index.row());
if (callModel->hasCall(conversation->callId) && item.callId == conversation->callId) {
showCallPanel();
setCallPanelVisibility(true);
return;
}
ui->callStackWidget->hide();
ui->messagingHeaderWidget->show();
setCallPanelVisibility(false);
}
}
......@@ -1191,8 +1188,7 @@ CallWidget::connectAccount(const std::string& accId)
case lrc::api::call::Status::TIMEOUT:
case lrc::api::call::Status::TERMINATING:
{
ui->callStackWidget->hide();
ui->messagingHeaderWidget->show();
setCallPanelVisibility(false);
showConversationView();
break;
}
......@@ -1218,12 +1214,11 @@ CallWidget::connectAccount(const std::string& accId)
}
void
CallWidget::showCallPanel()
CallWidget::setCallPanelVisibility(bool visible)
{
ui->stackedWidget->setCurrentWidget(ui->mainActivityWidget);
ui->callStackWidget->show();
ui->imBackButton->hide();
ui->imBackButton->hide();
ui->btnAudioCall->hide();
ui->btnVideoCall->hide();
ui->callStackWidget->setVisible(visible);
ui->imBackButton->setVisible(!visible);
ui->btnAudioCall->setVisible(!visible);
ui->btnVideoCall->setVisible(!visible);
}
......@@ -133,7 +133,7 @@ private:
void updateConversationsFilterWidget();
void updateComboBox();
void connectAccount(const std::string& accId);
void showCallPanel();
void setCallPanelVisibility(bool visible);
QMenu* menu_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment