mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
15ca7a587f
commit
b948ef890f
|
@ -19,6 +19,7 @@
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
|
||||||
#include "src/misc/smileypack.h"
|
#include "src/misc/smileypack.h"
|
||||||
#include "src/widget/emoticonswidget.h"
|
#include "src/widget/emoticonswidget.h"
|
||||||
|
@ -240,6 +241,23 @@ void GenericChatForm::show(Ui::MainWindow &ui)
|
||||||
QWidget::show();
|
QWidget::show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GenericChatForm::showEvent(QShowEvent *)
|
||||||
|
{
|
||||||
|
msgEdit->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GenericChatForm::event(QEvent* e)
|
||||||
|
{
|
||||||
|
// If the user accidentally starts typing outside of the msgEdit, focus it automatically
|
||||||
|
if (e->type() == QEvent::KeyRelease && !msgEdit->hasFocus())
|
||||||
|
{
|
||||||
|
QKeyEvent* ke = static_cast<QKeyEvent*>(e);
|
||||||
|
if (ke->modifiers() == Qt::NoModifier || ke->modifiers() == Qt::ShiftModifier)
|
||||||
|
msgEdit->setFocus();
|
||||||
|
}
|
||||||
|
return QWidget::event(e);
|
||||||
|
}
|
||||||
|
|
||||||
void GenericChatForm::onChatContextMenuRequested(QPoint pos)
|
void GenericChatForm::onChatContextMenuRequested(QPoint pos)
|
||||||
{
|
{
|
||||||
QWidget* sender = (QWidget*)QObject::sender();
|
QWidget* sender = (QWidget*)QObject::sender();
|
||||||
|
|
|
@ -87,6 +87,8 @@ protected:
|
||||||
QString resolveToxId(const ToxId &id);
|
QString resolveToxId(const ToxId &id);
|
||||||
void insertChatMessage(ChatMessage::Ptr msg);
|
void insertChatMessage(ChatMessage::Ptr msg);
|
||||||
void hideEvent(QHideEvent* event);
|
void hideEvent(QHideEvent* event);
|
||||||
|
void showEvent(QShowEvent *);
|
||||||
|
bool event(QEvent *);
|
||||||
void resizeEvent(QResizeEvent* event);
|
void resizeEvent(QResizeEvent* event);
|
||||||
void adjustFileMenuPosition();
|
void adjustFileMenuPosition();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user