示例#1
0
TransparentTop::TransparentTop(QWidget *parent, unsigned transparent)
        : QObject(parent)
{
    m_transparent = transparent * 0.01;
    rootpixmap = new KRootPixmap(parent);
    rootpixmap->setCustomPainting(true);
    connect(rootpixmap, SIGNAL(backgroundUpdated(const QPixmap&)), this, SLOT(backgroundUpdated(const QPixmap&)));
    transparentChanged();
}
示例#2
0
TransparentTop::TransparentTop(QWidget *parent,
                               ConfigBool &_useTransparent, ConfigULong &_transparent)
        : QObject(parent, _TRANSPARENT),
        useTransparent(_useTransparent),
        transparent(_transparent)
{
#if defined(USE_KDE) && defined(HAVE_KROOTPIXMAP_H)
    rootpixmap = new KRootPixmap(parent);
#endif
    QObjectList *l = parent->queryList("TransparentBg");
    QObjectListIt it(*l);
    QObject *obj;
    while ((obj = it.current()) != NULL){
        TransparentBg *transp = static_cast<TransparentBg*>(obj);
        transp->init(parent);
        ++it;
    }
    connect(pMain, SIGNAL(transparentChanged()), this, SLOT(transparentChanged()));
    transparentChanged();
}
示例#3
0
bool TransparentTop::eventFilter(QObject*, QEvent *e)
{
    switch (e->type()){
    case QEvent::WindowActivate:
    case QEvent::WindowDeactivate:
        transparentChanged();
        break;
    default:
        break;
    }
    return false;
}
示例#4
0
TransparentTop::TransparentTop(QWidget *parent, unsigned transparent)
        : QObject(parent)
{
    m_transparent = transparent * 0.01;
    rootpixmap = new KRootPixmap(parent);
#if COMPAT_QT_VERSION < 0x030000
    parent->installEventFilter(this);
#else
rootpixmap->setCustomPainting(true);
    connect(rootpixmap, SIGNAL(backgroundUpdated(const QPixmap&)), this, SLOT(backgroundUpdated(const QPixmap&)));
#endif
    transparentChanged();
}
示例#5
0
void TransparentTop::setTransparent(unsigned transparent)
{
    m_transparent = transparent * 0.01;
    transparentChanged();
}