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...