DWIDGET_USE_NAMESPACE

DArrowRectangle::DArrowRectangle(ArrowDirection direction, QWidget * parent) :
    QWidget(parent),m_arrowDirection(direction)
{
    DGraphicsGlowEffect *glowEffect = new DGraphicsGlowEffect(this);
    glowEffect->setBlurRadius(shadowBlurRadius());
    glowEffect->setDistance(shadowDistance());
    glowEffect->setXOffset(shadowXOffset());
    glowEffect->setYOffset(shadowYOffset());
    setGraphicsEffect(glowEffect);
}
Пример #2
0
DUI_USE_NAMESPACE

DArrowRectangle::DArrowRectangle(ArrowDirection direction, QWidget * parent) :
    QWidget(parent),m_arrowDirection(direction)
{
    D_THEME_INIT_WIDGET(DArrowRectangle);

    setWindowFlags(Qt::SplashScreen);
    setAttribute(Qt::WA_TranslucentBackground);

    DGraphicsGlowEffect *glowEffect = new DGraphicsGlowEffect(this);
    glowEffect->setBlurRadius(shadowBlurRadius());
    glowEffect->setDistance(shadowDistance());
    glowEffect->setXOffset(shadowXOffset());
    glowEffect->setYOffset(shadowYOffset());
    setGraphicsEffect(glowEffect);
}
Пример #3
0
void DArrowRectangle::resizeWithContent()
{
    setFixedSize(getFixedSize());

    update();

#ifdef Q_OS_UNIX
    //Shadow Transparent For MouseEvents
    qreal delta = shadowBlurRadius() + shadowDistance();

    XRectangle m_contentXRect;
    m_contentXRect.x = 0;
    m_contentXRect.y = 0;
    m_contentXRect.width = width() - delta * 2;
    m_contentXRect.height = height() - delta * 2;
    XShapeCombineRectangles(QX11Info::display(), winId(), ShapeInput,
                            delta + shadowXOffset(),
                            delta + shadowYOffset(),
                            &m_contentXRect, 1, ShapeSet, YXBanded);
#endif
}