From 6d49f9f260b5ce0aa936825119897a861ed8d032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 31 Mar 2026 14:25:15 -0600 Subject: [PATCH] Add a send button to the chat menu, increase padding --- Common/UI/View.h | 3 +++ UI/ChatScreen.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Common/UI/View.h b/Common/UI/View.h index 039aabdbf5..d1b4835706 100644 --- a/Common/UI/View.h +++ b/Common/UI/View.h @@ -1106,6 +1106,9 @@ public: void SetPasswordMasking(bool masking) { passwordMasking_ = masking; } + void SetPadding(Margins padding) { + padding_ = padding; + } void FocusChanged(int focusFlags) override; void GetContentDimensions(const UIContext &dc, float &w, float &h) const override; diff --git a/UI/ChatScreen.cpp b/UI/ChatScreen.cpp index 2e420210b0..88ea00c17d 100644 --- a/UI/ChatScreen.cpp +++ b/UI/ChatScreen.cpp @@ -30,7 +30,11 @@ void ChatMenu::CreateContents(UI::ViewGroup *parent) { if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_DESKTOP) { // We have direct keyboard input. - chatEdit_ = bottom->Add(new TextEdit("", n->T("Chat message"), n->T("Chat Here"), new LinearLayoutParams(1.0))); + chatEdit_ = bottom->Add(new TextEdit("", n->T("Chat message"), n->T("Chat Here"), new LinearLayoutParams(1.0, Gravity::G_VCENTER))); + chatEdit_->SetPadding(Margins(12, 16)); + Choice *send = bottom->Add(new Choice(ImageID("I_SEND"), new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT))); + send->OnClick.Handle(this, &ChatMenu::OnSubmitMessage); + send->SetImageScale(0.8f); chatEdit_->OnEnter.Handle(this, &ChatMenu::OnSubmitMessage); } else { // If we have a native input box, like on Android, or at least we can do a popup text input with our UI...