make sure a transparent window
This commit is contained in:
parent
603c6e4a9b
commit
1928ecce74
@ -99,12 +99,17 @@ DialogProxy::DialogProxy(QQuickItem *parent)
|
|||||||
m_activeWindow(false),
|
m_activeWindow(false),
|
||||||
m_location(Plasma::Floating)
|
m_location(Plasma::Floating)
|
||||||
{
|
{
|
||||||
|
QSurfaceFormat format;
|
||||||
|
format.setAlphaBufferSize(8);
|
||||||
|
setFormat(format);
|
||||||
|
setClearBeforeRendering(true);
|
||||||
|
setColor(QColor(Qt::transparent));
|
||||||
|
setFlags(Qt::FramelessWindowHint);
|
||||||
|
|
||||||
//m_dialog = new QQuickWindow();
|
//m_dialog = new QQuickWindow();
|
||||||
m_margins = new DialogMargins(m_dialog, this);
|
m_margins = new DialogMargins(m_dialog, this);
|
||||||
//m_dialog->installEventFilter(this);
|
//m_dialog->installEventFilter(this);
|
||||||
m_flags = flags();
|
m_flags = flags();
|
||||||
setWindowFlags(Qt::FramelessWindowHint);
|
|
||||||
setColor(Qt::transparent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogProxy::~DialogProxy()
|
DialogProxy::~DialogProxy()
|
||||||
@ -412,6 +417,18 @@ QObject *DialogProxy::margins() const
|
|||||||
return m_margins;
|
return m_margins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogProxy::resizeEvent(QResizeEvent *re)
|
||||||
|
{
|
||||||
|
if (contentItem()) {
|
||||||
|
contentItem()->setWidth(re->size().width());
|
||||||
|
contentItem()->setHeight(re->size().height());
|
||||||
|
}
|
||||||
|
if (m_mainItem) {
|
||||||
|
m_mainItem.data()->setWidth(re->size().width());
|
||||||
|
m_mainItem.data()->setHeight(re->size().height());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool DialogProxy::eventFilter(QObject *watched, QEvent *event)
|
bool DialogProxy::eventFilter(QObject *watched, QEvent *event)
|
||||||
{
|
{
|
||||||
if (watched == this && event->type() == QEvent::Move) {
|
if (watched == this && event->type() == QEvent::Move) {
|
||||||
|
@ -230,6 +230,7 @@ protected Q_SLOTS:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *watched, QEvent *event);
|
bool eventFilter(QObject *watched, QEvent *event);
|
||||||
|
void resizeEvent(QResizeEvent *re);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QQuickWindow *m_dialog;
|
QQuickWindow *m_dialog;
|
||||||
|
@ -36,20 +36,25 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Window {
|
PlasmaCore.Dialog {
|
||||||
id: popupWindow
|
id: popupWindow
|
||||||
|
//windowFlags: Qt.Popup
|
||||||
|
color: Qt.rgba(0,0,0,0)
|
||||||
visible: plasmoid.expanded
|
visible: plasmoid.expanded
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
plasmoid.expanded = false
|
plasmoid.expanded = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
width: 200
|
onWidthChanged: appletParent.width = width
|
||||||
height: 200
|
onHeightChanged:appletParent.height = height
|
||||||
Item {
|
mainItem: appletParent
|
||||||
|
Rectangle {
|
||||||
id: appletParent
|
id: appletParent
|
||||||
width: applet.implicitWidth
|
width: 200//applet.implicitWidth
|
||||||
height: applet.implicitHeight
|
height: 200//applet.implicitHeight
|
||||||
|
onWidthChanged: applet.width = width
|
||||||
|
onHeightChanged: applet.height = height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user