From 222d681981fbb507daad608b92b6c9e503e26825 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Tue, 26 Mar 2024 01:41:55 +0000 Subject: Auto-focus number and text input fields in NPC dialogs +reformat one bit See merge request mana/plus!61 --- src/gui/windows/npcdialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 693c92f9f..4ace1d6f8 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -761,8 +761,9 @@ bool NpcDialog::isTextInputFocused() const bool NpcDialog::isInputFocused() const { - return mTextField->isFocused() || mIntField->isFocused() - || mItemList->isFocused(); + return mTextField->isFocused() + || mIntField->isFocused() + || mItemList->isFocused(); } bool NpcDialog::isAnyInputFocused() @@ -964,6 +965,7 @@ void NpcDialog::placeTextInputControls() place(2, 4, mClearButton, 2, 1); place(4, 4, mButton, 2, 1); } + mTextField->requestFocus(); } void NpcDialog::placeIntInputControls() @@ -989,6 +991,7 @@ void NpcDialog::placeIntInputControls() place(2, 4, mClearButton, 2, 1); place(4, 4, mButton, 2, 1); } + mIntField->requestFocus(); } void NpcDialog::placeItemInputControls() -- cgit v1.2.3-70-g09d2