Creating a rectangular icon

Antony Loebs barefootedjournalist at gmail.com
Wed Mar 3 02:42:59 CET 2010


On Fri, Feb 26, 2010 at 6:57 PM, Aaron J. Seigo <aseigo at kde.org> wrote:

> On February 26, 2010, Antony Loebs wrote:
> > Two problems: one, I don't see how to make a click on a label register,
> > and two, while it looks fine on the desktop, if it is started in the
> panel
> > it is squashed horizontally (so the image looks like a vertical line
> about
> > four or five pixels wide). Additionally, when I rescale the panel, the
> > image scales vertically, but not horizontally.
>
> sounds like a layouting issue; you probably need to set a preferred and/or
> minimum size in your widget.
>
> remember that panels can be very small, however. it's never fun when a
> widget
> enforces a minimum size that's overly large. :)
>
>  Ok, when I added
self.layout.setPreferredWidth(120)
that displays it correctly, but now it doesn't expand or contract at all
horizontally. It does expand and contract vertically, however. What should I
add so that the height and the width of the image scale relative to each
other?

> ---
> > import subprocess
> >
> > self.button = Plasma.Label(self.applet)
> > self.button.setImage(self.package().path() + "contents/images/image.png")
>
> that should be: self.package().filePath("images", "image.png")
>

When I do that, I get a big red button with a white X. (This is using
4.4.1-0ubuntu1 on Kubuntu Lucid, just upgraded today.)

Also, I still can't get clicks on the label to register with
self.connect(self.button, SIGNAL("linkActivated()"), self.notify)
Any hints?

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20100302/8d7d1f98/attachment.htm 


More information about the Plasma-devel mailing list