Browse Source

Add set and get functions for XfcePanelImage size.

upstream/xfce4-panel-4.10.1
Nick Schermer 12 years ago
parent
commit
4111bb2781
  1. 2
      docs/references/libxfce4panel-sections.txt
  2. 2
      libxfce4panel/libxfce4panel.symbols
  3. 37
      libxfce4panel/xfce-panel-image.c
  4. 5
      libxfce4panel/xfce-panel-image.h

2
docs/references/libxfce4panel-sections.txt

@ -68,6 +68,8 @@ xfce_panel_image_new_from_pixbuf
xfce_panel_image_new_from_source
xfce_panel_image_set_from_pixbuf
xfce_panel_image_set_from_source
xfce_panel_image_set_size
xfce_panel_image_get_size
xfce_panel_image_clear
<SUBSECTION Standard>
XfcePanelImageClass

2
libxfce4panel/libxfce4panel.symbols

@ -77,6 +77,8 @@ xfce_panel_image_new_from_pixbuf G_GNUC_MALLOC
xfce_panel_image_new_from_source G_GNUC_MALLOC
xfce_panel_image_set_from_pixbuf
xfce_panel_image_set_from_source
xfce_panel_image_set_size
xfce_panel_image_get_size
xfce_panel_image_clear
#endif
#endif

37
libxfce4panel/xfce-panel-image.c

@ -232,9 +232,6 @@ xfce_panel_image_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
XfcePanelImagePrivate *priv;
gint size;
switch (prop_id)
{
case PROP_SOURCE:
@ -248,13 +245,8 @@ xfce_panel_image_set_property (GObject *object,
break;
case PROP_SIZE:
priv = XFCE_PANEL_IMAGE (object)->priv;
size = g_value_get_int (value);
if (G_LIKELY (priv->size != size))
{
priv->size = size;
gtk_widget_queue_resize (GTK_WIDGET (object));
}
xfce_panel_image_set_size (XFCE_PANEL_IMAGE (object),
g_value_get_int (value));
break;
default:
@ -548,6 +540,31 @@ xfce_panel_image_set_from_source (XfcePanelImage *image,
void
xfce_panel_image_set_size (XfcePanelImage *image,
gint size)
{
g_return_if_fail (XFCE_IS_PANEL_IMAGE (image));
if (G_LIKELY (image->priv->size != size))
{
image->priv->size = size;
gtk_widget_queue_resize (GTK_WIDGET (image));
}
}
gint
xfce_panel_image_get_size (XfcePanelImage *image)
{
g_return_val_if_fail (XFCE_IS_PANEL_IMAGE (image), -1);
return image->priv->size;
}
void
xfce_panel_image_clear (XfcePanelImage *image)
{

5
libxfce4panel/xfce-panel-image.h

@ -71,6 +71,11 @@ void xfce_panel_image_set_from_pixbuf (XfcePanelImage *image,
void xfce_panel_image_set_from_source (XfcePanelImage *image,
const gchar *source);
void xfce_panel_image_set_size (XfcePanelImage *image,
gint size);
gint xfce_panel_image_get_size (XfcePanelImage *image);
void xfce_panel_image_clear (XfcePanelImage *image);
G_END_DECLS

Loading…
Cancel
Save