Ticket #8441: mythtv-buttonlistadjust1.patch

File mythtv-buttonlistadjust1.patch, 999 bytes (added by Mark Spieth, 4 years ago)

only move topselected if bottom was displayed

  • mythtv/libs/libmythui/mythuibuttonlist.cpp

    commit 3facf2f40f540f993db6f789f7a26a598c37ec54
    Author: Mark Spieth <mspieth@digivation.com.au>
    Date:   Tue Mar 1 08:27:33 2016 +1100
    
        Only set top position if deleting an item leaves a hole at the end of the
        list
    
    diff --git a/mythtv/libs/libmythui/mythuibuttonlist.cpp b/mythtv/libs/libmythui/mythuibuttonlist.cpp
    index 5da627b..9c25ff4 100644
    a b void MythUIButtonList::CalculateButtonPositions(void) 
    13361336            }
    13371337
    13381338
    1339             if (m_selPosition - (static_cast<int>(m_itemsVisible) - 1)
    1340                 < m_topPosition)
     1339            if (((m_itemList.count() - m_topPosition)
     1340                 < static_cast<int>(m_itemsVisible)) &&
     1341                (m_selPosition - (static_cast<int>(m_itemsVisible) - 1)
     1342                 < m_topPosition))
    13411343                m_topPosition = m_selPosition -
    13421344                                (static_cast<int>(m_itemsVisible) - 1);
    13431345