diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-01-16 22:50:47 +0200 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-01-16 22:50:47 +0200 |
commit | 9de2db2fb8ddac82d4f339b5689417c93f0daa5c (patch) | |
tree | 4bec0e0cca74e1ec92b318e4e0a63c19c2102639 /src/dialogs | |
parent | Add some very useful commands (diff) | |
download | nheko-9de2db2fb8ddac82d4f339b5689417c93f0daa5c.tar.xz |
Automatically focus on input when opening a dialog
Diffstat (limited to 'src/dialogs')
-rw-r--r-- | src/dialogs/CreateRoom.cc | 8 | ||||
-rw-r--r-- | src/dialogs/InviteUsers.cc | 8 | ||||
-rw-r--r-- | src/dialogs/JoinRoom.cc | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/dialogs/CreateRoom.cc b/src/dialogs/CreateRoom.cc index 2b2fd7f2..0bda0d00 100644 --- a/src/dialogs/CreateRoom.cc +++ b/src/dialogs/CreateRoom.cc @@ -152,3 +152,11 @@ CreateRoom::paintEvent(QPaintEvent *) QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } + +void +CreateRoom::showEvent(QShowEvent *event) +{ + nameInput_->setFocus(); + + QFrame::showEvent(event); +} diff --git a/src/dialogs/InviteUsers.cc b/src/dialogs/InviteUsers.cc index 22042453..d46ca17e 100644 --- a/src/dialogs/InviteUsers.cc +++ b/src/dialogs/InviteUsers.cc @@ -147,3 +147,11 @@ InviteUsers::invitedUsers() const return users; } + +void +InviteUsers::showEvent(QShowEvent *event) +{ + inviteeInput_->setFocus(); + + QFrame::showEvent(event); +} diff --git a/src/dialogs/JoinRoom.cc b/src/dialogs/JoinRoom.cc index 59e1748d..51f7d53c 100644 --- a/src/dialogs/JoinRoom.cc +++ b/src/dialogs/JoinRoom.cc @@ -59,3 +59,11 @@ JoinRoom::paintEvent(QPaintEvent *) QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } + +void +JoinRoom::showEvent(QShowEvent *event) +{ + roomInput_->setFocus(); + + QFrame::showEvent(event); +} |