Panels

Petri Damstén petri.damsten at gmail.com
Fri Apr 18 12:09:36 CEST 2008


On Friday 18 April 2008 12:55:28 Petri Damstén wrote:
> On Friday 18 April 2008 12:17:53 Aaron J. Seigo wrote:
> > On Friday 18 April 2008, Petri Damstén wrote:
> > > Only vertical panels seem to work on screen 1. Top/bottom panels that
> > > should be in screen 1 are drawn to screen 0. After a quick look I found
> > > that panel placement is a bit 'cryptic science'. Any hints where to
> > > start debugging?
> >
> > the placement is in workspace/plasma/pasma/panelview.cpp
> >
> > the screen association, etc, is currently in libplasma but will also be
> > moving into plasma soonish (if it hasn't already been done)...
>
> This places the panel at the correct screen, but now task manager does not
> work on those panels anymore, hmmm.
>
> Index: plasma/plasma/panelview.cpp
> ===================================================================
> --- plasma/plasma/panelview.cpp (revision 798427)
> +++ plasma/plasma/panelview.cpp (working copy)
> @@ -108,7 +108,7 @@
>      }
>
>      if (m_alignment != Qt::AlignCenter) {
> -        m_offset = qMax(m_offset, 0);
> +        m_offset = qMax(m_offset, screenGeom.x());
>      }

I guess this should be more like this:

Index: plasma/panelview.cpp
===================================================================
--- plasma/panelview.cpp        (revision 798427)
+++ plasma/panelview.cpp        (working copy)
@@ -111,11 +111,13 @@
         m_offset = qMax(m_offset, 0);
     }

-
     //Sanity controls
     switch (location()) {
     case Plasma::TopEdge:
     case Plasma::BottomEdge:
+        if (m_alignment != Qt::AlignCenter) {
+            m_offset = qMax(m_offset, screenGeom.left());
+        }
         //resize the panel if is too large
         if (geom.width() > screenGeom.width()) {
             geom.setWidth(screenGeom.width());
@@ -141,6 +143,9 @@

     case Plasma::LeftEdge:
     case Plasma::RightEdge:
+        if (m_alignment != Qt::AlignCenter) {
+            m_offset = qMax(m_offset, screenGeom.top());
+        }
         //resize the panel if is too tall
         if (geom.height() > screenGeom.height()) {
             geom.setHeight(screenGeom.height());

Petri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080418/444f6006/attachment.pgp 


More information about the Panel-devel mailing list