Top | ![]() |
![]() |
![]() |
![]() |
The XfcePanelImage is a widgets suitable for for example panel buttons where the developer does not exacly know the size of the image (due to theming and user setting).
The XfcePanelImage widget automatically scales to the allocated
size of the widget. Because of that nature it never requests a size,
so this will only work if you pack the image in another widget
that will expand it.
If you want to force an image size you can use xfce_panel_image_set_size()
to set a pixel size, in that case the widget will request an fixed size
which makes it usefull for usage in dialogs.
GtkWidget *
xfce_panel_image_new (void
);
Creates a new empty XfcePanelImage widget.
Since: 4.8
GtkWidget *
xfce_panel_image_new_from_pixbuf (GdkPixbuf *pixbuf
);
Creates a new XfcePanelImage displaying pixbuf
. XfcePanelImage
will add its own reference rather than adopting yours. You don't
need to scale the pixbuf to the correct size, the XfcePanelImage
will take care of that based on the allocation of the widget or
the size set with xfce_panel_image_set_size()
.
Since: 4.8
GtkWidget *
xfce_panel_image_new_from_source (const gchar *source
);
Creates a new XfcePanelImage displaying source
. XfcePanelImage
will detect if source
points to an absolute file or it and icon-name.
For icon-names it will also look for files in the pixbuf folder or
strip the extensions, which makes it suitable for usage with icon
keys in .desktop files.
Since: 4.8
void xfce_panel_image_set_from_pixbuf (XfcePanelImage *image
,GdkPixbuf *pixbuf
);
See xfce_panel_image_new_from_pixbuf()
for details.
Since: 4.8
void xfce_panel_image_set_from_source (XfcePanelImage *image
,const gchar *source
);
See xfce_panel_image_new_from_source()
for details.
image |
an XfcePanelImage. |
|
source |
source of the image. This can be an absolute path or
an icon-name or |
Since: 4.8
void xfce_panel_image_set_size (XfcePanelImage *image
,gint size
);
This will force an image size, instead of looking at the allocation
size, see introduction for more details. You can set a size
of
-1 to turn this off.
Since: 4.8
gint
xfce_panel_image_get_size (XfcePanelImage *image
);
The size of the image, set by xfce_panel_image_set_size()
or -1
if no size is forced and the image is scaled to the allocation size.
Since: 4.8
void
xfce_panel_image_clear (XfcePanelImage *image
);
Resets the image to be empty.
Since: 4.8
“size”
property“size” gint
Pixel size of the image.
Flags: Read / Write
Allowed values: [-1,128]
Default value: -1
“force-gtk-icon-sizes”
style property“force-gtk-icon-sizes” gboolean
Force the image to fix to GtkIconSizes.
Flags: Read / Write
Default value: FALSE