diff --git a/docs/index.html b/docs/index.html index a9e37838e..2ffd14b96 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2107,23 +2107,17 @@ - - Select previous image - Control + Left arrow - Control + Left arrow + Move Page Up + Page Up + Page Up Button 1/X + Left - Select next image - Control + Right arrow - Control + Right arrow + Move Page Down + Page Down + Page Down Button 1/X + Right - - Toogle image zoom - Control + Return - Control + Return - Button 1/X + Up - Remove from 'Recently Played' or 'Most Popular' folder Control + X diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 3eff1c00f..53131849f 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -53,6 +53,8 @@ Settings::Settings() setPermanent(SETTINGS_VERSION_KEY, 0); setPermanent("stella.version", "6.2.1"); + //setTemporary("minimal_ui", 1); // enable for minimal UI testing only + // Video-related options setPermanent("video", ""); setPermanent("speed", "1.0"); diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 8abdf321e..b1242e61a 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -83,7 +83,8 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, addPathWidgets(ypos); addFilteringWidgets(ypos); //-- filtering widget line has file count } - mySelectedItem = addRomWidgets(ypos) - 1; // Highlight 'Rom Listing' + + mySelectedItem = addRomWidgets(ypos) - (myUseMinimalUI ? 1 : 2); // Highlight 'Rom Listing' if(!myUseMinimalUI && bottomButtons) addButtonWidgets(ypos); myNavigationBar->setList(myList); @@ -105,7 +106,7 @@ void LauncherDialog::addTitleWidget(int &ypos) #if defined(RETRON77) ver << " for RetroN 77"; #endif - new StaticTextWidget(this, _font, 0, ypos, _w, fontHeight, + new StaticTextWidget(this, _font, 1, ypos, _w - 2, fontHeight, ver.str(), TextAlign::Center); ypos += fontHeight + VGAP; } @@ -250,11 +251,11 @@ void LauncherDialog::addPathWidgets(int& ypos) // Show the files counter myShortCount = true; xpos = _w - HBORDER - lwFound - LBL_GAP / 2; - myRomCount = new StaticTextWidget(this, _font, xpos, ypos, + myRomCount = new StaticTextWidget(this, _font, xpos, ypos - 1, lwFound, fontHeight, "", TextAlign::Right); auto* e = new EditTextWidget(this, _font, myNavigationBar->getRight() - 1, - ypos - btnYOfs, lwFound + LBL_GAP + 1, buttonHeight - 2, ""); + ypos - btnYOfs, lwFound + LBL_GAP + 1, lineHeight, ""); e->setEditable(false); e->setEnabled(false); } else { @@ -324,6 +325,8 @@ int LauncherDialog::addRomWidgets(int ypos) imageHeight = imgSize.h + RomImageWidget::labelHeight(*myROMInfoFont); myRomImageWidget = new RomImageWidget(this, *myROMInfoFont, xpos, ypos, imageWidth, imageHeight); + if(!myUseMinimalUI) + wid.push_back(myRomImageWidget); const int yofs = imageHeight + myROMInfoFont->getFontHeight() / 2; myRomInfoWidget = new RomInfoWidget(this, *myROMInfoFont, @@ -831,18 +834,6 @@ void LauncherDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated) reload(); break; - case KBDK_LEFT: - myRomImageWidget->changeImage(-1); - break; - - case KBDK_RIGHT: - myRomImageWidget->changeImage(1); - break; - - case KBDK_RETURN: - myRomImageWidget->toggleImageZoom(); - break; - default: handled = false; break; @@ -909,50 +900,60 @@ void LauncherDialog::handleJoyUp(int stick, int button) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Event::Type LauncherDialog::getJoyAxisEvent(int stick, JoyAxis axis, JoyDir adir, int button) { - Event::Type e = instance().eventHandler().eventForJoyAxis(EventMode::kMenuMode, stick, axis, adir, button); + Event::Type event = instance().eventHandler().eventForJoyAxis(EventMode::kMenuMode, stick, axis, adir, button); // map axis events for launcher - switch(e) + if(myUseMinimalUI) { - case Event::UINavPrev: - if(myUseMinimalUI) + switch(event) + { + case Event::UINavPrev: // convert unused previous item event into page-up event - e = Event::UIPgUp; - else - myRomImageWidget->disableImageZoom(); - break; + event = Event::UIPgUp; + break; - case Event::UINavNext: - if(myUseMinimalUI) + case Event::UINavNext: // convert unused next item event into page-down event - e = Event::UIPgDown; - else - myRomImageWidget->disableImageZoom(); - break; + event = Event::UIPgDown; + break; - case Event::UITabPrev: - if(myList->isHighlighted()) + case Event::UITabPrev: myRomImageWidget->changeImage(-1); - myEventHandled = true; - break; + myEventHandled = true; + break; - case Event::UITabNext: - if(myList->isHighlighted()) + case Event::UITabNext: myRomImageWidget->changeImage(1); - myEventHandled = true; - break; + myEventHandled = true; + break; - case Event::UIOK: - if(myList->isHighlighted()) + case Event::UIOK: + case Event::UICancel: myRomImageWidget->toggleImageZoom(); - myEventHandled = true; - break; + myEventHandled = true; + break; - default: - break; + default: + break; + } } + else + { + switch(event) + { + case Event::UITabPrev: + event = Event::UIPgUp; + break; - return e; + case Event::UITabNext: + event = Event::UIPgDown; + break; + + default: + break; + } + } + return event; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/NavigationWidget.cxx b/src/gui/NavigationWidget.cxx index a0c8e32f1..720b6fe60 100644 --- a/src/gui/NavigationWidget.cxx +++ b/src/gui/NavigationWidget.cxx @@ -218,7 +218,7 @@ void NavigationWidget::PathWidget::setPath(string_view path) s->setID(static_cast(idx)); s->setTarget(myTarget); myFolderList.push_back(s); - _boss->addFocusWidget(s); + //_boss->addFocusWidget(s); // TODO: allow adding/inserting focus dynamically } x += width; } diff --git a/src/gui/RomImageWidget.cxx b/src/gui/RomImageWidget.cxx index 458b85cf6..70028f82a 100644 --- a/src/gui/RomImageWidget.cxx +++ b/src/gui/RomImageWidget.cxx @@ -35,7 +35,7 @@ RomImageWidget::RomImageWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : Widget(boss, font, x, y, w, h) { - _flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE; + _flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE; // | FLAG_WANTS_RAWDATA; _bgcolor = kDlgColor; _bgcolorlo = kBGColorLo; myImageHeight = _h - labelHeight(font); @@ -464,6 +464,34 @@ void RomImageWidget::positionSurfaces() } } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool RomImageWidget::handleEvent(Event::Type event) +{ + switch(event) + { + case Event::UIPgUp: // controller + case Event::UILeft: // keyboard + changeImage(-1); + return true; + + case Event::UIPgDown: // controller + case Event::UIRight: // keyboard + changeImage(1); + return true; + + case Event::UIOK: // controller + case Event::UICancel: // controller + case Event::UISelect: // keyboard & controller + toggleImageZoom(); + return true; + + default: + break; + } + + return Widget::handleEvent(event); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void RomImageWidget::handleMouseUp(int x, int y, MouseButton b, int clickCount) { diff --git a/src/gui/RomImageWidget.hxx b/src/gui/RomImageWidget.hxx index c9a82fb24..bd2dddb72 100644 --- a/src/gui/RomImageWidget.hxx +++ b/src/gui/RomImageWidget.hxx @@ -48,6 +48,7 @@ class RomImageWidget : public Widget protected: #ifdef IMAGE_SUPPORT + bool handleEvent(Event::Type event) override; void handleMouseUp(int x, int y, MouseButton b, int clickCount) override; void handleMouseMoved(int x, int y) override; void tick() override;