Example #1
0
void KBlocksGraphics::adjustForSize(const QSize &newsize)
{
    Q_UNUSED(newsize)
    //Reset our values
    readThemeValues();

    return;

    /*
    double aspectratio;
    double nw = newsize.width();
    double nh = newsize.height();

    double origw = m_View_Size_Width;
    double origh = m_View_Size_Height;

    if ((origw/origh)>(nw/nh)) {
        //space will be left on height, use width as limit
        aspectratio = nw/origw;
    } else {
        aspectratio = nh/origh;
    }
    //qCDebug(KBGraphics) << aspectratio;
    m_Block_Size = (int) (aspectratio*(qreal)m_Block_Size);
    m_View_Size_Width = (int) (aspectratio*(double)m_View_Size_Width);
    m_View_Size_Height = (int) (aspectratio*(double)m_View_Size_Height);
    m_PlayArea_OffsetPoint_X = (int) (aspectratio*(qreal)m_PlayArea_OffsetPoint_X);
    m_PlayArea_OffsetPoint_Y = (int) (aspectratio*(qreal)m_PlayArea_OffsetPoint_Y);
    m_PreviewArea_CenterPoint_X = (int) (aspectratio*(qreal)m_PreviewArea_CenterPoint_X);
    m_PreviewArea_CenterPoint_Y = (int) (aspectratio*(qreal)m_PreviewArea_CenterPoint_Y);
    */
}
Example #2
0
KBlocksGraphics::KBlocksGraphics ( const QString& themeFile )
{
    m_theme = new KGameTheme();
    if (!m_theme->load(themeFile)) {
        kDebug(11000) << "Error loading KBlocks .desktop theme" << themeFile << endl;
        m_theme->loadDefault();
    }
    m_renderer = new QSvgRenderer(m_theme->graphics());
    readThemeValues();
}
Example #3
0
bool KBlocksGraphics::loadTheme ( const QString& themeFile )
{
    if (!m_theme->load(themeFile)) {
        kDebug(11000) << "Error loading KBlocks .desktop theme" << themeFile << endl;
        return false;
    }
    if (!m_renderer->load(m_theme->graphics())) {
        kDebug(11000) << "Error loading SVG theme" << m_theme->graphics() << endl;
        return false;
    }
    //clear the cache or pixmaps from the old theme will be returned
    //QPixmapCache::clear();
    readThemeValues();
    return true;
}