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

Focus the text input area when clicking on the text area

This commit is contained in:
Simon Vermeersch 2014-11-25 22:20:39 +01:00 committed by Tux3 / Mlkj / !Lev.uXFMLA
parent 324d075cfe
commit 424af0505e
4 changed files with 9 additions and 0 deletions

View File

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

View File

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

View File

@ -152,6 +152,7 @@ GenericChatForm::GenericChatForm(QWidget *parent) :
connect(emoteButton, SIGNAL(clicked()), this, SLOT(onEmoteButtonClicked())); connect(emoteButton, SIGNAL(clicked()), this, SLOT(onEmoteButtonClicked()));
connect(chatWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onChatContextMenuRequested(QPoint))); 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->document()->setDefaultStyleSheet(Style::getStylesheet(":ui/chatArea/innerStyle.css"));
chatWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatArea.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) void GenericChatForm::onEmoteInsertRequested(QString str)
{ {
// insert the emoticon // insert the emoticon

View File

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