Re: Plasma::Svg::paint

2011-05-04 Thread Aaron J. Seigo
On Wednesday, May 4, 2011 00:06:26 Alex Merry wrote:
> My question is: what is intended to happen here?  bubblemon was assuming

if the Svg containsMultipleImages, then the element should be scaled to the 
Svg's size. if the Svg does not containMultipleImages, then the elements 
should be scaled relative to the Svg's size (e.g. what bubblemon expects). 

this is why Plasma::IconWidget::setSvg, which the system tray uses, has this 
line:

d->iconSvg->setContainsMultipleImages(!elementId.isNull());

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Plasma::Svg::paint

2011-05-04 Thread Marco Martin
On Wednesday 04 May 2011, Alex Merry wrote:
> I have a question about the way Plasma::Svg::paint is supposed to work
> when an elementId is given, but a size is not.
> 

did you do setContanisMultipleElements(true)?


-- 
Marco Martin
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Plasma::Svg::paint

2011-05-03 Thread Alex Merry
I have a question about the way Plasma::Svg::paint is supposed to work 
when an elementId is given, but a size is not.

The context for this is a bug I was fixing in bubblemon.  The bubblemon 
SVG has three elements; the background, the glass and the bubble.  The 
bubble is smaller than the other two elements.

The bubblemon applet resizes the bubblemon SVG to fit, and can retreive 
the scaled size of the bubble using Plasma::Svg::elementSize.  This 
works as expected: if the SVG has been scaled to half its natural size, 
m_svg->elementSize("bubble") will return a size half the natural size of 
the bubble element.

The problem comes when doing m_svg->paint(p, QPointF(x, y), "bubble").  
This will not paint the bubble at the scaled size.  Nor will it paint 
the bubble at the bubble's natural size.  Instead, it will paint the 
bubble at the size m_svg->size(); the scaled size of the whole SVG.

My question is: what is intended to happen here?  bubblemon was assuming 
that the bubble element would be scaled appropriately.  However, the 
systemtray applet, for example, assumes the current behaviour when 
drawing the "show hidden tasks" arrow.  The API documentation doesn't 
say either way.

Alex
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel