Ejemplo n.º 1
0
void TransparentBg::init(QWidget *p)
{
    QObject *obj = p->topLevelWidget()->child(_TRANSPARENT);
    if (obj == NULL) return;
    bgX = bgY = 0;
    connect(obj, SIGNAL(backgroundUpdated()), this, SLOT(backgroundUpdated()));
}
Ejemplo n.º 2
0
bool TransparentBg::eventFilter(QObject*, QEvent *e)
{
    if ((e->type() ==  QEvent::Show) || (e->type() == QEvent::Resize) || (e->type() == QEvent::User)){
        backgroundUpdated();
    }else if (e->type() == QEvent::Paint){
        QTextEdit *text = static_cast<QTextEdit*>(parent());
        QPoint pp = text->viewportToContents(QPoint(0, 0));
        if ((bgX != pp.x()) || (bgY != pp.y()))
            backgroundUpdated();
    }
    return false;
}
Ejemplo n.º 3
0
void TransparentTop::updateBackground(const QPixmap &pm)
{
#if defined(USE_KDE) && defined(HAVE_KROOTPIXMAP_H)
    saveBG = pm;
    genBG = QPixmap();
    genFade = 0;
    emit backgroundUpdated();
#endif
}
Ejemplo n.º 4
0
void TransparentTop::updateBackground(const QPixmap&)
#endif
{
#if defined(USE_KDE) && defined(HAVE_KROOTPIXMAP_H)
    if (pm.isNull()) return;
    saveBG = pm;
    genBG = QPixmap();
    genFade = 0;
    emit backgroundUpdated();
#endif
}
Ejemplo n.º 5
0
void TransparentTop::transparentChanged()
{
#ifdef WIN32
    QWidget *p = static_cast<QWidget*>(parent());
    setTransparent(p,useTransparent, transparent);
#endif
#if defined(USE_KDE) && defined(HAVE_KROOTPIXMAP_H)
    if (useTransparent()){
        rootpixmap->start();
    }else{
        rootpixmap->stop();
        saveBG = QPixmap();
        genBG = QPixmap();
        genFade = 0;
        emit backgroundUpdated();
    }
#endif
}
Ejemplo n.º 6
0
void KRootPixmap::updateBackground(KSharedPixmap *spm)
{
    QPixmap pm = *spm;

    if(m_Fade > 1e-6)
    {
        KPixmapIO io;
        QImage img = io.convertToImage(pm);
        img = KImageEffect::fade(img, m_Fade, m_FadeColor);
        pm = io.convertToPixmap(img);
    }

    if(!m_bCustomPaint)
        m_pWidget->setBackgroundPixmap(pm);
    else
    {
        emit backgroundUpdated(pm);
    }
}
Ejemplo n.º 7
0
void TransparentTop::transparentChanged()
{
#ifdef WIN32
    QWidget *p = static_cast<QWidget*>(parent());
    bool bTransparent = true;
    if (pMain->TransparentIfInactive) bTransparent = !p->isActiveWindow();
    setTransparent(p, useTransparent && bTransparent, transparent);
#endif
#if defined(USE_KDE) && defined(HAVE_KROOTPIXMAP_H)
    if (useTransparent){
        rootpixmap->start();
    }else{
        rootpixmap->stop();
        saveBG = QPixmap();
        genBG = QPixmap();
        genFade = 0;
        emit backgroundUpdated();
    }
#endif
}
Ejemplo n.º 8
0
void FboBlending::setBackgroundImage(ofImage* bg){
	this->backgroundImage = bg;
	backgroundUpdated();
}