Ticket #8784: thumbnail.patch

File thumbnail.patch, 1.6 KB (added by Jonatan <mythtv@…>, 11 years ago)
  • mythgallery/mythgallery/iconview.cpp

     
    191191    BuildFocusList();
    192192
    193193    // TODO Not accurate, the image may be smaller than the button
    194     uint buttonwidth = m_imageList->ItemWidth();
    195     uint buttonheight = m_imageList->ItemHeight();
     194    int thumbWidth  = m_imageList->ItemWidth();
     195    int thumbHeight = m_imageList->ItemHeight();
     196    if (m_selectedImage && (m_selectedImage->GetArea().width()  > thumbWidth ||
     197                            m_selectedImage->GetArea().height() > thumbHeight))
     198    {
     199       thumbWidth  = m_selectedImage->GetArea().width();
     200       thumbHeight = m_selectedImage->GetArea().height();
     201    }
    196202
    197203    if (m_thumbGen)
    198         m_thumbGen->setSize((int)buttonwidth, (int)buttonheight);
     204        m_thumbGen->setSize(thumbWidth, thumbHeight);
    199205
    200206    SetupMediaMonitor();
    201207
     
    266272        m_noImagesText->SetVisible((m_itemList.size() == 0));
    267273
    268274    UpdateText(m_imageList->GetItemCurrent());
     275    UpdateImage(m_imageList->GetItemCurrent());
    269276}
    270277
    271278void IconView::LoadThumbnail(ThumbItem *item)
     
    739746            MythUIButtonListItem *item = m_imageList->GetItemAt(pos);
    740747            if (QFile(thumbitem->GetImageFilename()).exists())
    741748                item->SetImage(thumbitem->GetImageFilename());
     749 
     750            if (m_imageList->GetCurrentPos() == pos)
     751                UpdateImage(item);
    742752        }
    743753        delete td;
    744754    }