attempt to make the panel work
FIXME: setting transparency doesn't seem to work. it works correctly only if done in the View constructor, not the PanelView one
This commit is contained in:
parent
d105b1bd3f
commit
613f373118
@ -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)) {
|
||||
|
@ -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()
|
||||
|
@ -25,6 +25,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
Rectangle {
|
||||
id: root
|
||||
color: "red"
|
||||
radius: 10
|
||||
width: 640
|
||||
height: 480
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user