diff --git a/shell/desktopcorona.cpp b/shell/desktopcorona.cpp index 42a7cb28b..03b5575f9 100644 --- a/shell/desktopcorona.cpp +++ b/shell/desktopcorona.cpp @@ -186,6 +186,7 @@ void DesktopCorona::checkViews() } else if (m_views.count() < m_desktopWidget->screenCount()) { for (int i = m_views.count(); i < m_desktopWidget->screenCount(); ++i) { View *view = new View(this); + view->init(); view->show(); m_views << view; @@ -207,12 +208,14 @@ void DesktopCorona::checkViews() void DesktopCorona::updateScreenOwner(int wasScreen, int isScreen, Plasma::Containment *containment) { qDebug() << "Was screen" << wasScreen << "Is screen" << isScreen <<"Containment" << containment; - + if (containment->formFactor() == Plasma::Horizontal || containment->formFactor() == Plasma::Vertical) { if (isScreen >= 0) { m_panelViews[containment] = new PanelView(this); + m_panelViews[containment]->init(); + m_panelViews[containment]->setContainment(containment); m_panelViews[containment]->show(); } else { if (m_panelViews.contains(containment)) { diff --git a/shell/panelview.cpp b/shell/panelview.cpp index 168a2c0a9..7c1129406 100644 --- a/shell/panelview.cpp +++ b/shell/panelview.cpp @@ -23,9 +23,13 @@ PanelView::PanelView(Plasma::Corona *corona, QWindow *parent) : View(corona, parent) { + //FIXME: this works only if done in View QSurfaceFormat format; format.setAlphaBufferSize(8); setFormat(format); + setClearBeforeRendering(true); + setColor(QColor(Qt::transparent)); + setFlags(Qt::FramelessWindowHint); } PanelView::~PanelView() diff --git a/shell/qmlpackages/desktop/contents/ui/main.qml b/shell/qmlpackages/desktop/contents/ui/main.qml index 420c73af4..f7fc186ab 100644 --- a/shell/qmlpackages/desktop/contents/ui/main.qml +++ b/shell/qmlpackages/desktop/contents/ui/main.qml @@ -25,6 +25,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore Rectangle { id: root color: "red" + radius: 10 width: 640 height: 480 diff --git a/shell/view.cpp b/shell/view.cpp index d2c0f44e5..eacfbe77e 100644 --- a/shell/view.cpp +++ b/shell/view.cpp @@ -28,12 +28,6 @@ View::View(Plasma::Corona *corona, QWindow *parent) : QQuickView(parent), m_corona(corona) { - if (!m_corona->package().isValid()) { - qWarning() << "Invalid home screen package"; - } - - setResizeMode(View::SizeRootObjectToView); - setSource(QUrl::fromLocalFile(m_corona->package().filePath("mainscript"))); } View::~View() @@ -41,7 +35,15 @@ View::~View() } +void View::init() +{ + if (!m_corona->package().isValid()) { + qWarning() << "Invalid home screen package"; + } + setResizeMode(View::SizeRootObjectToView); + setSource(QUrl::fromLocalFile(m_corona->package().filePath("mainscript"))); +} void View::setContainment(Plasma::Containment *cont) { diff --git a/shell/view.h b/shell/view.h index 49045424d..78d8139fb 100644 --- a/shell/view.h +++ b/shell/view.h @@ -34,6 +34,9 @@ public: View(Plasma::Corona *corona, QWindow *parent = 0); virtual ~View(); + //FIXME: not super nice, but we have to be sure qml assignment is done after window flags + void init(); + void setContainment(Plasma::Containment *cont); Plasma::Containment *containment() const;