diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index b27b54b805..015222c1a5 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -80,7 +80,7 @@ void ControlMapper::Update(const InputState &input) { void ControlMapper::Refresh() { Clear(); - I18NCategory *c = GetI18NCategory("MappableControls"); + I18NCategory *mc = GetI18NCategory("MappableControls"); std::map keyImages; keyImages["Circle"] = I_CIRCLE; @@ -94,20 +94,26 @@ void ControlMapper::Refresh() { using namespace UI; + float itemH = 45; + LinearLayout *root = Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT))); + root->SetSpacing(3.0f); + + const int padding = 4; auto iter = keyImages.find(keyName_); // First, look among images. if (iter != keyImages.end()) { - root->Add(new Choice(iter->second, new LinearLayoutParams(200, WRAP_CONTENT)))->OnClick.Handle(this, &ControlMapper::OnReplaceAll); + Choice *c = root->Add(new Choice(iter->second, new LinearLayoutParams(200, itemH))); + c->OnClick.Handle(this, &ControlMapper::OnReplaceAll); } else { // No image? Let's translate. - Choice *choice = new Choice(c->T(keyName_.c_str()), new LinearLayoutParams(200, WRAP_CONTENT)); - choice->SetCentered(true); - root->Add(choice)->OnClick.Handle(this, &ControlMapper::OnReplaceAll); + Choice *c = new Choice(mc->T(keyName_.c_str()), new LinearLayoutParams(200, itemH)); + c->SetCentered(true); + root->Add(c)->OnClick.Handle(this, &ControlMapper::OnReplaceAll); } - LinearLayout *rightColumn = root->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f))); + LinearLayout *rightColumn = root->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f))); rightColumn->SetSpacing(2.0f); std::vector mappings; KeyMap::KeyFromPspButton(pspKey_, &mappings); @@ -118,23 +124,26 @@ void ControlMapper::Refresh() { int image = -1; LinearLayout *row = rightColumn->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT))); + row->SetSpacing(1.0f); - Choice *c = row->Add(new Choice(deviceName + "." + keyName, new LinearLayoutParams(1.0f))); + Choice *c = row->Add(new Choice(deviceName + "." + keyName, new LinearLayoutParams(FILL_PARENT, itemH, 1.0f))); char tagbuf[16]; sprintf(tagbuf, "%i", (int)i); c->SetTag(tagbuf); c->OnClick.Handle(this, &ControlMapper::OnReplace); - Choice *d = row->Add(new Choice("X")); + Choice *d = row->Add(new Choice(" X ", new LayoutParams(FILL_PARENT, itemH))); d->SetTag(tagbuf); d->OnClick.Handle(this, &ControlMapper::OnDelete); - row->Add(new Choice("+"))->OnClick.Handle(this, &ControlMapper::OnAdd); + Choice *p = row->Add(new Choice(" + ", new LayoutParams(FILL_PARENT, itemH))); + p->OnClick.Handle(this, &ControlMapper::OnAdd); } if (mappings.size() == 0) { // look like an empty line - rightColumn->Add(new Choice("", new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT)))->OnClick.Handle(this, &ControlMapper::OnAdd); + Choice *c = rightColumn->Add(new Choice("", new LinearLayoutParams(FILL_PARENT, itemH))); + c->OnClick.Handle(this, &ControlMapper::OnAdd); } } diff --git a/native b/native index af08e8f1de..d7c90499c4 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit af08e8f1de16bc80314fe96f45605067e0592183 +Subproject commit d7c90499c4ad4dd94c72e46004c696182e42b4dc