Ticket #11285: 11285_v1.diff

File 11285_v1.diff, 834 bytes (added by paulh, 6 years ago)

Proposed patch - if there are no items make all the buttons invisible

  • mythtv/libs/libmythui/mythuibuttonlist.cpp

    diff --git a/mythtv/libs/libmythui/mythuibuttonlist.cpp b/mythtv/libs/libmythui/mythuibuttonlist.cpp
    index dc92b31..4f808bb 100644
    a b bool MythUIButtonList::DistributeButtons(void) 
    781781                                   "selected item %1 total items %2")
    782782        .arg(start_item).arg(m_itemCount));
    783783
     784    // if there are no items to show make sure all the buttons are made invisible
     785    if (m_itemCount == 0)
     786    {
     787        for (int i = 0; i < m_ButtonList.count(); i++)
     788        {
     789            if (m_ButtonList[i])
     790                m_ButtonList[i]->SetVisible(false);
     791        }
     792
     793        return false;
     794    }
     795
    784796    /*
    785797     * Try fewer and fewer columns until each row can fit the same
    786798     * number of columns.