diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index d93b5da508..fb267b0850 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -207,7 +207,7 @@ void ControlMappingScreen::CreateViews() { root_ = new LinearLayout(ORIENT_HORIZONTAL); - LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(200, FILL_PARENT)); + LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(200, FILL_PARENT, Margins(10, 0, 0, 10))); leftColumn->Add(new Choice(km->T("Clear All")))->OnClick.Handle(this, &ControlMappingScreen::OnClearMapping); leftColumn->Add(new Choice(km->T("Default All")))->OnClick.Handle(this, &ControlMappingScreen::OnDefaultMapping); if (KeyMap::GetSeenPads().size()) { @@ -215,7 +215,7 @@ void ControlMappingScreen::CreateViews() { } leftColumn->Add(new Choice(km->T("Test Analogs")))->OnClick.Handle(this, &ControlMappingScreen::OnTestAnalogs); leftColumn->Add(new Spacer(new LinearLayoutParams(1.0f))); - leftColumn->Add(new Choice(di->T("Back")))->OnClick.Handle(this, &UIScreen::OnBack); + AddStandardBack(leftColumn); rightScroll_ = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)); rightScroll_->SetScrollToTop(false); diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 4f19690470..54ccfccfbf 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -308,7 +308,7 @@ void SystemInfoScreen::CreateViews() { ViewGroup *leftColumn = new AnchorLayout(new LinearLayoutParams(1.0f)); root_->Add(leftColumn); - root_->Add(new Choice(di->T("Back"), "", false, new AnchorLayoutParams(225, 64, 10, NONE, NONE, 10)))->OnClick.Handle(this, &UIScreen::OnBack); + AddStandardBack(root_); TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 225, new AnchorLayoutParams(10, 0, 10, 0, false)); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 726f6312a6..f873198a88 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -115,7 +115,7 @@ void GameSettingsScreen::CreateViews() { } else { tabHolder = new TabHolder(ORIENT_VERTICAL, 200, new AnchorLayoutParams(10, 0, 10, 0, false)); root_->Add(tabHolder); - root_->Add(new Choice(di->T("Back"), "", false, new AnchorLayoutParams(150, 64, 10, NONE, NONE, 10)))->OnClick.Handle(this, &UIScreen::OnBack); + AddStandardBack(root_); } root_->SetDefaultFocusView(tabHolder); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 19633b7106..846b28619d 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -194,6 +194,12 @@ void UIDialogScreenWithBackground::DrawBackground(UIContext &dc) { dc.Flush(); } +void UIDialogScreenWithBackground::AddStandardBack(UI::ViewGroup *parent) { + using namespace UI; + I18NCategory *di = GetI18NCategory("Dialog"); + parent->Add(new Choice(di->T("Back"), "", false, new AnchorLayoutParams(150, 64, 10, NONE, NONE, 10)))->OnClick.Handle(this, &UIScreen::OnBack); +} + void UIDialogScreenWithBackground::sendMessage(const char *message, const char *value) { HandleCommonMessages(message, value, screenManager()); I18NCategory *dev = GetI18NCategory("Developer"); diff --git a/UI/MiscScreens.h b/UI/MiscScreens.h index 71896cf52c..9f7601978c 100644 --- a/UI/MiscScreens.h +++ b/UI/MiscScreens.h @@ -55,6 +55,8 @@ protected: virtual void DrawBackground(UIContext &dc); virtual void sendMessage(const char *message, const char *value) override; virtual UI::EventReturn OnLanguageChange(UI::EventParams &e); + + void AddStandardBack(UI::ViewGroup *parent); }; class UIDialogScreenWithGameBackground : public UIDialogScreenWithBackground { diff --git a/UI/Store.cpp b/UI/Store.cpp index 1ea96cb362..2db234aaed 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -184,7 +184,7 @@ void ProductItemView::Update(const InputState &input_state) { View::Update(input_state); } -// This is a "details" view of a game. Let's you install it. +// This is a "details" view of a game. Lets you install it. class ProductView : public UI::LinearLayout { public: ProductView(const StoreEntry &entry) : LinearLayout(UI::ORIENT_VERTICAL), entry_(entry), installButton_(0) {