Disable the pattern-matching textbox in the ROM launcher when the window

size isn't at least 640 pixels wide.  This is the start of the UI
cleanup I was supposed to do after release 2.7.  I need to check all
UI dialogs to make sure they fit in 320x210 (the minimum resolution
that Stella supports).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1936 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-02-09 22:49:23 +00:00
parent eb5f8efc78
commit 7ecd5ceac2
1 changed files with 10 additions and 7 deletions

View File

@ -85,10 +85,13 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
// Add filter that can narrow the results shown in the listing
// It has to fit between both labels
fwidth = BSPF_min(15 * fontWidth, xpos - 20 - lwidth);
xpos -= fwidth + 5;
myPattern = new EditTextWidget(this, font, xpos, ypos,
fwidth, fontHeight, "");
if(w >= 640)
{
fwidth = BSPF_min(15 * fontWidth, xpos - 20 - lwidth);
xpos -= fwidth + 5;
myPattern = new EditTextWidget(this, font, xpos, ypos,
fwidth, fontHeight, "");
}
// Add list with game titles
// Before we add the list, we need to know the size of the RomInfoWidget
@ -106,7 +109,7 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
myList->setNumberingMode(kListNumberingOff);
myList->setEditable(false);
wid.push_back(myList);
wid.push_back(myPattern); // Add after the list for tab order
if(myPattern) wid.push_back(myPattern); // Add after the list for tab order
// Add ROM info area (if enabled)
if(romWidth > 0)
@ -323,6 +326,7 @@ void LauncherDialog::loadDirListing()
myGameList->appendGame(" [..]", "", "", true);
// Now add the directory entries
bool domatch = myPattern && myPattern->getEditString() != "";
for(unsigned int idx = 0; idx < files.size(); idx++)
{
string name = files[idx].getDisplayName();
@ -342,8 +346,7 @@ void LauncherDialog::loadDirListing()
}
// Skip over files that don't match the pattern in the 'pattern' textbox
if(!isDir && myPattern->getEditString() != "" &&
!matchPattern(name, myPattern->getEditString()))
if(domatch && !isDir && !matchPattern(name, myPattern->getEditString()))
continue;
myGameList->appendGame(name, files[idx].getPath(), "", isDir);