Update "Back" buttons to match a bit better.

This commit is contained in:
Unknown W. Brackets 2015-07-04 08:01:32 -07:00
parent e2620a7185
commit 40dcd585a0
6 changed files with 13 additions and 5 deletions

View File

@ -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<UIScreen>(this, &UIScreen::OnBack);
AddStandardBack(leftColumn);
rightScroll_ = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0f));
rightScroll_->SetScrollToTop(false);

View File

@ -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<UIScreen>(this, &UIScreen::OnBack);
AddStandardBack(root_);
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 225, new AnchorLayoutParams(10, 0, 10, 0, false));

View File

@ -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<UIScreen>(this, &UIScreen::OnBack);
AddStandardBack(root_);
}
root_->SetDefaultFocusView(tabHolder);

View File

@ -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<UIScreen>(this, &UIScreen::OnBack);
}
void UIDialogScreenWithBackground::sendMessage(const char *message, const char *value) {
HandleCommonMessages(message, value, screenManager());
I18NCategory *dev = GetI18NCategory("Developer");

View File

@ -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 {

View File

@ -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) {