mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
UI: Fix L/R tab navigation.
This commit is contained in:
parent
c42a03c255
commit
7f036f8431
7 changed files with 12 additions and 12 deletions
|
@ -1288,7 +1288,7 @@ void TabHolder::SetCurrentTab(int tab, bool skipTween) {
|
|||
|
||||
currentTab_ = tab;
|
||||
}
|
||||
tabStrip_->SetSelection(tab);
|
||||
tabStrip_->SetSelection(tab, false);
|
||||
}
|
||||
|
||||
EventReturn TabHolder::OnTabClick(EventParams &e) {
|
||||
|
@ -1369,7 +1369,7 @@ EventReturn ChoiceStrip::OnChoiceClick(EventParams &e) {
|
|||
return OnChoice.Dispatch(e2);
|
||||
}
|
||||
|
||||
void ChoiceStrip::SetSelection(int sel) {
|
||||
void ChoiceStrip::SetSelection(int sel, bool triggerClick) {
|
||||
int prevSelected = selected_;
|
||||
StickyChoice *prevChoice = Choice(selected_);
|
||||
if (prevChoice)
|
||||
|
@ -1384,7 +1384,7 @@ void ChoiceStrip::SetSelection(int sel) {
|
|||
e.v = views_[selected_];
|
||||
e.a = selected_;
|
||||
// Set to 0 to indicate a selection change (not a click.)
|
||||
e.b = 0;
|
||||
e.b = triggerClick ? 1 : 0;
|
||||
OnChoice.Trigger(e);
|
||||
}
|
||||
}
|
||||
|
@ -1398,16 +1398,16 @@ void ChoiceStrip::HighlightChoice(unsigned int choice){
|
|||
|
||||
bool ChoiceStrip::Key(const KeyInput &input) {
|
||||
bool ret = false;
|
||||
if (input.flags & KEY_DOWN) {
|
||||
if (topTabs_ && (input.flags & KEY_DOWN)) {
|
||||
if (IsTabLeftKey(input)) {
|
||||
if (selected_ > 0) {
|
||||
SetSelection(selected_ - 1);
|
||||
SetSelection(selected_ - 1, true);
|
||||
UI::PlayUISound(UI::UISound::TOGGLE_OFF); // Maybe make specific sounds for this at some point?
|
||||
}
|
||||
ret = true;
|
||||
} else if (IsTabRightKey(input)) {
|
||||
if (selected_ < (int)views_.size() - 1) {
|
||||
SetSelection(selected_ + 1);
|
||||
SetSelection(selected_ + 1, true);
|
||||
UI::PlayUISound(UI::UISound::TOGGLE_ON);
|
||||
}
|
||||
ret = true;
|
||||
|
|
|
@ -300,7 +300,7 @@ public:
|
|||
void AddChoice(ImageID buttonImage);
|
||||
|
||||
int GetSelection() const { return selected_; }
|
||||
void SetSelection(int sel);
|
||||
void SetSelection(int sel, bool triggerClick);
|
||||
|
||||
void HighlightChoice(unsigned int choice);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ void ComboKeyScreen::CreateViews() {
|
|||
for (int i = 0; i < 5; i++) {
|
||||
comboselect->AddChoice(comboKeyImages[i]);
|
||||
}
|
||||
comboselect->SetSelection(*mode);
|
||||
comboselect->SetSelection(*mode, false);
|
||||
comboselect->OnChoice.Handle(this, &ComboKeyScreen::onCombo);
|
||||
leftColumn->Add(comboselect);
|
||||
root__->Add(leftColumn);
|
||||
|
|
|
@ -319,7 +319,7 @@ void DisplayLayoutScreen::CreateViews() {
|
|||
mode_ = new ChoiceStrip(ORIENT_VERTICAL, new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10 + leftInset, NONE, NONE, 158 + 64 + 10));
|
||||
mode_->AddChoice(di->T("Move"));
|
||||
mode_->AddChoice(di->T("Resize"));
|
||||
mode_->SetSelection(0);
|
||||
mode_->SetSelection(0, false);
|
||||
}
|
||||
displayRepresentation_ = new DragDropDisplay(g_Config.fSmallDisplayOffsetX, g_Config.fSmallDisplayOffsetY, ImageID("I_PSP_DISPLAY"), ScaleSettingToUI(), bounds);
|
||||
displayRepresentation_->SetVisibility(V_VISIBLE);
|
||||
|
|
|
@ -664,7 +664,7 @@ void GameBrowser::Refresh() {
|
|||
ChoiceStrip *layoutChoice = topBar->Add(new ChoiceStrip(ORIENT_HORIZONTAL));
|
||||
layoutChoice->AddChoice(ImageID("I_GRID"));
|
||||
layoutChoice->AddChoice(ImageID("I_LINES"));
|
||||
layoutChoice->SetSelection(*gridStyle_ ? 0 : 1);
|
||||
layoutChoice->SetSelection(*gridStyle_ ? 0 : 1, false);
|
||||
layoutChoice->OnChoice.Handle(this, &GameBrowser::LayoutChange);
|
||||
topBar->Add(new Choice(ImageID("I_GEAR"), new LayoutParams(64.0f, 64.0f)))->OnClick.Handle(this, &GameBrowser::GridSettingsClick);
|
||||
Add(topBar);
|
||||
|
|
|
@ -510,7 +510,7 @@ void SavedataScreen::CreateViews() {
|
|||
sortStrip->AddChoice(sa->T("Filename"));
|
||||
sortStrip->AddChoice(sa->T("Size"));
|
||||
sortStrip->AddChoice(sa->T("Date"));
|
||||
sortStrip->SetSelection((int)sortOption_);
|
||||
sortStrip->SetSelection((int)sortOption_, false);
|
||||
sortStrip->OnChoice.Handle<SavedataScreen>(this, &SavedataScreen::OnSortClick);
|
||||
|
||||
root_->Add(main);
|
||||
|
|
|
@ -511,7 +511,7 @@ void TouchControlLayoutScreen::CreateViews() {
|
|||
mode_ = new ChoiceStrip(ORIENT_VERTICAL, new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, NONE, NONE, 140 + 158 + 64 + 10));
|
||||
mode_->AddChoice(di->T("Move"));
|
||||
mode_->AddChoice(di->T("Resize"));
|
||||
mode_->SetSelection(0);
|
||||
mode_->SetSelection(0, false);
|
||||
mode_->OnChoice.Handle(this, &TouchControlLayoutScreen::OnMode);
|
||||
|
||||
reset->OnClick.Handle(this, &TouchControlLayoutScreen::OnReset);
|
||||
|
|
Loading…
Add table
Reference in a new issue