Offset from Plasma Theme?

Michail Vourlakos mvourlakos at gmail.com
Tue Jul 3 13:30:30 UTC 2012


Στις 03/07/2012 02:55 μμ, ο/η Marco Martin έγραψε:
> On Mon, Jul 2, 2012 at 6:01 PM, Michail Vourlakos <mvourlakos at gmail.com> wrote:
>> actually it works as you can see in the second video but in order to find
>> proper x,y for each
>> window thumbnail I need:
>> 1. x,y of the plasmoid,
>> 2. offset of Plasma Theme decoration
>> 3. x,y inside the main QML Element
>> -so the real x,y is 1+2+3,
>> 1. I can find it through the plasmoid geometry,
>> 2. I am searching to find, (???)
>> 3. I know it of course from inside QML.
>>
>> Plasma::WindowEffects::showWindowThumbnails needs as first parameter a WId.
>> A plasmoid
>> I think does not have a WId, instead desktops WId or Dashboard WId is used I
>> think through:
>>
>> view()->winId();
> this is correct, is the most reliable (even tough never 100%) way to
> get the actual window that is the qgraphicsview.
> in cases of popups may be that the view is child of another widget, so
> try with view()->effectiveWinId()
Marco it tried view()->effectiveWinId() but I had no success with the 
popup, it works like
the view()->winId(); in my use case,
>
> then, while you can't really know the width of the plasmoid borders
> you don't need it here, you need only to know the borders of the
> thumbnails borders, that is whatever svg you used. in FrameSvg you use
> getMargins/marginsSize

I am not that sure. I use a Rectangle element in qml with no borders at 
all in order to get
a generic x,y for my main QML element.
in order to achieve a perfect match for the previews I have to compute:
(1)+(2)+(3)
(2) for me is x=13 and y=40, I think it's Oxygen's default plasma theme 
border

Cheers,
Michail Vourlakos
> Cheers,
> Marco Martin
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>




More information about the Plasma-devel mailing list