More work on smoother keyboard focus

This commit is contained in:
Henrik Rydgård 2014-03-03 12:56:01 +01:00
parent 36c8d7f408
commit 30e58d9848
4 changed files with 15 additions and 5 deletions

View File

@ -94,6 +94,7 @@ void GameSettingsScreen::CreateViews() {
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 200, new AnchorLayoutParams(10, 0, 10, 0, false));
root_->Add(tabHolder);
root_->SetDefaultFocusView(tabHolder);
// TODO: These currently point to global settings, not game specific ones.
@ -106,7 +107,8 @@ void GameSettingsScreen::CreateViews() {
graphicsSettings->Add(new ItemHeader(gs->T("Rendering Mode")));
static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering", "Read Framebuffers To Memory (CPU)", "Read Framebuffers To Memory (GPU)"};
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iRenderingMode, gs->T("Mode"), renderingMode, 0, ARRAY_SIZE(renderingMode), gs, screenManager()))->OnChoice.Handle(this, &GameSettingsScreen::OnRenderingMode);
PopupMultiChoice *rm = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iRenderingMode, gs->T("Mode"), renderingMode, 0, ARRAY_SIZE(renderingMode), gs, screenManager()));
rm->OnChoice.Handle(this, &GameSettingsScreen::OnRenderingMode);
graphicsSettings->Add(new ItemHeader(gs->T("Frame Rate Control")));
@ -223,7 +225,7 @@ void GameSettingsScreen::CreateViews() {
dump->SetEnabled(false);
// We normally use software rendering to debug so put it in debugging.
CheckBox *softwareGPU = graphicsSettings->Add(new CheckBox(&g_Config.bSoftwareRendering, gs->T("Software Rendering", "Software Rendering (experimental)")));
CheckBox *softwareGPU = graphicsSettings->Add(new CheckBox(&g_Config.bSoftwareRendering, gs->T("Software Rendering", "Software Rendering (experimental)")));
if (PSP_IsInited())
softwareGPU->SetEnabled(false);

View File

@ -692,6 +692,7 @@ void MainScreen::CreateViews() {
TabHolder *leftColumn = new TabHolder(ORIENT_HORIZONTAL, 64);
tabHolder_ = leftColumn;
leftColumn->SetClip(true);
ScrollView *scrollRecentGames = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
@ -778,6 +779,7 @@ void MainScreen::CreateViews() {
gold->OnClick.Handle(this, &MainScreen::OnSupport);
gold->SetIcon(I_ICONGOLD);
#endif
rightColumnItems->Add(new Spacer(25.0));
rightColumnItems->Add(new Choice(m->T("Exit")))->OnClick.Handle(this, &MainScreen::OnExit);
if (vertical) {
@ -794,6 +796,8 @@ void MainScreen::CreateViews() {
root_->Add(rightColumn);
}
root_->SetDefaultFocusView(tabHolder_);
I18NCategory *u = GetI18NCategory("Upgrade");
upgradeBar_ = 0;

View File

@ -218,7 +218,9 @@ void PromptScreen::CreateViews() {
ViewGroup *rightColumnItems = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins));
root_->Add(rightColumnItems);
rightColumnItems->Add(new Choice(yesButtonText_))->OnClick.Handle(this, &PromptScreen::OnYes);
Choice *yesButton = rightColumnItems->Add(new Choice(yesButtonText_));
yesButton->OnClick.Handle(this, &PromptScreen::OnYes);
root_->SetDefaultFocusView(yesButton);
if (noButtonText_ != "")
rightColumnItems->Add(new Choice(noButtonText_))->OnClick.Handle(this, &PromptScreen::OnNo);
}
@ -428,7 +430,9 @@ void CreditsScreen::CreateViews() {
I18NCategory *c = GetI18NCategory("PSPCredits");
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
root_->Add(new Button(d->T("Back"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 10, false)))->OnClick.Handle(this, &CreditsScreen::OnOK);
Button *back = root_->Add(new Button(d->T("Back"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 10, false)));
back->OnClick.Handle(this, &CreditsScreen::OnOK);
root_->SetDefaultFocusView(back);
#ifndef GOLD
root_->Add(new Button(c->T("Buy Gold"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 10, false)))->OnClick.Handle(this, &CreditsScreen::OnSupport);
#endif

2
native

@ -1 +1 @@
Subproject commit 27bb0b01d39d733c25da390b6d756734c6d80c90
Subproject commit 3d906a1471b97a49fc8c61450d469a539d1d835a