[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Creating a rectangular icon
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2010-02-26 23:57:18
Message-ID: 201002261557.18916.aseigo () kde ! org
[Download RAW message or body]

On February 26, 2010, Antony Loebs wrote:
> On Fri, Feb 26, 2010 at 11:40 AM, Marco Martin <notmart@gmail.com> wrote:
> > On Thu, Feb 25, 2010 at 10:29 PM, Antony Loebs
> > 
> > <barefootedjournalist@gmail.com> wrote:
> > >  I have been trying to figure out how to display a rectangular image in
> > 
> > the
> > 
> > > panel to use as a button. The image itself is 30x120, but I can't get
> > > it
> > 
> > to
> > 
> > > display to my satisfaction. If I use IconWidget, the image is squashed
> > 
> > into
> > 
> > > a square. If I use PushButton, the image is likewise squashed by the
> > > button's borders. I tried changing the stylesheet for the button,
> > > setting margin and padding to 0, but with no success. Below is the
> > > sample code
> > 
> > (the
> > 
> > > PushButton code is commented out).
> > 
> > to just display an image you probably want to use Label (yes, it can
> > display images and a click signaliirc)
> > 
> >  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. :)

> ---
> 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")


-- 
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
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic