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

Merge branch 'pr857'

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-12-06 13:59:34 +01:00
commit 983c0b7e6b
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
5 changed files with 17 additions and 8 deletions

View File

@ -87,6 +87,7 @@ void ChatAreaWidget::mouseReleaseEvent(QMouseEvent * event)
}
}
}
emit onClick();
}
void ChatAreaWidget::onAnchorClicked(const QUrl &url)

View File

@ -41,6 +41,7 @@ public slots:
signals:
void onFileTranfertInterract(QString widgetName, QString buttonName);
void onClick();
protected:
void mouseReleaseEvent(QMouseEvent * event);

View File

@ -152,6 +152,7 @@ GenericChatForm::GenericChatForm(QWidget *parent) :
connect(emoteButton, SIGNAL(clicked()), this, SLOT(onEmoteButtonClicked()));
connect(chatWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onChatContextMenuRequested(QPoint)));
connect(chatWidget, SIGNAL(onClick()), this, SLOT(onChatWidgetClicked()));
chatWidget->document()->setDefaultStyleSheet(Style::getStylesheet(":ui/chatArea/innerStyle.css"));
chatWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatArea.css"));
@ -252,6 +253,11 @@ void GenericChatForm::onEmoteButtonClicked()
}
}
void GenericChatForm::onChatWidgetClicked()
{
msgEdit->setFocus();
}
void GenericChatForm::onEmoteInsertRequested(QString str)
{
// insert the emoticon

View File

@ -69,6 +69,7 @@ protected slots:
void onEmoteButtonClicked();
void onEmoteInsertRequested(QString str);
void clearChatArea(bool);
void onChatWidgetClicked();
protected:
QString getElidedName(const QString& name);

View File

@ -209,9 +209,6 @@ void GroupChatForm::onCallClicked()
void GroupChatForm::keyPressEvent(QKeyEvent* ev)
{
if (msgEdit->hasFocus())
return;
// Push to talk (CTRL+P)
if (ev->key() == Qt::Key_P && (ev->modifiers() & Qt::ControlModifier) && inCall)
{
@ -224,15 +221,15 @@ void GroupChatForm::keyPressEvent(QKeyEvent* ev)
Style::repolish(micButton);
}
}
if (msgEdit->hasFocus())
return;
}
void GroupChatForm::keyReleaseEvent(QKeyEvent* ev)
{
if (msgEdit->hasFocus())
return;
// Push to talk (CTRL+P (only need to release P))
if (ev->key() == Qt::Key_P && inCall)
// Push to talk (CTRL+P)
if (ev->key() == Qt::Key_P && (ev->modifiers() & Qt::ControlModifier) && inCall)
{
Core* core = Core::getInstance();
if (core->isGroupCallMicEnabled(group->getGroupId()))
@ -243,4 +240,7 @@ void GroupChatForm::keyReleaseEvent(QKeyEvent* ev)
Style::repolish(micButton);
}
}
if (msgEdit->hasFocus())
return;
}