summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2024-03-26 01:41:55 +0000
committerFedja Beader <fedja@protonmail.ch>2024-03-26 01:41:55 +0000
commit222d681981fbb507daad608b92b6c9e503e26825 (patch)
tree0ecc1c7e0c9b10e46141f70ad136df87fbed48d8
parent0ddba13c3964cc7597a2192929283dee5b6f820d (diff)
downloadplus-222d681981fbb507daad608b92b6c9e503e26825.tar.gz
plus-222d681981fbb507daad608b92b6c9e503e26825.tar.bz2
plus-222d681981fbb507daad608b92b6c9e503e26825.tar.xz
plus-222d681981fbb507daad608b92b6c9e503e26825.zip
Auto-focus number and text input fields in NPC dialogs
+reformat one bit See merge request mana/plus!61
-rw-r--r--src/gui/windows/npcdialog.cpp7
1 files 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()