add screen information into debug window

pull/1/head
Michail Vourlakos 8 years ago
parent 9259a28cde
commit f46848e039

@ -116,11 +116,14 @@ void DockView::init()
{
connect(this, &QQuickWindow::screenChanged, this, &DockView::screenChanged);
connect(qGuiApp, &QGuiApplication::screenAdded, this, &DockView::reconsiderScreen);
connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, &DockView::reconsiderScreen);
connect(qGuiApp, &QGuiApplication::screenAdded, this, &DockView::screenChanged);
connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, &DockView::screenChanged);
connect(this, &DockView::screenGeometryChanged, this, &DockView::syncGeometry);
connect(this, &QQuickWindow::xChanged, this, &DockView::xChanged);
connect(this, &QQuickWindow::yChanged, this, &DockView::yChanged);
connect(this, &QQuickWindow::widthChanged, this, &DockView::widthChanged);
connect(this, &QQuickWindow::heightChanged, this, &DockView::heightChanged);
connect(corona(), &Plasma::Corona::availableScreenRectChanged, this, [&]() {
if (formFactor() == Plasma::Types::Vertical)
syncGeometry();
@ -207,6 +210,7 @@ void DockView::reconsiderScreen()
foreach(auto scr, qGuiApp->screens()){
if (scr && scr->name() == m_screenToFollowId){
connect(scr, &QScreen::geometryChanged, this, &DockView::screenGeometryChanged);
setScreenToFollow(scr);
syncGeometry();
}
@ -217,11 +221,11 @@ void DockView::reconsiderScreen()
void DockView::screenChanged(QScreen *scr)
{
if (!scr || m_screenToFollow == scr) {
return;
}
// if (!scr || m_screenToFollow == scr) {
// return;
// }
qDebug() << "Screen inconsistency!!! :" << scr->name() << " - " <<m_screenToFollow->name();
// qDebug() << "Screen inconsistency!!! :" << scr->name() << " - " <<m_screenToFollow->name();
QTimer::singleShot(2500, this, &DockView::reconsiderScreen);
/*bool found{false};
@ -650,6 +654,16 @@ QRect DockView::absGeometry() const
return m_absGeometry;
}
QRect DockView::screenGeometry() const
{
if (this->screen()) {
QRect geom = this->screen()->geometry();
return geom;
}
return QRect();
}
int DockView::shadow() const
{
return m_shadow;

@ -47,6 +47,8 @@ class DockView : public PlasmaQuick::ContainmentView {
Q_PROPERTY(int alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
Q_PROPERTY(int docksCount READ docksCount NOTIFY docksCountChanged)
Q_PROPERTY(int x READ x NOTIFY xChanged)
Q_PROPERTY(int y READ y NOTIFY yChanged)
Q_PROPERTY(int width READ width NOTIFY widthChanged)
Q_PROPERTY(int height READ height NOTIFY heightChanged)
Q_PROPERTY(int maxThickness READ maxThickness WRITE setMaxThickness NOTIFY maxThicknessChanged)
@ -63,6 +65,9 @@ class DockView : public PlasmaQuick::ContainmentView {
Q_PROPERTY(VisibilityManager *visibility READ visibility NOTIFY visibilityChanged)
Q_PROPERTY(QQmlListProperty<QScreen> screens READ screens)
Q_PROPERTY(QRect screenGeometry READ screenGeometry NOTIFY screenGeometryChanged)
public:
DockView(Plasma::Corona *corona, QScreen *targetScreen = nullptr);
virtual ~DockView();
@ -103,6 +108,8 @@ public:
void updateAbsDockGeometry(const QRect &localDockGeometry);
QRect absGeometry() const;
QRect screenGeometry() const;
Plasma::FrameSvg::EnabledBorders enabledBorders() const;
QString currentScreen() const;
@ -153,7 +160,10 @@ signals:
void normalThicknessChanged();
void visibilityChanged();
void maskAreaChanged();
void screenGeometryChanged();
void shadowChanged();
void xChanged();
void yChanged();
void absGeometryChanged(const QRect &geometry);

@ -37,19 +37,35 @@ Window{
columns: 2
Text{
text: "Window Width"+space
text: "Screen id"+space
}
Text{
text: dock.width
text: dock.currentScreen
}
Text{
text: "Window Height"+space
text: "Screen Geometry"+space
}
Text{
text: dock.height
text: dock.screenGeometry.x+","+dock.screenGeometry.y+ " "+dock.screenGeometry.width+"x"+dock.screenGeometry.height
}
Text{
text: "Window Geometry"+space
}
Text{
text: dock.x + "," + dock.y + " "+dock.width+ "x"+dock.height
}
Text{
text: " ----------- "
}
Text{
text: " ----------- "
}
Text{

Loading…
Cancel
Save