Ticket #3325: mythgallery_bg.diff

File mythgallery_bg.diff, 1.6 KB (added by zdzisekg@…, 12 years ago)

Adds support for drawing of background container in mythgallery

  • mythgallery/mythgallery/iconview.cpp

    diff -Naur mythplugins.orig/mythgallery/mythgallery/iconview.cpp mythplugins/mythgallery/mythgallery/iconview.cpp
    old new  
    107107        return;
    108108    }
    109109
     110    updateBackground();
     111
    110112    SetupMediaMonitor();
    111113
    112114    srand(time(NULL));
     
    165167        UpdateView();
    166168}
    167169
     170void IconView::updateBackground(void)
     171{
     172    QPixmap bground(size());
     173    bground.fill(this, 0, 0);
     174
     175    QPainter tmp(&bground);
     176
     177    LayerSet *container = m_theme->GetSet("background");
     178    if (container)
     179    {
     180        container->Draw(&tmp, 0, 0);
     181    }
     182
     183    tmp.end();
     184    m_background = bground;
     185
     186    setPaletteBackgroundPixmap(m_background);
     187}
     188
    168189void IconView::UpdateMenu(void)
    169190{
    170191    QPixmap pix(m_menuRect.size());
  • mythgallery/mythgallery/iconview.h

    diff -Naur mythplugins.orig/mythgallery/mythgallery/iconview.h mythplugins/mythgallery/mythgallery/iconview.h
    old new  
    5959    bool LoadViewTheme(void);
    6060    bool LoadThemeImages(void);
    6161
     62    void updateBackground();
     63
    6264    void LoadDirectory(const QString &dir, bool topleft);
    6365
    6466    void UpdateMenu(void);
     
    122124    UIListBtnType      *m_menuType;
    123125    UIListBtnType      *m_submenuType;
    124126
     127    QPixmap             m_background;
    125128    QPixmap             m_backRegPix;
    126129    QPixmap             m_backSelPix;
    127130    QPixmap             m_folderRegPix;