Fixed graphical bug in StringListWidget when removing the last item

it contains; it wasn't being redrawn until clicking the widget.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3116 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-12-24 00:03:18 +00:00
parent 233fd75522
commit 7be62c80bc
3 changed files with 10 additions and 4 deletions

View File

@ -88,8 +88,12 @@ void JoystickDialog::loadConfig()
myJoyIDs.push_back(i.second.toInt());
}
myJoyList->setList(sticks);
if(sticks.size() > 0)
myJoyList->setSelected(0);
myJoyList->setSelected(0);
if(sticks.size() == 0)
{
myRemoveBtn->setEnabled(false);
myJoyText->setText("");
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -68,8 +68,11 @@ ListWidget::~ListWidget()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ListWidget::setSelected(int item)
{
if(item < -1 || item >= (int)_list.size())
if(item < 0 || item >= (int)_list.size())
{
setDirty(); draw(); // Simply redraw and exit
return;
}
if(isEnabled())
{

View File

@ -45,7 +45,6 @@ void StringListWidget::setList(const StringList& list)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StringListWidget::drawWidget(bool hilite)
{
//cerr << "StringListWidget::drawWidget\n";
FBSurface& s = _boss->dialog().surface();
int i, pos, len = (int)_list.size();
string buffer;