[Xfce4-commits] ArrowButton: better handling of minimum sizes.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 20202a2432490490f4ff246babd37aa8205147cb (commit)
   from 866af5da283392b63ba23fe560154ec1e4c87582 (commit)

commit 20202a2432490490f4ff246babd37aa8205147cb
Author: Andrzej 
Date:   Wed Apr 17 21:10:09 2013 +0100

ArrowButton: better handling of minimum sizes.

 libxfce4panel/xfce-arrow-button.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/libxfce4panel/xfce-arrow-button.c 
b/libxfce4panel/xfce-arrow-button.c
index bcd06b0..c571256 100644
--- a/libxfce4panel/xfce-arrow-button.c
+++ b/libxfce4panel/xfce-arrow-button.c
@@ -305,7 +305,7 @@ xfce_arrow_button_draw (GtkWidget *widget,
 {
   width = (gdouble) MIN (alloc.height - padding.top - padding.bottom - 
border.top - border.bottom,
  alloc.width  - padding.left - padding.right - 
border.left - border.right);
-  width = (gdouble) CLAMP (width, 1.0, (gdouble) ARROW_WIDTH);
+  width = (gdouble) CLAMP (width, 0.0, (gdouble) ARROW_WIDTH);
 
   x = (gdouble) (alloc.width - width) / 2.0;
   y = (gdouble) (alloc.height - width) / 2.0;
@@ -323,7 +323,8 @@ xfce_arrow_button_draw (GtkWidget *widget,
 }
   gtk_style_context_get_color (context, gtk_widget_get_state_flags 
(widget), &fg_rgba);
   gdk_cairo_set_source_rgba (cr, &fg_rgba);
-  gtk_render_arrow (context, cr, angle, x, y, width);
+  if (width > 0)
+gtk_render_arrow (context, cr, angle, x, y, width);
 }
 
   return TRUE;
@@ -354,7 +355,6 @@ xfce_arrow_button_get_preferred_width (GtkWidget *widget,
 {
 case GTK_ARROW_UP:
 case GTK_ARROW_DOWN:
-  minimum_child_width += ARROW_WIDTH;
   natural_child_width += ARROW_WIDTH;
   break;
 
@@ -369,7 +369,7 @@ xfce_arrow_button_get_preferred_width (GtkWidget *widget,
   gtk_style_context_get_padding (context, gtk_widget_get_state_flags 
(widget), &padding);
   gtk_style_context_get_border (context, gtk_widget_get_state_flags 
(widget), &border);
   natural_child_width = (ARROW_WIDTH + padding.left + padding.right + 
border.left + border.right);
-  minimum_child_width = natural_child_width;
+  minimum_child_width = natural_child_width - ARROW_WIDTH;
 }
 
   if (minimum_width != NULL)
@@ -404,7 +404,6 @@ xfce_arrow_button_get_preferred_height (GtkWidget *widget,
 {
 case GTK_ARROW_LEFT:
 case GTK_ARROW_RIGHT:
-  minimum_child_height += ARROW_WIDTH;
   natural_child_height += ARROW_WIDTH;
   break;
 
@@ -419,7 +418,7 @@ xfce_arrow_button_get_preferred_height (GtkWidget *widget,
   gtk_style_context_get_padding (context, gtk_widget_get_state_flags 
(widget), &padding);
   gtk_style_context_get_border (context, gtk_widget_get_state_flags 
(widget), &border);
   natural_child_height = (ARROW_WIDTH + padding.top + padding.bottom + 
border.top + border.bottom);
-  minimum_child_height = natural_child_height;
+  minimum_child_height = natural_child_height - ARROW_WIDTH;
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ArrowButton: sizing fixes.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 368aedcef78da3c753ef32882aca3b86fbec99c2 (commit)
   from 8774af02f8ea29c43dc1bec53626bfee5b480faa (commit)

commit 368aedcef78da3c753ef32882aca3b86fbec99c2
Author: Andrzej 
Date:   Wed Apr 17 01:57:34 2013 +0100

ArrowButton: sizing fixes.

 libxfce4panel/xfce-arrow-button.c |   91 +
 1 file changed, 61 insertions(+), 30 deletions(-)

diff --git a/libxfce4panel/xfce-arrow-button.c 
b/libxfce4panel/xfce-arrow-button.c
index a9363de..bcd06b0 100644
--- a/libxfce4panel/xfce-arrow-button.c
+++ b/libxfce4panel/xfce-arrow-button.c
@@ -79,10 +79,10 @@ static void xfce_arrow_button_finalize 
(GObject   *o
 static gboolean xfce_arrow_button_draw (GtkWidget 
*widget,
 cairo_t   
*cr);
 static void xfce_arrow_button_get_preferred_width  (GtkWidget 
*widget,
-gint  
*minimal_width,
+gint  
*minimum_width,
 gint  
*natural_width);
 static void xfce_arrow_button_get_preferred_height (GtkWidget 
*widget,
-gint  
*minimal_height,
+gint  
*minimum_height,
 gint  
*natural_height);
 #else
 static gboolean xfce_arrow_button_expose_event (GtkWidget 
*widget,
@@ -269,7 +269,7 @@ xfce_arrow_button_draw (GtkWidget *widget,
   GtkAllocationalloc;
   gdouble  angle;
   GtkStyleContext *context;
-  GtkBorderpadding;
+  GtkBorderpadding, border;
   GdkRGBA  fg_rgba;
 
   /* draw the button */
@@ -282,6 +282,7 @@ xfce_arrow_button_draw (GtkWidget *widget,
   child = gtk_bin_get_child (GTK_BIN (widget));
   context = gtk_widget_get_style_context (widget);
   gtk_style_context_get_padding (context, gtk_widget_get_state_flags 
(widget), &padding);
+  gtk_style_context_get_border (context, gtk_widget_get_state_flags 
(widget), &border);
 
   if (child != NULL
   && gtk_widget_get_visible (child))
@@ -290,20 +291,20 @@ xfce_arrow_button_draw (GtkWidget *widget,
   || button->priv->arrow_type == GTK_ARROW_DOWN)
 {
   width = (gdouble) ARROW_WIDTH;
-  x = (gdouble) padding.left;
+  x = (gdouble) padding.left + border.left;
   y = (gdouble) (alloc.height - width) / 2.0;
 }
   else
 {
   width = (gdouble) ARROW_WIDTH;
   x = (gdouble) (alloc.width - width) / 2.0;
-  y = (gdouble) padding.top;
+  y = (gdouble) padding.top + border.top;
 }
 }
   else
 {
-  width = (gdouble) MIN (alloc.height - padding.top - padding.bottom,
- alloc.width  - padding.left - padding.right);
+  width = (gdouble) MIN (alloc.height - padding.top - padding.bottom - 
border.top - border.bottom,
+ alloc.width  - padding.left - padding.right - 
border.left - border.right);
   width = (gdouble) CLAMP (width, 1.0, (gdouble) ARROW_WIDTH);
 
   x = (gdouble) (alloc.width - width) / 2.0;
@@ -313,13 +314,16 @@ xfce_arrow_button_draw (GtkWidget *widget,
   switch (button->priv->arrow_type)
 {
 case GTK_ARROW_DOWN:  angle = G_PI;
+  break;
 case GTK_ARROW_LEFT:  angle = G_PI / 2.0 + G_PI;
+  break;
 case GTK_ARROW_RIGHT: angle = G_PI / 2.0;
+  break;
 default:  angle = 0.0;
 }
   gtk_style_context_get_color (context, gtk_widget_get_state_flags 
(widget), &fg_rgba);
   gdk_cairo_set_source_rgba (cr, &fg_rgba);
-  gtk_render_arrow (context, cr, angle, x, y, ARROW_WIDTH);
+  gtk_render_arrow (context, cr, angle, x, y, width);
 }
 
   return TRUE;
@@ -327,28 +331,31 @@ xfce_arrow_button_draw (GtkWidget *widget,
 
 
 
-static void 
+static void
 xfce_arrow_button_get_preferred_width (GtkWidget *widget,
-   gint  *minimal_width,
+   gint  *minimum_width,
gint  *natural_width)
 {
   XfceArrowButton *button = XFCE_ARROW_BUTTON (widget);
   GtkWidget   *child;
-
-  /* use gtk for the widget size */
-  (*GTK_WIDGET_CLASS (xfce_arrow_button_parent_class)->get_preferred_width) 
(widget, minimal_width, natural_width);
+  gint minimum_child_width, natural_child_width;
+ 

[Xfce4-commits] PanelImage: better handling of minimum sizes.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 866af5da283392b63ba23fe560154ec1e4c87582 (commit)
   from 8fff5877bbca65545f9dcfac788aa48fcf037f3e (commit)

commit 866af5da283392b63ba23fe560154ec1e4c87582
Author: Andrzej 
Date:   Wed Apr 17 21:09:27 2013 +0100

PanelImage: better handling of minimum sizes.

 libxfce4panel/xfce-panel-image.c |   40 --
 1 file changed, 17 insertions(+), 23 deletions(-)

diff --git a/libxfce4panel/xfce-panel-image.c b/libxfce4panel/xfce-panel-image.c
index 1783f39..ded78ea 100644
--- a/libxfce4panel/xfce-panel-image.c
+++ b/libxfce4panel/xfce-panel-image.c
@@ -359,30 +359,27 @@ xfce_panel_image_get_preferred_width (GtkWidget *widget,
   XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
   GtkAllocation  alloc;
   gint   width, width_min;
-#ifdef GTK_BUTTON_SIZING_FIX
-  gint   correction;
-#endif
 
   if (priv->size > 0)
-width = width_min = priv->size;
+width = priv->size;
   else if (priv->pixbuf != NULL)
-{
-  width = gdk_pixbuf_get_width (priv->pixbuf);
-  width_min = width / 2;
-}
+width = gdk_pixbuf_get_width (priv->pixbuf);
   else
 {
   gtk_widget_get_allocation (widget, &alloc);
   width = alloc.width;
-  width_min = width / 2;
 }
 
 #ifdef GTK_BUTTON_SIZING_FIX
-  correction = xfce_panel_image_padding_correction (widget);
-  width -= correction;
-  width_min -= correction;
+  width -= xfce_panel_image_padding_correction (widget);
+  width = MAX (width, 0);
 #endif
 
+  if (priv->size > 0)
+width_min = width;
+  else
+width_min = 0;
+
   if (minimum_width != NULL)
 *minimum_width = width_min;
 
@@ -400,30 +397,27 @@ xfce_panel_image_get_preferred_height (GtkWidget *widget,
   XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
   GtkAllocation  alloc;
   gint   height, height_min;
-#ifdef GTK_BUTTON_SIZING_FIX
-  gint   correction;
-#endif
 
   if (priv->size > 0)
 height = height_min = priv->size;
   else if (priv->pixbuf != NULL)
-{
-  height = gdk_pixbuf_get_height (priv->pixbuf);
-  height_min = height / 2;
-}
+height = gdk_pixbuf_get_height (priv->pixbuf);
   else
 {
   gtk_widget_get_allocation (widget, &alloc);
   height = alloc.height;
-  height_min = height / 2;
 }
 
 #ifdef GTK_BUTTON_SIZING_FIX
-  correction = xfce_panel_image_padding_correction (widget);
-  height -= correction;
-  height_min -= correction;
+  height -= xfce_panel_image_padding_correction (widget);
+  height = MAX (height, 0);
 #endif
 
+  if (priv->size > 0)
+height_min = height;
+  else
+height_min = 0;
+
   if (minimum_height != NULL)
 *minimum_height = height_min;
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] panel-image: use style-update signal rather than style-set.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 50462009c0fa6ab1097f393dee97042b1be4471e (commit)
   from 700769744a13cb166214c9ddda1e987b1ad5ef04 (commit)

commit 50462009c0fa6ab1097f393dee97042b1be4471e
Author: Andrzej 
Date:   Sun Apr 14 01:09:57 2013 +0100

panel-image: use style-update signal rather than style-set.

Doesn't seem to make any difference here but style-set is deprecated
since Gtk+ 3.0.

 libxfce4panel/xfce-panel-image.c |   43 +-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/libxfce4panel/xfce-panel-image.c b/libxfce4panel/xfce-panel-image.c
index 1fd96d4..b5afae6 100644
--- a/libxfce4panel/xfce-panel-image.c
+++ b/libxfce4panel/xfce-panel-image.c
@@ -134,8 +134,12 @@ static gboolean   xfce_panel_image_draw 
(GtkWidget   *widget
 static gboolean   xfce_panel_image_expose_event (GtkWidget   
*widget,
  GdkEventExpose  
*event);
 #endif
+#if GTK_CHECK_VERSION (3, 0, 0)
+static void   xfce_panel_image_style_updated(GtkWidget   
*widget);
+#else
 static void   xfce_panel_image_style_set(GtkWidget   
*widget,
  GtkStyle
*previous_style);
+#endif
 static gboolean   xfce_panel_image_load (gpointer 
data);
 static void   xfce_panel_image_load_destroy (gpointer 
data);
 static GdkPixbuf *xfce_panel_image_scale_pixbuf (GdkPixbuf   
*source,
@@ -171,10 +175,11 @@ xfce_panel_image_class_init (XfcePanelImageClass *klass)
   gtkwidget_class->size_allocate = xfce_panel_image_size_allocate;
 #if GTK_CHECK_VERSION (3, 0, 0)
   gtkwidget_class->draw = xfce_panel_image_draw;
+  gtkwidget_class->style_updated = xfce_panel_image_style_updated;
 #else
   gtkwidget_class->expose_event = xfce_panel_image_expose_event;
-#endif
   gtkwidget_class->style_set = xfce_panel_image_style_set;
+#endif
 
   g_object_class_install_property (gobject_class,
PROP_SOURCE,
@@ -525,6 +530,41 @@ xfce_panel_image_expose_event (GtkWidget  *widget,
 
 
 
+#if GTK_CHECK_VERSION (3, 0, 0)
+static void
+xfce_panel_image_style_updated (GtkWidget *widget)
+{
+  XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
+  gboolean   force;
+
+  /* let gtk update the widget style */
+  (*GTK_WIDGET_CLASS (xfce_panel_image_parent_class)->style_updated) (widget);
+
+  /* get style property */
+  gtk_widget_style_get (widget, "force-gtk-icon-sizes", &force, NULL);
+
+  /* update if needed */
+  if (priv->force_icon_sizes != force)
+{
+  priv->force_icon_sizes = force;
+  if (priv->size > 0)
+gtk_widget_queue_resize (widget);
+}
+
+  /* update the icon if we have an icon-name source */
+  if (priv->source != NULL
+  && !g_path_is_absolute (priv->source))
+{
+  /* unset the size to force an update */
+  priv->width = priv->height = -1;
+  gtk_widget_queue_resize (widget);
+}
+}
+#endif
+
+
+
+#if !GTK_CHECK_VERSION (3, 0, 0)
 static void
 xfce_panel_image_style_set (GtkWidget *widget,
 GtkStyle  *previous_style)
@@ -555,6 +595,7 @@ xfce_panel_image_style_set (GtkWidget *widget,
   gtk_widget_queue_resize (widget);
 }
 }
+#endif
 
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] PanelImage: reworked workaround for GtkButton sizing issue.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to bbd0001c3c89946bb63c1b5c78b129eeb4bce3e8 (commit)
   from 87ce7cdb2d348715d90793c563d7a747114f69e8 (commit)

commit bbd0001c3c89946bb63c1b5c78b129eeb4bce3e8
Author: Andrzej 
Date:   Mon Apr 15 21:34:04 2013 +0100

PanelImage: reworked workaround for GtkButton sizing issue.

It should now work in all scenarios (custom buttons, can_focus=FALSE etc.)

 libxfce4panel/xfce-panel-image.c |   48 ++
 1 file changed, 48 insertions(+)

diff --git a/libxfce4panel/xfce-panel-image.c b/libxfce4panel/xfce-panel-image.c
index 7acb239..6d9687d 100644
--- a/libxfce4panel/xfce-panel-image.c
+++ b/libxfce4panel/xfce-panel-image.c
@@ -308,6 +308,48 @@ xfce_panel_image_finalize (GObject *object)
 
 
 
+//#if GTK_CHECK_VERSION (3, 0, 0) && !GTK_CHECK_VERSION (3, 10, 0)
+#if GTK_CHECK_VERSION (3, 0, 0)
+#define GTK_BUTTON_SIZING_FIX
+#endif
+
+#ifdef GTK_BUTTON_SIZING_FIX
+/* When can_focus is true, GtkButton allocates larger size than requested *
+ * and causes the panel image to grow indefinitely.   *
+ * This workaround compensates for this difference.   *
+ * Details in https://bugzilla.gnome.org/show_bug.cgi?id=698030   *
+ */
+static gint
+xfce_panel_image_padding_correction (GtkWidget *widget)
+{
+  GtkWidget *parent;
+  GtkStyleContext   *context;
+  gint   focus_width;
+  gint   focus_pad;
+  gint   correction;
+
+  parent = gtk_widget_get_parent (widget);
+  if (parent != NULL &&
+  GTK_IS_BUTTON (parent) &&
+  !gtk_widget_get_can_focus (parent))
+{
+  context = gtk_widget_get_style_context (parent);
+  gtk_style_context_get_style (context,
+   "focus-line-width", &focus_width,
+   "focus-padding", &focus_pad,
+   NULL);
+  correction = (focus_width + focus_pad) * 2;
+}
+  else
+{
+  correction = 0;
+}
+
+  return correction;
+}
+#endif
+
+
 #if GTK_CHECK_VERSION (3, 0, 0)
 static void
 xfce_panel_image_get_preferred_width (GtkWidget *widget,
@@ -324,6 +366,9 @@ xfce_panel_image_get_preferred_width (GtkWidget *widget,
   else
 {
   gtk_widget_get_allocation (widget, &alloc);
+#ifdef GTK_BUTTON_SIZING_FIX
+  alloc.width -= xfce_panel_image_padding_correction (widget);
+#endif
   *minimal_width = alloc.width;
 }
 
@@ -347,6 +392,9 @@ xfce_panel_image_get_preferred_height (GtkWidget *widget,
   else
 {
   gtk_widget_get_allocation (widget, &alloc);
+#ifdef GTK_BUTTON_SIZING_FIX
+  alloc.height -= xfce_panel_image_padding_correction (widget);
+#endif
   *minimal_height = alloc.height;
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed drawing code in panel-image and arrow-button

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 700769744a13cb166214c9ddda1e987b1ad5ef04 (commit)
   from b35c168cb77181f4e358cd1c03b73606c371b001 (commit)

commit 700769744a13cb166214c9ddda1e987b1ad5ef04
Author: Andrzej 
Date:   Sun Apr 14 01:08:01 2013 +0100

Fixed drawing code in panel-image and arrow-button

- top-left coordinate at 0,0, not alloc->x,alloc->y
- use gdouble instead of gint in _draw
- use GtkStyleContext
- fix uninitialized alloc variable

 libxfce4panel/xfce-arrow-button.c |   38 -
 libxfce4panel/xfce-panel-image.c  |4 ++--
 2 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/libxfce4panel/xfce-arrow-button.c 
b/libxfce4panel/xfce-arrow-button.c
index bbf2369..a9363de 100644
--- a/libxfce4panel/xfce-arrow-button.c
+++ b/libxfce4panel/xfce-arrow-button.c
@@ -265,10 +265,12 @@ xfce_arrow_button_draw (GtkWidget *widget,
 {
   XfceArrowButton *button = XFCE_ARROW_BUTTON (widget);
   GtkWidget   *child;
-  gint x, y, width;
+  gdouble  x, y, width;
   GtkAllocationalloc;
   gdouble  angle;
   GtkStyleContext *context;
+  GtkBorderpadding;
+  GdkRGBA  fg_rgba;
 
   /* draw the button */
   (*GTK_WIDGET_CLASS (xfce_arrow_button_parent_class)->draw) (widget, cr);
@@ -276,34 +278,36 @@ xfce_arrow_button_draw (GtkWidget *widget,
   if (button->priv->arrow_type != GTK_ARROW_NONE
   && gtk_widget_is_drawable (widget))
 {
+  gtk_widget_get_allocation (widget, &alloc);
   child = gtk_bin_get_child (GTK_BIN (widget));
+  context = gtk_widget_get_style_context (widget);
+  gtk_style_context_get_padding (context, gtk_widget_get_state_flags 
(widget), &padding);
+
   if (child != NULL
   && gtk_widget_get_visible (child))
 {
-  gtk_widget_get_allocation (widget, &alloc);
-  
   if (button->priv->arrow_type == GTK_ARROW_UP
   || button->priv->arrow_type == GTK_ARROW_DOWN)
 {
-  width = ARROW_WIDTH;
-  x = alloc.x + 1 /* widget->style->xthickness */;
-  y = alloc.y + (alloc.height - width) / 2;
+  width = (gdouble) ARROW_WIDTH;
+  x = (gdouble) padding.left;
+  y = (gdouble) (alloc.height - width) / 2.0;
 }
   else
 {
-  width = ARROW_WIDTH;
-  x = alloc.x + (alloc.width - width) / 2;
-  y = alloc.y + 1 /* widget->style->ythickness */;
+  width = (gdouble) ARROW_WIDTH;
+  x = (gdouble) (alloc.width - width) / 2.0;
+  y = (gdouble) padding.top;
 }
 }
   else
 {
-  width = MIN (alloc.height - 2 * 1 /* widget->style->ythickness */,
-   alloc.width  - 2 * 1 /* widget->style->xthickness */);
-  width = CLAMP (width, 1, ARROW_WIDTH);
+  width = (gdouble) MIN (alloc.height - padding.top - padding.bottom,
+ alloc.width  - padding.left - padding.right);
+  width = (gdouble) CLAMP (width, 1.0, (gdouble) ARROW_WIDTH);
 
-  x = alloc.x + (alloc.width - width) / 2;
-  y = alloc.y + (alloc.height - width) / 2;
+  x = (gdouble) (alloc.width - width) / 2.0;
+  y = (gdouble) (alloc.height - width) / 2.0;
 }
 
   switch (button->priv->arrow_type)
@@ -311,10 +315,10 @@ xfce_arrow_button_draw (GtkWidget *widget,
 case GTK_ARROW_DOWN:  angle = G_PI;
 case GTK_ARROW_LEFT:  angle = G_PI / 2.0 + G_PI;
 case GTK_ARROW_RIGHT: angle = G_PI / 2.0;
-default:  angle = 0;
+default:  angle = 0.0;
 }
-
-  context = gtk_widget_get_style_context (widget);
+  gtk_style_context_get_color (context, gtk_widget_get_state_flags 
(widget), &fg_rgba);
+  gdk_cairo_set_source_rgba (cr, &fg_rgba);
   gtk_render_arrow (context, cr, angle, x, y, ARROW_WIDTH);
 }
 
diff --git a/libxfce4panel/xfce-panel-image.c b/libxfce4panel/xfce-panel-image.c
index 2c5ba5b..1fd96d4 100644
--- a/libxfce4panel/xfce-panel-image.c
+++ b/libxfce4panel/xfce-panel-image.c
@@ -438,8 +438,8 @@ xfce_panel_image_draw (GtkWidget *widget,
 
   /* position */
   gtk_widget_get_allocation (widget, &alloc);
-  dest_x = alloc.x + (priv->width - source_width) / 2;
-  dest_y = alloc.y + (priv->height - source_height) / 2;
+  dest_x = (priv->width - source_width) / 2;
+  dest_y = (priv->height - source_height) / 2;
 
   context = gtk_widget_get_style_context (widget);
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Loading external gtk2 panel plugins in gtk3 panel.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to b35c168cb77181f4e358cd1c03b73606c371b001 (commit)
   from f625f76e96d3fc142f5b896d3d780e0dc883b7c7 (commit)

commit b35c168cb77181f4e358cd1c03b73606c371b001
Author: Andrzej 
Date:   Sun Apr 7 22:49:33 2013 +0100

Loading external gtk2 panel plugins in gtk3 panel.

Addeding X-XFCE-API to the plugin .desktop files to determine which
wrapper to use. This falls back to 1.0 wrapper for compatibility with
the current plugins.

Conflicts:
panel/panel-module.c
panel/panel-plugin-external-wrapper.c

 configure.ac.in|   12 ++
 libxfce4panel/libxfce4panel-1.0.pc.in  |1 +
 libxfce4panel/libxfce4panel-2.0.pc.in  |1 +
 panel/panel-module.c   |   44 +++-
 panel/panel-module.h   |2 +
 panel/panel-plugin-external-wrapper.c  |   13 ++
 plugins/actions/Makefile.am|4 +-
 .../{actions.desktop.in => actions.desktop.in.in}  |1 +
 plugins/applicationsmenu/Makefile.am   |4 +-
 ...u.desktop.in => applicationsmenu.desktop.in.in} |1 +
 plugins/clock/Makefile.am  |4 +-
 .../{clock.desktop.in => clock.desktop.in.in}  |1 +
 plugins/directorymenu/Makefile.am  |4 +-
 ...menu.desktop.in => directorymenu.desktop.in.in} |1 +
 plugins/launcher/Makefile.am   |4 +-
 ...{launcher.desktop.in => launcher.desktop.in.in} |1 +
 plugins/pager/Makefile.am  |4 +-
 .../{pager.desktop.in => pager.desktop.in.in}  |1 +
 plugins/separator/Makefile.am  |4 +-
 ...eparator.desktop.in => separator.desktop.in.in} |1 +
 plugins/showdesktop/Makefile.am|4 +-
 ...esktop.desktop.in => showdesktop.desktop.in.in} |1 +
 plugins/systray/Makefile.am|4 +-
 .../{systray.desktop.in => systray.desktop.in.in}  |1 +
 plugins/tasklist/Makefile.am   |4 +-
 ...{tasklist.desktop.in => tasklist.desktop.in.in} |1 +
 plugins/windowmenu/Makefile.am |4 +-
 ...dowmenu.desktop.in => windowmenu.desktop.in.in} |1 +
 28 files changed, 76 insertions(+), 52 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 654eab2..b341b37 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -91,6 +91,7 @@ LIBXFCE4PANEL_VERSION_API=libxfce4panel_version_api()
 LIBXFCE4PANEL_VERSION_MAJOR=xfce4_panel_version_major()
 LIBXFCE4PANEL_VERSION_MINOR=xfce4_panel_version_minor()
 LIBXFCE4PANEL_VERSION_MICRO=xfce4_panel_version_micro()
+AC_DEFINE([LIBXFCE4PANEL_VERSION_API], "libxfce4panel_version_api()", 
[libxfce4panel api version])
 AC_SUBST([LIBXFCE4PANEL_VERSION])
 AC_SUBST([LIBXFCE4PANEL_VERSION_API])
 AC_SUBST([LIBXFCE4PANEL_VERSION_MAJOR])
@@ -244,16 +245,27 @@ panel/Makefile
 wrapper/Makefile
 plugins/Makefile
 plugins/actions/Makefile
+plugins/actions/actions.desktop.in
 plugins/applicationsmenu/Makefile
+plugins/applicationsmenu/applicationsmenu.desktop.in
 plugins/clock/Makefile
+plugins/clock/clock.desktop.in
 plugins/directorymenu/Makefile
+plugins/directorymenu/directorymenu.desktop.in
 plugins/launcher/Makefile
+plugins/launcher/launcher.desktop.in
 plugins/pager/Makefile
+plugins/pager/pager.desktop.in
 plugins/separator/Makefile
+plugins/separator/separator.desktop.in
 plugins/showdesktop/Makefile
+plugins/showdesktop/showdesktop.desktop.in
 plugins/systray/Makefile
+plugins/systray/systray.desktop.in
 plugins/tasklist/Makefile
+plugins/tasklist/tasklist.desktop.in
 plugins/windowmenu/Makefile
+plugins/windowmenu/windowmenu.desktop.in
 po/Makefile.in
 ])
 
diff --git a/libxfce4panel/libxfce4panel-1.0.pc.in 
b/libxfce4panel/libxfce4panel-1.0.pc.in
index a54205d..f596d69 100644
--- a/libxfce4panel/libxfce4panel-1.0.pc.in
+++ b/libxfce4panel/libxfce4panel-1.0.pc.in
@@ -3,6 +3,7 @@ exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 localedir=@localedir@
+api=1.0
 
 Name: libxfce4panel
 Description: Library for the Xfce Panel
diff --git a/libxfce4panel/libxfce4panel-2.0.pc.in 
b/libxfce4panel/libxfce4panel-2.0.pc.in
index affbacf..944a985 100644
--- a/libxfce4panel/libxfce4panel-2.0.pc.in
+++ b/libxfce4panel/libxfce4panel-2.0.pc.in
@@ -3,6 +3,7 @@ exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 localedir=@localedir@
+api=@LIBXFCE4PANEL_VERSION_API@
 
 Name: libxfce4panel
 Description: Library for the Xfce Panel
diff --git a/panel/panel-module.c b/panel/panel-module.c
index 6abd362..48d9745 100644
--- a/panel/panel-module.c
+++ b/panel/panel-module.c
@@ -21,7 +21,6 @@
 #endif
 
 #include 
-#include 
 #include 
 #include 
 
@@ -63,7 +62,6 @@ enum _PanelModuleRunMode
   UNKNOWN,/* Unset */
   INTERNAL,   /* plugin librar

[Xfce4-commits] PanelImage: fixes to previous commit and cleanup.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 8774af02f8ea29c43dc1bec53626bfee5b480faa (commit)
   from bbd0001c3c89946bb63c1b5c78b129eeb4bce3e8 (commit)

commit 8774af02f8ea29c43dc1bec53626bfee5b480faa
Author: Andrzej 
Date:   Mon Apr 15 23:31:45 2013 +0100

PanelImage: fixes to previous commit and cleanup.

Correction has to be done in all cases, not only when the requested
size is derived from allocation.

 libxfce4panel/xfce-panel-image.c |   46 +++---
 1 file changed, 28 insertions(+), 18 deletions(-)

diff --git a/libxfce4panel/xfce-panel-image.c b/libxfce4panel/xfce-panel-image.c
index 6d9687d..5d17419 100644
--- a/libxfce4panel/xfce-panel-image.c
+++ b/libxfce4panel/xfce-panel-image.c
@@ -116,10 +116,10 @@ static void   xfce_panel_image_set_property 
(GObject *object
 static void   xfce_panel_image_finalize (GObject 
*object);
 #if GTK_CHECK_VERSION (3, 0, 0)
 static void   xfce_panel_image_get_preferred_width  (GtkWidget   
*widget,
- gint
*minimal_width,
+ gint
*minimum_width,
  gint
*natural_width);
 static void   xfce_panel_image_get_preferred_height (GtkWidget   
*widget,
- gint
*minimal_height,
+ gint
*minimum_height,
  gint
*natural_height);
 #else
 static void   xfce_panel_image_size_request (GtkWidget   
*widget,
@@ -353,52 +353,64 @@ xfce_panel_image_padding_correction (GtkWidget *widget)
 #if GTK_CHECK_VERSION (3, 0, 0)
 static void
 xfce_panel_image_get_preferred_width (GtkWidget *widget,
-  gint  *minimal_width,
+  gint  *minimum_width,
   gint  *natural_width)
 {
   XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
   GtkAllocation  alloc;
+  gint   width;
 
   if (priv->size > 0)
-*minimal_width = priv->size;
+width = priv->size;
   else if (priv->pixbuf != NULL)
-*minimal_width = gdk_pixbuf_get_width (priv->pixbuf);
+width = gdk_pixbuf_get_width (priv->pixbuf);
   else
 {
   gtk_widget_get_allocation (widget, &alloc);
+  width = alloc.width;
+}
+
 #ifdef GTK_BUTTON_SIZING_FIX
-  alloc.width -= xfce_panel_image_padding_correction (widget);
+  width -= xfce_panel_image_padding_correction (widget);
 #endif
-  *minimal_width = alloc.width;
-}
 
-  *natural_width = *minimal_width;
+  if (minimum_width != NULL)
+*minimum_width = width;
+
+  if (natural_width != NULL)
+*natural_width = width;
 }
 
 
 
 static void
 xfce_panel_image_get_preferred_height (GtkWidget *widget,
-   gint  *minimal_height,
+   gint  *minimum_height,
gint  *natural_height)
 {
   XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
   GtkAllocation  alloc;
+  gint   height;
 
   if (priv->size > 0)
-*minimal_height = priv->size;
+height = priv->size;
   else if (priv->pixbuf != NULL)
-*minimal_height = gdk_pixbuf_get_height (priv->pixbuf);
+height = gdk_pixbuf_get_height (priv->pixbuf);
   else
 {
   gtk_widget_get_allocation (widget, &alloc);
+  height = alloc.height;
+}
+
 #ifdef GTK_BUTTON_SIZING_FIX
-  alloc.height -= xfce_panel_image_padding_correction (widget);
+  height -= xfce_panel_image_padding_correction (widget);
 #endif
-  *minimal_height = alloc.height;
-}
 
-  *natural_height = *minimal_height;
+  if (minimum_height != NULL)
+*minimum_height = height;
+
+  if (natural_height != NULL)
+*natural_height = height;
 }
 #endif
 
@@ -481,7 +493,6 @@ xfce_panel_image_draw (GtkWidget *widget,
   GdkPixbuf *rendered = NULL;
   GdkPixbuf *pixbuf = priv->cache;
   GtkStyleContext   *context;
-  GtkAllocation  alloc;
 
   if (G_LIKELY (pixbuf != NULL))
 {
@@ -490,7 +501,6 @@ xfce_panel_image_draw (GtkWidget *widget,
   source_height = gdk_pixbuf_get_height (pixbuf);
 
   /* position */
-  gtk_widget_get_allocation (widget, &alloc);
   dest_x = (priv->width - source_width) / 2;
   dest_y = (priv->height - source_height) / 2;
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Quick fix of compilation errors after merge of nick/gtk3 branch.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 88c73508a09a05a7bc44833a9eaebc48072d4695 (commit)
   from 70736810202ecebc25bc5622e8022c1f3612e997 (commit)

commit 88c73508a09a05a7bc44833a9eaebc48072d4695
Author: Andrzej 
Date:   Sun Aug 25 23:23:04 2013 +0100

Quick fix of compilation errors after merge of nick/gtk3 branch.

Gtk3 plugins (e.g. xfce4-indicator-plugin/master) are not recognized
(treated as gtk2 ones).

 panel/panel-module.c  |5 +++--
 panel/panel-plugin-external-wrapper.c |2 +-
 panel/panel-plugin-external-wrapper.h |1 -
 panel/panel-plugin-external.c |   18 --
 panel/panel-plugin-external.h |1 -
 5 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/panel/panel-module.c b/panel/panel-module.c
index 48d9745..dc947ba 100644
--- a/panel/panel-module.c
+++ b/panel/panel-module.c
@@ -21,6 +21,7 @@
 #endif
 
 #include 
+#include 
 #include 
 #include 
 
@@ -309,8 +310,8 @@ panel_module_new_from_desktop_file (const gchar *filename,
   const gchar *module_unique;
   gboolean found;
 
-  panel_return_val_if_fail (!panel_str_is_empty (filename), NULL);
-  panel_return_val_if_fail (!panel_str_is_empty (name), NULL);
+  panel_return_val_if_fail (!exo_str_is_empty (filename), NULL);
+  panel_return_val_if_fail (!exo_str_is_empty (name), NULL);
 
   rc = xfce_rc_simple_open (filename, TRUE);
   if (G_UNLIKELY (rc == NULL))
diff --git a/panel/panel-plugin-external-wrapper.c 
b/panel/panel-plugin-external-wrapper.c
index 6b61713..12da849 100644
--- a/panel/panel-plugin-external-wrapper.c
+++ b/panel/panel-plugin-external-wrapper.c
@@ -220,7 +220,7 @@ panel_plugin_external_wrapper_get_argv (PanelPluginExternal 
  *external,
   argv[PLUGIN_ARGV_0] = g_strjoin ("-", WRAPPER_BIN, panel_module_get_api 
(external->module), NULL);
   argv[PLUGIN_ARGV_FILENAME] = g_strdup (panel_module_get_filename 
(external->module));
   argv[PLUGIN_ARGV_UNIQUE_ID] = g_strdup_printf ("%d", external->unique_id);;
-  argv[PLUGIN_ARGV_SOCKET_ID] = g_strdup_printf ("%lu", gtk_socket_get_id 
(GTK_SOCKET (external)));;
+  argv[PLUGIN_ARGV_SOCKET_ID] = g_strdup_printf ("%u", gtk_socket_get_id 
(GTK_SOCKET (external)));;
   argv[PLUGIN_ARGV_NAME] = g_strdup (panel_module_get_name (external->module));
   argv[PLUGIN_ARGV_DISPLAY_NAME] = g_strdup (panel_module_get_display_name 
(external->module));
   argv[PLUGIN_ARGV_COMMENT] = g_strdup (panel_module_get_comment 
(external->module));
diff --git a/panel/panel-plugin-external-wrapper.h 
b/panel/panel-plugin-external-wrapper.h
index e4bb1b2..eaa3ee9 100644
--- a/panel/panel-plugin-external-wrapper.h
+++ b/panel/panel-plugin-external-wrapper.h
@@ -40,7 +40,6 @@ GType  panel_plugin_external_wrapper_get_type (void) 
G_GNUC_CONST;
 
 GtkWidget *panel_plugin_external_wrapper_new  (PanelModule  *module,
gint  unique_id,
-   gboolean  is_gtk3,
gchar   **arguments) 
G_GNUC_MALLOC;
 
 G_END_DECLS
diff --git a/panel/panel-plugin-external.c b/panel/panel-plugin-external.c
index f26adf7..b9e8f36 100644
--- a/panel/panel-plugin-external.c
+++ b/panel/panel-plugin-external.c
@@ -133,7 +133,6 @@ enum
   PROP_0,
   PROP_MODULE,
   PROP_UNIQUE_ID,
-  PROP_IS_GTK3,
   PROP_ARGUMENTS
 };
 
@@ -175,14 +174,6 @@ panel_plugin_external_class_init (PanelPluginExternalClass 
*klass)
  | 
G_PARAM_CONSTRUCT_ONLY));
 
   g_object_class_install_property (gobject_class,
-   PROP_IS_GTK3,
-   g_param_spec_boolean ("is-gtk3",
- NULL, NULL,
- FALSE,
- EXO_PARAM_READWRITE
- | 
G_PARAM_CONSTRUCT_ONLY));
-
-  g_object_class_install_property (gobject_class,
PROP_MODULE,
g_param_spec_object ("module",
 NULL, NULL,
@@ -210,7 +201,6 @@ panel_plugin_external_init (PanelPluginExternal *external)
   external->show_configure = FALSE;
   external->show_about = FALSE;
   external->unique_id = -1;
-  external->is_gtk3 = FALSE;
 
   external->priv->arguments = NULL;
   external->priv->queue = NULL;
@@ -291,10 +281,6 @@ panel_plugin_external_get_property (GObject*object,
   g_value_set_int (value, external->unique_id);
   break;
 
-case PROP_IS_GTK3:
-  g_value_set_boolean (value, external->is_gtk3);
-  break;
-
 case PROP_ARGUMENTS:
   g_value_set_boxed (value

[Xfce4-commits] PanelImage: do not reload fixed-size icons on style-updated.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 70736810202ecebc25bc5622e8022c1f3612e997 (commit)
   from e19efc05e6c6388b6f2f869aec452f55a03cc74c (commit)

commit 70736810202ecebc25bc5622e8022c1f3612e997
Author: Andrzej 
Date:   Mon Apr 22 23:58:10 2013 +0100

PanelImage: do not reload fixed-size icons on style-updated.

Style-updated triggered a lot of flickering in the applications menu
on mouse hover events.

Are there any use cases where reloading the icons is needed?

 libxfce4panel/xfce-panel-image.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libxfce4panel/xfce-panel-image.c b/libxfce4panel/xfce-panel-image.c
index ded78ea..8073040 100644
--- a/libxfce4panel/xfce-panel-image.c
+++ b/libxfce4panel/xfce-panel-image.c
@@ -622,8 +622,10 @@ xfce_panel_image_style_updated (GtkWidget *widget)
 }
 
   /* update the icon if we have an icon-name source */
+  /* and size is not set */
   if (priv->source != NULL
-  && !g_path_is_absolute (priv->source))
+  && !g_path_is_absolute (priv->source)
+  && priv->size <= 0)
 {
   /* unset the size to force an update */
   priv->width = priv->height = -1;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] PanelPlugin: workaround for transparency issues.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 2502e16c7d50862adfec96955532d02c35dedaf8 (commit)
   from 20202a2432490490f4ff246babd37aa8205147cb (commit)

commit 2502e16c7d50862adfec96955532d02c35dedaf8
Author: Andrzej 
Date:   Thu Apr 18 20:43:29 2013 +0100

PanelPlugin: workaround for transparency issues.

It disables plugin transparency completely (breaking custom background
colors, bitmaps and alpha settings). But at least it makes the panel
usable with "system style" background settings.

How to fix it properly?
External plugins work fine but they have their own API for setting
the background style.

 libxfce4panel/xfce-panel-plugin.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libxfce4panel/xfce-panel-plugin.c 
b/libxfce4panel/xfce-panel-plugin.c
index cd67eaa..1e5933e 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -715,7 +715,10 @@ xfce_panel_plugin_init (XfcePanelPlugin *plugin)
 #endif
 
   /* hide the event box window to make the plugin transparent */
-  gtk_event_box_set_visible_window (GTK_EVENT_BOX (plugin), FALSE);
+  // FIXME
+  // Temporarily disabled to workaround plugin transparency issues.
+  // It breaks background transparency and color support.
+  //gtk_event_box_set_visible_window (GTK_EVENT_BOX (plugin), FALSE);
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] PanelImage: allow scaling the image down (below allocation)

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 8fff5877bbca65545f9dcfac788aa48fcf037f3e (commit)
   from 368aedcef78da3c753ef32882aca3b86fbec99c2 (commit)

commit 8fff5877bbca65545f9dcfac788aa48fcf037f3e
Author: Andrzej 
Date:   Wed Apr 17 02:24:58 2013 +0100

PanelImage: allow scaling the image down (below allocation)

Some containers (GtkBox(?)) refuse to allocate their child items below
minimum requested size, even if that results in violating their own
allocation.

Reducing the minimum size allows these containers to iteratively
reduce the size of the embedded PanelImage.

When priv->size > 0 minimum size must be equal to the natural size.
Otherwise icons displayed in menus will be too small (menus use
a minimum size).

 libxfce4panel/xfce-panel-image.c |   38 --
 1 file changed, 28 insertions(+), 10 deletions(-)

diff --git a/libxfce4panel/xfce-panel-image.c b/libxfce4panel/xfce-panel-image.c
index 5d17419..1783f39 100644
--- a/libxfce4panel/xfce-panel-image.c
+++ b/libxfce4panel/xfce-panel-image.c
@@ -358,24 +358,33 @@ xfce_panel_image_get_preferred_width (GtkWidget *widget,
 {
   XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
   GtkAllocation  alloc;
-  gint   width;
+  gint   width, width_min;
+#ifdef GTK_BUTTON_SIZING_FIX
+  gint   correction;
+#endif
 
   if (priv->size > 0)
-width = priv->size;
+width = width_min = priv->size;
   else if (priv->pixbuf != NULL)
-width = gdk_pixbuf_get_width (priv->pixbuf);
+{
+  width = gdk_pixbuf_get_width (priv->pixbuf);
+  width_min = width / 2;
+}
   else
 {
   gtk_widget_get_allocation (widget, &alloc);
   width = alloc.width;
+  width_min = width / 2;
 }
 
 #ifdef GTK_BUTTON_SIZING_FIX
-  width -= xfce_panel_image_padding_correction (widget);
+  correction = xfce_panel_image_padding_correction (widget);
+  width -= correction;
+  width_min -= correction;
 #endif
 
   if (minimum_width != NULL)
-*minimum_width = width;
+*minimum_width = width_min;
 
   if (natural_width != NULL)
 *natural_width = width;
@@ -390,24 +399,33 @@ xfce_panel_image_get_preferred_height (GtkWidget *widget,
 {
   XfcePanelImagePrivate *priv = XFCE_PANEL_IMAGE (widget)->priv;
   GtkAllocation  alloc;
-  gint   height;
+  gint   height, height_min;
+#ifdef GTK_BUTTON_SIZING_FIX
+  gint   correction;
+#endif
 
   if (priv->size > 0)
-height = priv->size;
+height = height_min = priv->size;
   else if (priv->pixbuf != NULL)
-height = gdk_pixbuf_get_height (priv->pixbuf);
+{
+  height = gdk_pixbuf_get_height (priv->pixbuf);
+  height_min = height / 2;
+}
   else
 {
   gtk_widget_get_allocation (widget, &alloc);
   height = alloc.height;
+  height_min = height / 2;
 }
 
 #ifdef GTK_BUTTON_SIZING_FIX
-  height -= xfce_panel_image_padding_correction (widget);
+  correction = xfce_panel_image_padding_correction (widget);
+  height -= correction;
+  height_min -= correction;
 #endif
 
   if (minimum_height != NULL)
-*minimum_height = height;
+*minimum_height = height_min;
 
   if (natural_height != NULL)
 *natural_height = height;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] PanelImage: better support for non-square icons.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 87ce7cdb2d348715d90793c563d7a747114f69e8 (commit)
   from 50462009c0fa6ab1097f393dee97042b1be4471e (commit)

commit 87ce7cdb2d348715d90793c563d7a747114f69e8
Author: Andrzej 
Date:   Mon Apr 15 00:09:06 2013 +0100

PanelImage: better support for non-square icons.

I thought this might be the reason for panel buttons growing infinitely.
It turned out to be something different but this change still improves
the sizing and makes it consistent with 
xfce_panel_pixbuf_from_source_at_size.

 libxfce4panel/xfce-panel-image.c |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libxfce4panel/xfce-panel-image.c b/libxfce4panel/xfce-panel-image.c
index b5afae6..7acb239 100644
--- a/libxfce4panel/xfce-panel-image.c
+++ b/libxfce4panel/xfce-panel-image.c
@@ -669,8 +669,7 @@ xfce_panel_image_scale_pixbuf (GdkPixbuf *source,
gint   dest_width,
gint   dest_height)
 {
-  gdouble wratio;
-  gdouble hratio;
+  gdouble ratio;
   gintsource_width;
   gintsource_height;
 
@@ -688,13 +687,12 @@ xfce_panel_image_scale_pixbuf (GdkPixbuf *source,
 return g_object_ref (G_OBJECT (source));
 
   /* calculate the new dimensions */
-  wratio = (gdouble) source_width  / (gdouble) dest_width;
-  hratio = (gdouble) source_height / (gdouble) dest_height;
 
-  if (hratio > wratio)
-dest_width  = rint (source_width / hratio);
-  else
-dest_height = rint (source_height / wratio);
+  ratio = MIN ((gdouble) dest_width / (gdouble) source_width,
+   (gdouble) dest_height / (gdouble) source_height);
+
+  dest_width  = rint (source_width * ratio);
+  dest_height = rint (source_height * ratio);
 
   return gdk_pixbuf_scale_simple (source, MAX (dest_width, 1),
   MAX (dest_height, 1),
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-panel lib: workaround for ctx menus with scroll buttons.

2013-08-25 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to e19efc05e6c6388b6f2f869aec452f55a03cc74c (commit)
   from 2502e16c7d50862adfec96955532d02c35dedaf8 (commit)

commit e19efc05e6c6388b6f2f869aec452f55a03cc74c
Author: Andrzej 
Date:   Mon Apr 22 23:41:28 2013 +0100

xfce4-panel lib: workaround for ctx menus with scroll buttons.

 libxfce4panel/xfce-panel-plugin.c |7 +++
 1 file changed, 7 insertions(+)

diff --git a/libxfce4panel/xfce-panel-plugin.c 
b/libxfce4panel/xfce-panel-plugin.c
index 1e5933e..df417fe 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -2589,8 +2589,15 @@ xfce_panel_plugin_position_menu (GtkMenu  *menu,
   xfce_panel_plugin_position_widget (XFCE_PANEL_PLUGIN (panel_plugin),
  GTK_WIDGET (menu), attach_widget, x, y);
 
+#if GTK_CHECK_VERSION (3, 0, 0)
+  /* FIXME */
+  /* A workaround for Gtk3 popup menus with scroll buttons */
+  /* Menus are "pushed in" anyway */
+  *push_in = FALSE;
+#else
   /* keep the menu inside screen */
   *push_in = TRUE;
+#endif
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Preparing for release

2013-11-23 Thread Andrzej
Updating branch refs/heads/master
 to 5c2515a8996a37624cfa06d9d8e23408b149b47f (commit)
   from 3d8b1a440c4e5542dfaa0ea86192ad73d01cccdd (commit)

commit 5c2515a8996a37624cfa06d9d8e23408b149b47f
Author: Andrzej 
Date:   Sat Nov 23 22:15:24 2013 +

Preparing for release

 AUTHORS |1 +
 NEWS|7 +++
 configure.in.in |2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/AUTHORS b/AUTHORS
index 467407c..db0a536 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1,4 @@
 Diego Ongaro (ongar...@gmail.com)
 Andrzej (ndrwr...@gmail.com)
+Alistair Buxton (a.j.bux...@gmail.com)
 Christoph Wickert (cwick...@fedoraproject.org)
diff --git a/NEWS b/NEWS
index 663c5aa..f3727d8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+2013-11-23
+
+xfce4-places-plugin v1.6.0 released
+
+ * Added support for network devices in ~/.gtk-bookmarks
+ * Updated translations
+
 2012-09-28
 

 xfce4-places-plugin v1.5.0 released
diff --git a/configure.in.in b/configure.in.in
index ad0a947..f256a2c 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -1,7 +1,7 @@
 dnl xfce4-places-plugin
 
 dnl version info
-m4_define([places_version], [1.5.0])
+m4_define([places_version], [1.6.0])
 
 dnl initialize autoconf
 AC_COPYRIGHT([Copyright (c) 2007-2009 Diego Ongaro ])
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Creating annotated tag 1.6.0

2013-11-23 Thread Andrzej
Updating annotated tag refs/tags/1.6.0
 as new annotated tag
 to be441544eebb573db961141adf8365de76f3ce41 (tag)
   succeeds 1.5.0-58-g3d8b1a4
  tagged by Andrzej 
 on 2013-11-23 23:19 +0100

Andrzej (1):
  Preparing for release

___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Back to development

2013-12-01 Thread Andrzej
Updating branch refs/heads/master
 to ec0a224b66eced595e9385d5c0b50daad10a74b1 (commit)
   from 7a07e8159e921b9bf49eaff23431cca8ebd69ab4 (commit)

commit ec0a224b66eced595e9385d5c0b50daad10a74b1
Author: Andrzej 
Date:   Sun Dec 1 22:32:16 2013 +

Back to development

 configure.ac.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac.in b/configure.ac.in
index a4f10de..3bb97df 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -11,7 +11,7 @@ m4_define([indicator_version_minor], [2])
 m4_define([indicator_version_micro], [0])
 m4_define([indicator_version_nano],  []) dnl leave this empty to have no nano 
version
 m4_define([indicator_version_build], [@REVISION@])
-m4_define([indicator_version_tag],   [])
+m4_define([indicator_version_tag],   [git])
 m4_define([indicator_version], 
[indicator_version_major().indicator_version_minor().indicator_version_micro()ifelse(indicator_version_nano(),
 [], [], [.indicator_version_nano()])ifelse(indicator_version_tag(), [git], 
[indicator_version_tag()-indicator_version_build()], 
[indicator_version_tag()])])
 
 dnl ***
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Creating annotated tag xfce4-indicator-plugin-2.2.0

2013-12-01 Thread Andrzej
Updating annotated tag refs/tags/xfce4-indicator-plugin-2.2.0
 as new annotated tag
 to 2b09cc21f726620f0df5c539f50d0420ed58f320 (tag)
   succeeds xfce4-indicator-plugin-2.1.0-54-g4971cc4
  tagged by Andrzej 
 on 2013-12-01 23:31 +0100

Andrzej (1):
  Preparing for a release

___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Preparing for a release

2013-12-01 Thread Andrzej
Updating branch refs/heads/master
 to 7a07e8159e921b9bf49eaff23431cca8ebd69ab4 (commit)
   from 4971cc43b95f2539db8502ab53a6e469ab39b19c (commit)

commit 7a07e8159e921b9bf49eaff23431cca8ebd69ab4
Author: Andrzej 
Date:   Sun Dec 1 22:30:45 2013 +

Preparing for a release

 ChangeLog   |   57 +--
 configure.ac.in |4 ++--
 2 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8e40a75..4de567b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,57 @@
-# created with git log --pretty=format:"%ad %h %s %aN <%aE>" --no-merges 
--date=short
+2013-12-01 4971cc4 Changed required version of libxfce4panel Andrzej 

+2013-11-18 b992563 I18n: Update translation da (100%). cedeel 

+2013-11-16 bc7f4df I18n: Update translation zh_TW (78%). sofyalai 

+2013-11-16 57b525b I18n: Update translation zh_TW (62%). sofyalai 

+2013-11-07 35c2697 Ignore empty icons set by indicators. Alistair Buxton 

+2013-11-07 b7a42ad Remove the old icon, not the label, when icon is updated. 
Alistair Buxton 
+2013-10-27 c551c14 Check if indicator-ng.h exists Andrzej 
+2013-10-27 4689cb3 Updated dependencies Andrzej 
+2013-10-26 4f22aed I18n: Update translation cs (100%). Michal Várady 

+2013-10-20 235254b I18n: Update translation zh_CN (100%). Chipong 

+2013-10-19 03506c3 I18n: Update translation pl (100%). OSWorld 

+2013-10-14 5d670b4 I18n: Update translation ru (100%). shlyapugin 

+2013-09-30 d9b56a2 I18n: Update translation ar (100%). mohammad alhargan 

+2013-09-29 c38f9d6 I18n: Update translation pt (100%). nunom 

+2013-09-24 53df5ad Require libxfce4ui-4.11 Andrzej 
+2013-09-23 32df0d4 I18n: Update translation hr (72%). Ivica  Kolić 

+2013-09-21 833616f I18n: Update translation ko (100%). Darkcircle 

+2013-09-19 243049c Indicator-button: Pass secondary-activate event Andrzej 

+2013-09-17 82fa77e XfceIndicatorButton: add gdk_scroll_mask Andrzej 

+2013-09-15 25f6fef I18n: Update translation hu (100%). Nucleo 

+2013-09-13 711f458 I18n: Update translation cs (86%). fri 
+2013-09-12 d3a46b1 I18n: Update translation zh_CN (91%). 玉堂白鹤 
+2013-09-12 a8afd3f I18n: Update translation tr (86%). farukuzun 

+2013-09-11 c977fa1 I18n: Update translation tr (83%). Necdet Yücel 

+2013-09-11 2ac34bc I18n: Update translation pl (91%). Piotr Sokół 

+2013-09-08 0616d0e I18n: Update translation es (100%). Pablo Lezaeta 

+2013-09-07 7fd1efa I18n: Update translation uk (100%). Yarema aka Knedlyk 

+2013-09-07 ed2200d I18n: Update translation nl (100%). Pjotr123 

+2013-09-07 a7ae932 I18n: Update translation fr (100%). jc1 

+2013-09-07 68abde0 I18n: Update translation pt_BR (100%). Rafael Ferreira 

+2013-09-06 c665938 Fixed typo. Andrzej 
+2013-09-06 f6b84ee I18n: Update translation tr (72%). Necdet Yücel 

+2013-09-06 0da1de0 I18n: Update translation it (100%). cri 

+2013-09-06 45273e5 I18n: Update translation sr (100%). salepetronije 

+2013-09-06 0f78dd9 I18n: Update translation en_AU (100%). k3lt01 

+2013-09-06 5356231 I18n: Update translation bg (100%). cybercop 

+2013-09-06 becd486 Update translations Andrzej 
+2013-09-06 47267bb More layout fixes. Andrzej 
+2013-09-06 cdfc5e4 Allow rectangular or slightly oversized icons Andrzej 

+2013-09-06 990593b indicator layout fixes Andrzej 
+2013-09-06 7187abb Use "single-row" property Andrzej 
+2013-09-06 2df49bb Fix type of a "single-row" property Andrzej 

+2013-09-06 c619253 I18n: Update translation ca (100%). sandandmercury 

+2013-09-05 a53baf1 Removed row-size property and added a single-row one 
Andrzej 
+2013-09-05 e0b1ed0 I18n: Update translation ca (91%). sandandmercury 

+2013-09-05 c556271 I18n: Update translation ko (100%). Darkcircle 

+2013-09-04 49d3090 I18n: Update translation en_AU (100%). k3lt01 

+2013-09-03 1930a20 I18n: Update translation sr (100%). salepetronije 

+2013-09-03 d9f073d I18n: Update translation es (100%). Pablo Lezaeta 

+2013-09-02 123f657 I18n: Update translation pt (100%). nunom 

+2013-09-02 afa068f I18n: Update translation es (91%). MC 

+2013-09-02 8272c58 Force buttons to fit in the panel Andrzej 

+2013-09-02 2c3cac4 back to development Andrzej 
+2013-09-02 877d979 preparing for a release Andrzej 
 2013-09-01 6dc7c2e Updated .po files Andrzej 
 2013-09-01 61a419b Updated description in the desktop file. Andrzej 

 2013-09-01 19b21aa Updated list of authors and plugin description. Andrzej 

@@ -286,4 +339,4 @@
 2009-05-27 67c060d indicator is the one we need to check for Mark Trompell 

 2009-05-26 646fe35 Fix build issue with libtool 2.x Mark Trompell 

 2009-05-15 aa9f8f0 some random changes Mark Trompell 
-2009-05-15 ac4fe3f initial checkin Mark Trompell 
+2009-05-15 ac4fe3f initial checkin Mark Trompell 
\ No newline at end of file
diff --git a/configure.ac.in b/configure.ac.in
index d0de186..a4f10de 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -7,11 +7,11 @@ dnl 

[Xfce4-commits] Changed required version of libxfce4panel

2013-12-01 Thread Andrzej
Updating branch refs/heads/master
 to 4971cc43b95f2539db8502ab53a6e469ab39b19c (commit)
   from b9925630909800e3910020b08a067e4bdea0db72 (commit)

commit 4971cc43b95f2539db8502ab53a6e469ab39b19c
Author: Andrzej 
Date:   Sun Dec 1 22:21:00 2013 +

Changed required version of libxfce4panel

xfce4-panel from master branch now contains necessary functionality.

 configure.ac.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac.in b/configure.ac.in
index 1be4cc1..d0de186 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -81,7 +81,7 @@ XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.6.0])
 dnl XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.9.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.11.0])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], 
[libxfce4panel-${LIBXFCE4PANEL_VERSION_API}], [4.10.0git-6da51ed])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], 
[libxfce4panel-${LIBXFCE4PANEL_VERSION_API}], [4.10.0git])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
 INDICATOR_PKGNAME=indicator3-0.4
 XDT_CHECK_PACKAGE([INDICATOR], [${INDICATOR_PKGNAME}], [12.10.1])
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed missing inode-directory/folder icons on old systems.

2013-12-06 Thread Andrzej
Updating branch refs/heads/master
 to 38e528cfe03d39ce6de3e82c3a338853352e21f4 (commit)
   from 6843caf9afdef2ffa8eeb170938f565699280ec5 (commit)

commit 38e528cfe03d39ce6de3e82c3a338853352e21f4
Author: Andrzej 
Date:   Sat Dec 7 03:32:27 2013 +

Fixed missing inode-directory/folder icons on old systems.

This error was seen on RHEL5 with custom-built Gtk stack.
The system was distributed with a "folder" icon but was missing
an "inode-directory" icon expected by new glib/gtk.

 thunar/thunar-file.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index dc31654..c45cf81 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -3656,9 +3656,12 @@ thunar_file_get_icon_name (ThunarFile  *file,
 g_object_unref (icon);
 }
 
-  /* store new name, or empty string to avoid recursion */
+  /* store new name, fallback to legacy names, or empty string to avoid 
recursion */
   if (G_LIKELY (icon_name != NULL))
 file->icon_name = icon_name;
+  else if (file->kind == G_FILE_TYPE_DIRECTORY
+   && gtk_icon_theme_has_icon (icon_theme, "folder"))
+icon_name = g_strdup ("folder");
   else
 file->icon_name = g_strdup ("");
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Workaround for crashes on RHEL5

2013-12-06 Thread Andrzej
Updating branch refs/heads/master
 to 8780e13f86378151899d3e701fff2320e963f6ac (commit)
   from 38e528cfe03d39ce6de3e82c3a338853352e21f4 (commit)

commit 8780e13f86378151899d3e701fff2320e963f6ac
Author: Andrzej 
Date:   Sat Dec 7 03:50:03 2013 +

Workaround for crashes on RHEL5

Seems like a problem in cairo/x11.
All cairo blend mode operators are affected.

TODO: better fix with version checking and/or different operators.

 thunar/thunar-icon-renderer.c |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/thunar/thunar-icon-renderer.c b/thunar/thunar-icon-renderer.c
index f42cdc2..33ebbe0 100644
--- a/thunar/thunar-icon-renderer.c
+++ b/thunar/thunar-icon-renderer.c
@@ -322,7 +322,10 @@ thunar_icon_renderer_color_selected (cairo_t   *cr,
   gdk_cairo_set_source_color (cr, &widget->style->base[state]);
   cairo_set_operator (cr, CAIRO_OPERATOR_MULTIPLY);
 
-  cairo_mask (cr, source);
+  /* CAIRO_OPERATOR_MULTIPLY */
+  /* causes libx11 error: error_code 2 request_code 155 minor_code 8 */
+  /* with x11 1.0.3, xrender 0.9.1, cairo 1.12.2 */
+  /* cairo_mask (cr, source); */
 
   cairo_pattern_destroy (source);
   cairo_restore (cr);
@@ -340,7 +343,11 @@ thunar_icon_renderer_color_lighten (cairo_t   *cr,
 
   source = cairo_pattern_reference (cairo_get_source (cr));
   cairo_set_source_rgb (cr, .15, .15, .15);
-  cairo_set_operator (cr, CAIRO_OPERATOR_COLOR_DODGE);
+  /* CAIRO_OPERATOR_COLOR_DODGE */
+  /* causes libx11 error: error_code 2 request_code 155 minor_code 8 */
+  /* with x11 1.0.3, xrender 0.9.1, cairo 1.12.2 */
+  /* cairo_set_operator (cr, CAIRO_OPERATOR_COLOR_DODGE); */
+  cairo_set_operator (cr, CAIRO_OPERATOR_ADD);
 
   cairo_mask (cr, source);
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Check for empty labels to optimize layout

2013-12-10 Thread Andrzej
Updating branch refs/heads/master
 to d046d4b341f2194d52dbd8408740789ca7be0063 (commit)
   from bb667977d8fa17a8620e437d3a755832d0b91390 (commit)

commit d046d4b341f2194d52dbd8408740789ca7be0063
Author: Andrzej 
Date:   Wed Dec 11 01:18:16 2013 +

Check for empty labels to optimize layout

 panel-plugin/indicator-button-box.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/indicator-button-box.c 
b/panel-plugin/indicator-button-box.c
index 1174260..e99df98 100644
--- a/panel-plugin/indicator-button-box.c
+++ b/panel-plugin/indicator-button-box.c
@@ -362,7 +362,8 @@ indicator_button_box_is_small (IndicatorButtonBox *box)
 
   box->orientation = indicator_config_get_panel_orientation (box->config);
 
-  if (box->label != NULL)
+  if (box->label != NULL &&
+  g_strcmp0 (gtk_label_get_label (GTK_LABEL (box->label)), "") != 0)
 {
   box->is_small = FALSE;
   if (box->orientation == GTK_ORIENTATION_VERTICAL &&
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Make sure version API is set.

2013-12-18 Thread Andrzej
Updating branch refs/heads/master
 to 862db2d44aed25e8a397f5314f9daab374c4e9fa (commit)
   from b2b8dc7005eeebf2fc4f6d85b66423d73da04648 (commit)

commit 862db2d44aed25e8a397f5314f9daab374c4e9fa
Author: Andrzej 
Date:   Wed Dec 18 19:55:28 2013 +

Make sure version API is set.

Start-up crashes of external plugins resulted in API being not set properly,
Then, the panel was trying to use a non-existing "wrapper" binary.
This prevented normal crash reporting mechanism from working and resulted
in an "empty" plugin being inserted into the panel.

 panel/panel-module.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/panel/panel-module.c b/panel/panel-module.c
index dc947ba..0be7096 100644
--- a/panel/panel-module.c
+++ b/panel/panel-module.c
@@ -148,7 +148,7 @@ panel_module_init (PanelModule *module)
   module->library = NULL;
   module->construct_func = NULL;
   module->plugin_type = G_TYPE_NONE;
-  module->api = NULL;
+  module->api = g_strdup (LIBXFCE4PANEL_VERSION_API);
 }
 
 
@@ -220,6 +220,7 @@ panel_module_load (GTypeModule *type_module)
 
   /* from now on, run this plugin in a wrapper */
   module->mode = WRAPPER;
+  g_free (module->api);
   module->api = g_strdup (LIBXFCE4PANEL_VERSION_API);
 
   return FALSE;
@@ -368,7 +369,8 @@ panel_module_new_from_desktop_file (const gchar *filename,
   if (force_external || !xfce_rc_read_bool_entry (rc, 
"X-XFCE-Internal", FALSE))
 {
   module->mode = WRAPPER;
-  module->api = g_strdup (xfce_rc_read_entry (rc, "X-XFCE-API", 
"1.0"));
+  g_free (module->api);
+  module->api = g_strdup (xfce_rc_read_entry (rc, "X-XFCE-API", 
LIBXFCE4PANEL_VERSION_API));
 }
   else
 module->mode = INTERNAL;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Ellipsize labels only in deskbar mode.

2013-12-18 Thread Andrzej
Updating branch refs/heads/master
 to f7ad97a8cb36fadd205a3d78f55d9bdaad9fb43e (commit)
   from d046d4b341f2194d52dbd8408740789ca7be0063 (commit)

commit f7ad97a8cb36fadd205a3d78f55d9bdaad9fb43e
Author: Andrzej 
Date:   Wed Dec 18 21:53:33 2013 +

Ellipsize labels only in deskbar mode.

 panel-plugin/indicator-button-box.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/indicator-button-box.c 
b/panel-plugin/indicator-button-box.c
index e99df98..c3d00fe 100644
--- a/panel-plugin/indicator-button-box.c
+++ b/panel-plugin/indicator-button-box.c
@@ -244,7 +244,6 @@ indicator_button_box_set_label (IndicatorButtonBox  *box,
   g_signal_connect(G_OBJECT(box->label), "notify::label",
G_CALLBACK(indicator_button_box_label_changed), box);
 
-  gtk_label_set_ellipsize (GTK_LABEL (box->label), PANGO_ELLIPSIZE_END);
   box->is_small = FALSE;
 
   gtk_container_add (GTK_CONTAINER (box), box->label);
@@ -372,10 +371,12 @@ indicator_button_box_is_small (IndicatorButtonBox *box)
{
  box->orientation = GTK_ORIENTATION_HORIZONTAL;
  gtk_misc_set_alignment (GTK_MISC (box->label), 0.0, 0.5);
+ gtk_label_set_ellipsize (GTK_LABEL (box->label), PANGO_ELLIPSIZE_END);
}
   else
{
  gtk_misc_set_alignment (GTK_MISC (box->label), 0.5, 0.5);
+ gtk_label_set_ellipsize (GTK_LABEL (box->label), 
PANGO_ELLIPSIZE_NONE);
}
   gtk_label_set_angle (GTK_LABEL (box->label),
   (indicator_config_get_orientation (box->config) == 
GTK_ORIENTATION_VERTICAL) ?
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Check if labels are visible.

2013-12-18 Thread Andrzej
Updating branch refs/heads/master
 to 0ee1b170be11c1706e40dd3a4760f8f8eb6c0925 (commit)
   from f7ad97a8cb36fadd205a3d78f55d9bdaad9fb43e (commit)

commit 0ee1b170be11c1706e40dd3a4760f8f8eb6c0925
Author: Andrzej 
Date:   Wed Dec 18 22:39:21 2013 +

Check if labels are visible.

 panel-plugin/indicator-button-box.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/indicator-button-box.c 
b/panel-plugin/indicator-button-box.c
index c3d00fe..f3abb6a 100644
--- a/panel-plugin/indicator-button-box.c
+++ b/panel-plugin/indicator-button-box.c
@@ -222,6 +222,8 @@ indicator_button_box_label_changed (GtkLabel
*label,
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON_BOX (box));
   g_return_if_fail (GTK_IS_LABEL (label));
 
+  box->cached = FALSE;
+
   gtk_widget_queue_resize (GTK_WIDGET (box));
 }
 
@@ -243,9 +245,13 @@ indicator_button_box_set_label (IndicatorButtonBox  *box,
   g_object_ref (G_OBJECT (box->label));
   g_signal_connect(G_OBJECT(box->label), "notify::label",
G_CALLBACK(indicator_button_box_label_changed), box);
+  g_signal_connect(G_OBJECT(box->label), "notify::visible",
+   G_CALLBACK(indicator_button_box_label_changed), box);
 
   box->is_small = FALSE;
 
+  box->cached = FALSE;
+
   gtk_container_add (GTK_CONTAINER (box), box->label);
   gtk_widget_show (box->label);
 }
@@ -362,6 +368,7 @@ indicator_button_box_is_small (IndicatorButtonBox *box)
   box->orientation = indicator_config_get_panel_orientation (box->config);
 
   if (box->label != NULL &&
+  gtk_widget_get_visible (box->label) &&
   g_strcmp0 (gtk_label_get_label (GTK_LABEL (box->label)), "") != 0)
 {
   box->is_small = FALSE;
@@ -529,7 +536,7 @@ indicator_button_box_size_allocate (GtkWidget *widget,
 
   indicator_button_box_is_small (box); // refresh cache
 
-  if (box->icon != NULL && box->label != NULL)
+  if (box->icon != NULL && box->label != NULL && !box->is_small)
 {
   if (box->orientation == GTK_ORIENTATION_HORIZONTAL)
 {
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fallback to image surface, workaround for bug in Cairo/RENDER

2013-12-18 Thread Andrzej
Updating branch refs/heads/master
 to 78a3cba27cecbc13d078c127aa2acabae6048904 (commit)
   from cc115338beaa532f6dbee43e444ab25b046831bb (commit)

commit 78a3cba27cecbc13d078c127aa2acabae6048904
Author: Andrzej 
Date:   Thu Dec 19 02:08:26 2013 +

Fallback to image surface, workaround for bug in Cairo/RENDER

Only in _color_selected. _color_lighten works fine with CAIRO_OPERATOR_ADD.

Introduced a temporary/dummy preprocessor macro -> to be replaced with
an actual version check, once fixed Cairo is available.

Implementation likely slower than direct XRender path but no performance
problems detected during testing.

 thunar/thunar-icon-renderer.c |   34 ++
 1 file changed, 34 insertions(+)

diff --git a/thunar/thunar-icon-renderer.c b/thunar/thunar-icon-renderer.c
index 33ebbe0..2b91800 100644
--- a/thunar/thunar-icon-renderer.c
+++ b/thunar/thunar-icon-renderer.c
@@ -315,18 +315,52 @@ thunar_icon_renderer_color_selected (cairo_t   *cr,
   cairo_pattern_t *source;
   GtkStateType state;
 
+#ifdef CAIRO_BUG_72551_FIXED
   cairo_save (cr);
 
   source = cairo_pattern_reference (cairo_get_source (cr));
   state = gtk_widget_has_focus (widget) ? GTK_STATE_SELECTED : 
GTK_STATE_ACTIVE;
   gdk_cairo_set_source_color (cr, &widget->style->base[state]);
   cairo_set_operator (cr, CAIRO_OPERATOR_MULTIPLY);
+  cairo_mask (cr, source);
+#else /* fallback for RENDER error */
 
   /* CAIRO_OPERATOR_MULTIPLY */
   /* causes libx11 error: error_code 2 request_code 155 minor_code 8 */
   /* with x11 1.0.3, xrender 0.9.1, cairo 1.12.2 */
   /* cairo_mask (cr, source); */
 
+  cairo_surface_t *target, *image_surface;
+  cairo_t *image_cr;
+  double   x1, y1, x2, y2;
+
+  cairo_save (cr);
+
+  /* copy xlib surface to an image surface */
+  cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
+  target = cairo_get_target (cr);
+  image_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, x2, y2);
+  image_cr = cairo_create (image_surface);
+  cairo_set_source_surface(image_cr, target, 0, 0);
+  cairo_set_operator(image_cr, CAIRO_OPERATOR_SOURCE);
+  cairo_paint(image_cr);
+
+  /* render on the image surface */
+  source = cairo_pattern_reference (cairo_get_source (cr));
+  state = gtk_widget_has_focus (widget) ? GTK_STATE_SELECTED : 
GTK_STATE_ACTIVE;
+  gdk_cairo_set_source_color (image_cr, &widget->style->base[state]);
+  cairo_set_operator (image_cr, CAIRO_OPERATOR_MULTIPLY);
+  cairo_mask (image_cr, source);
+
+  /* copy the image surface back to xlib one and clean up */
+  cairo_set_source_surface (cr, image_surface, 0, 0);
+  cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
+  cairo_paint(cr);
+
+  cairo_destroy (image_cr);
+  cairo_surface_destroy (image_surface);
+#endif
+
   cairo_pattern_destroy (source);
   cairo_restore (cr);
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] pager: fixed wnck pager aspect ratio in deskbar mode

2013-12-19 Thread Andrzej
Updating branch refs/heads/master
 to c42ab58051aaf30ade4496de05fc27e4540eb961 (commit)
   from 862db2d44aed25e8a397f5314f9daab374c4e9fa (commit)

commit c42ab58051aaf30ade4496de05fc27e4540eb961
Author: Andrzej 
Date:   Fri Dec 20 03:38:39 2013 +

pager: fixed wnck pager aspect ratio in deskbar mode

Previously we were relying on new api added in libwnck-2.31.
Unfortunately, stable version of libwnck was never released and the API
was not added to libwnck-3.

This commit changes the method of setting the aspect ratio.
Aspect ratio is now calculated in the plugin using screen dimensions.

One minor limitation of this method is that we are not accounting
for wnck pager frames, so the aspect ratio may be slightly inaccurate.

 plugins/pager/pager.c |   64 ++---
 1 file changed, 45 insertions(+), 19 deletions(-)

diff --git a/plugins/pager/pager.c b/plugins/pager/pager.c
index 6f0a378..7b716a2 100644
--- a/plugins/pager/pager.c
+++ b/plugins/pager/pager.c
@@ -53,6 +53,8 @@ static void pager_plugin_set_property 
(GObject   *ob
guint  
prop_id,
const GValue  
*value,
GParamSpec
*pspec);
+static void pager_plugin_size_request (GtkWidget 
*widget,
+   GtkRequisition
*requisition);
 static gboolean pager_plugin_scroll_event (GtkWidget 
*widget,
GdkEventScroll
*event);
 static void pager_plugin_screen_changed   (GtkWidget 
*widget,
@@ -86,6 +88,7 @@ struct _PagerPlugin
   guint  scrolling : 1;
   guint  miniature_view : 1;
   gint   rows;
+  gfloat ratio;
 };
 
 enum
@@ -117,6 +120,7 @@ pager_plugin_class_init (PagerPluginClass *klass)
 
   widget_class = GTK_WIDGET_CLASS (klass);
   widget_class->scroll_event = pager_plugin_scroll_event;
+  widget_class->size_request = pager_plugin_size_request;
 
   plugin_class = XFCE_PANEL_PLUGIN_CLASS (klass);
   plugin_class->construct = pager_plugin_construct;
@@ -156,6 +160,7 @@ pager_plugin_init (PagerPlugin *plugin)
   plugin->scrolling = TRUE;
   plugin->miniature_view = TRUE;
   plugin->rows = 1;
+  plugin->ratio = 1.0;
   plugin->pager = NULL;
 }
 
@@ -303,15 +308,8 @@ pager_plugin_screen_layout_changed (PagerPlugin *plugin)
   if (!wnck_pager_set_n_rows (WNCK_PAGER (plugin->pager), plugin->rows))
 g_message ("Setting the pager rows returned false. Maybe the setting 
is not applied.");
 
-#ifdef WNCK_CHECK_VERSION
-#if WNCK_CHECK_VERSION (2,31,0)
-  wnck_pager_set_layout_policy (WNCK_PAGER (plugin->pager),
-(mode == 
XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) ?
-WNCK_PAGER_LAYOUT_POLICY_WIDTH_FOR_HEIGHT :
-WNCK_PAGER_LAYOUT_POLICY_HEIGHT_FOR_WIDTH);
-#endif
-#endif
   wnck_pager_set_orientation (WNCK_PAGER (plugin->pager), orientation);
+  plugin->ratio = (gfloat) gdk_screen_width () / (gfloat) 
gdk_screen_height ();
 }
   else
 {
@@ -421,17 +419,7 @@ pager_plugin_mode_changed (XfcePanelPlugin 
*panel_plugin,
 GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
 
   if (plugin->miniature_view)
-{
-#ifdef WNCK_CHECK_VERSION
-#if WNCK_CHECK_VERSION (2,31,0)
-  wnck_pager_set_layout_policy (WNCK_PAGER (plugin->pager),
-(mode == 
XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) ?
-WNCK_PAGER_LAYOUT_POLICY_WIDTH_FOR_HEIGHT :
-WNCK_PAGER_LAYOUT_POLICY_HEIGHT_FOR_WIDTH);
-#endif
-#endif
-  wnck_pager_set_orientation (WNCK_PAGER (plugin->pager), orientation);
-}
+wnck_pager_set_orientation (WNCK_PAGER (plugin->pager), orientation);
   else
 pager_buttons_set_orientation (XFCE_PAGER_BUTTONS (plugin->pager), 
orientation);
 }
@@ -560,3 +548,41 @@ pager_plugin_configure_plugin (XfcePanelPlugin 
*panel_plugin)
 
   gtk_widget_show (GTK_WIDGET (dialog));
 }
+
+
+
+static void
+pager_plugin_size_request (GtkWidget  *widget,
+   GtkRequisition *requisition)
+{
+  PagerPlugin *plugin = XFCE_PAGER_PLUGIN (widget);
+  XfcePanelPluginMode  mode;
+  gint n_workspaces, n_cols;
+
+  if (plugin->miniature_view)
+{
+  mode   = xfce_panel_plugin_get_mode (XFCE_PANEL_PLUGIN (plugin));
+  n_workspaces = wnck_screen_get_workspace_count (plugin->wnck_screen);
+  n_cols = MAX (1, (n_workspaces + plugin->rows - 1) / plugin->rows);
+  if (

[Xfce4-commits] pager: fallback for case when pager is not yet set

2013-12-20 Thread Andrzej
Updating branch refs/heads/master
 to 08643272caef08634773b3074de7b2cadffb0926 (commit)
   from c42ab58051aaf30ade4496de05fc27e4540eb961 (commit)

commit 08643272caef08634773b3074de7b2cadffb0926
Author: Andrzej 
Date:   Fri Dec 20 09:35:58 2013 +

pager: fallback for case when pager is not yet set

Just in case. Not needed on my system.

 plugins/pager/pager.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/plugins/pager/pager.c b/plugins/pager/pager.c
index 7b716a2..149e19e 100644
--- a/plugins/pager/pager.c
+++ b/plugins/pager/pager.c
@@ -580,9 +580,14 @@ pager_plugin_size_request (GtkWidget  *widget,
   requisition->height = (gint) (requisition->width / n_cols / 
plugin->ratio * plugin->rows);
 }
 }
-  else
+  else if (plugin->pager)
 {
   gtk_widget_size_request (plugin->pager, requisition);
 }
+  else // initial fallback
+{
+  requisition->width = 1;
+  requisition->height = 1;
+}
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] pager: recalculate size when panel size changes

2013-12-20 Thread Andrzej
Updating branch refs/heads/master
 to 964741f5b67e5f4fa97bab338d980c5eea0fa09b (commit)
   from 08643272caef08634773b3074de7b2cadffb0926 (commit)

commit 964741f5b67e5f4fa97bab338d980c5eea0fa09b
Author: Andrzej 
Date:   Fri Dec 20 10:02:07 2013 +

pager: recalculate size when panel size changes

 plugins/pager/pager.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/plugins/pager/pager.c b/plugins/pager/pager.c
index 149e19e..3ff65a2 100644
--- a/plugins/pager/pager.c
+++ b/plugins/pager/pager.c
@@ -401,6 +401,8 @@ static gboolean
 pager_plugin_size_changed (XfcePanelPlugin *panel_plugin,
gint size)
 {
+  gtk_widget_queue_resize (GTK_WIDGET (panel_plugin));
+
   /* do not set fixed size */
   return TRUE;
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed DnD markers with non-square small items.

2012-10-10 Thread Andrzej
Updating branch refs/heads/master
 to 478c43e89b291e89f726d43a861e1266e0fa5905 (commit)
   from 35086017fa0e7b87f2b51755c3e61a89a31f5527 (commit)

commit 478c43e89b291e89f726d43a861e1266e0fa5905
Author: Andrzej 
Date:   Thu Oct 11 00:20:44 2012 +0100

Fixed DnD markers with non-square small items.

 panel/panel-itembar.c |   89 +++--
 1 files changed, 64 insertions(+), 25 deletions(-)

diff --git a/panel/panel-itembar.c b/panel/panel-itembar.c
index 142a718..98ffae1 100644
--- a/panel/panel-itembar.c
+++ b/panel/panel-itembar.c
@@ -21,6 +21,7 @@
 #include 
 #endif
 
+#include 
 #include 
 #include 
 
@@ -95,7 +96,7 @@ struct _PanelItembar
 
   /* dnd support */
   gint highlight_index;
-  gint highlight_x, highlight_y;
+  gint highlight_x, highlight_y, highlight_length;
   gboolean highlight_small;
 };
 
@@ -234,6 +235,7 @@ panel_itembar_init (PanelItembar *itembar)
   itembar->size = 30;
   itembar->nrows = 1;
   itembar->highlight_index = -1;
+  itembar->highlight_length = -1;
 
   GTK_WIDGET_SET_FLAGS (GTK_WIDGET (itembar), GTK_NO_WINDOW);
 
@@ -702,12 +704,14 @@ panel_itembar_expose_event (GtkWidget  *widget,
   (!IS_HORIZONTAL (itembar) && itembar->highlight_small))
 {
   rect.width = HIGHLIGHT_SIZE;
-  rect.height = row_size;
+  rect.height = (itembar->highlight_length != -1) ?
+itembar->highlight_length : row_size;
 }
   else
 {
   rect.height = HIGHLIGHT_SIZE;
-  rect.width = row_size;
+  rect.width = (itembar->highlight_length != -1) ?
+itembar->highlight_length : row_size;
 }
 
   /* draw highlight box */
@@ -1015,11 +1019,12 @@ panel_itembar_get_drop_index (PanelItembar *itembar,
   gint  x,
   gint  y)
 {
-  PanelItembarChild *child;
-  GSList*li;
+  PanelItembarChild *child, *child2;
+  GSList*li, *li2;
   GtkAllocation  alloc;
-  guint  idx, col_start_idx;
-  gint   xr, yr;
+  guint  idx, col_start_idx, col_end_idx;
+  gint   xr, yr, col_width;
+  gdoubleaspect;
 
   panel_return_val_if_fail (PANEL_IS_ITEMBAR (itembar), 0);
 
@@ -1037,15 +1042,19 @@ panel_itembar_get_drop_index (PanelItembar *itembar,
   x >= alloc.x + alloc.width || y >= alloc.y + alloc.height)
 return g_slist_length (itembar->children);
 
-  for (li = itembar->children, idx = 0, col_start_idx = 0; li != NULL; li = 
g_slist_next (li))
+  col_width = -1;
+  itembar->highlight_length = -1;
+  idx = 0;
+  col_start_idx = 0;
+  col_end_idx = 0;
+
+  for (li = itembar->children; li != NULL; li = g_slist_next (li))
 {
   child = li->data;
   if (G_UNLIKELY (child == NULL))
 continue;
 
-  if (child->row == 0)
-col_start_idx = idx;
-
+  panel_assert (child->widget != NULL);
   alloc = child->widget->allocation;
 
   if (!IS_HORIZONTAL (itembar))
@@ -1053,31 +1062,61 @@ panel_itembar_get_drop_index (PanelItembar *itembar,
 
   xr = x - alloc.x;
   yr = y - alloc.y;
+
   if (child->option == CHILD_OPTION_SMALL)
 {
+  /* are we at the beginning of the column? */
+  if (child->row == 0)
+{
+  col_start_idx = idx;
+  col_end_idx = idx + 1;
+  col_width = alloc.width;
+  /* find the width of the current column and the idx of last item 
*/
+  for (li2 = g_slist_next (li); li2 != NULL; li2 = g_slist_next 
(li2))
+{
+  child2 = li2->data;
+  if (G_UNLIKELY (child2 == NULL))
+continue;
+  if (child2->row == 0)
+break;
+  panel_assert (child2->widget != NULL);
+  col_end_idx++;
+  if (IS_HORIZONTAL (itembar))
+col_width = MAX (col_width, 
child2->widget->allocation.width);
+  else
+col_width = MAX (col_width, 
child2->widget->allocation.height);
+}
+}
+
+  /* calculate aspect ratio */
+  if (alloc.height > 0 && col_width > 0)
+aspect = (gdouble) col_width / (gdouble) alloc.height;
+  else
+aspect = 1.0;
+
   /* before current column */
   if (xr < 0 ||
-  (xr < yr && xr < alloc.height - yr))
+  (xr < (gint) round (yr * aspect) &&
+   xr < (gint) round ((alloc.height - yr) * aspect)))
 {
   idx = col_start_idx;
   break;
 }
   /* before current child */
- 

[Xfce4-commits] Creating branch andrzejr/ellipsize

2012-10-13 Thread Andrzej
Updating branch refs/heads/andrzejr/ellipsize
 as new branch
 to aff11a4b52c15101d91053b9095596ebfa34ece0 (commit)

Branches are created implicitly by pushing. This mail only exists to 
let you know that there was code pushed to 

  refs/heads/andrzejr/ellipsize

for the first time. Mails for the commits that lead to the creation 
of the branch will follow after this mail.
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Ellipsize labels in a compact list mode.

2012-10-13 Thread Andrzej
Updating branch refs/heads/andrzejr/ellipsize
 to aff11a4b52c15101d91053b9095596ebfa34ece0 (commit)
   from c4d3a3a9abe1977251779aa5427b854d2bc0435b (commit)

commit aff11a4b52c15101d91053b9095596ebfa34ece0
Author: Andrzej 
Date:   Sat Oct 13 20:50:38 2012 +0100

Ellipsize labels in a compact list mode.

 thunar/thunar-compact-view.c  |3 +-
 thunar/thunar-text-renderer.c |   63 ++---
 2 files changed, 48 insertions(+), 18 deletions(-)

diff --git a/thunar/thunar-compact-view.c b/thunar/thunar-compact-view.c
index 68d1473..49f11f0 100644
--- a/thunar/thunar-compact-view.c
+++ b/thunar/thunar-compact-view.c
@@ -80,7 +80,8 @@ thunar_compact_view_init (ThunarCompactView *compact_view)
   /* setup the name renderer (wrap only very long names) */
   g_object_set (G_OBJECT (THUNAR_STANDARD_VIEW (compact_view)->name_renderer),
 "wrap-mode", PANGO_WRAP_WORD_CHAR,
-"wrap-width", 1280,
+"ellipsize-mode", PANGO_ELLIPSIZE_MIDDLE,
+"wrap-width", 200,
 "xalign", 0.0f,
 "yalign", 0.5f,
 NULL);
diff --git a/thunar/thunar-text-renderer.c b/thunar/thunar-text-renderer.c
index 9972641..0da6fb6 100644
--- a/thunar/thunar-text-renderer.c
+++ b/thunar/thunar-text-renderer.c
@@ -46,6 +46,7 @@ enum
   PROP_TEXT,
   PROP_WRAP_MODE,
   PROP_WRAP_WIDTH,
+  PROP_ELLIPSIZE_MODE,
 };
 
 enum
@@ -117,27 +118,28 @@ struct _ThunarTextRendererClass
 
 struct _ThunarTextRenderer
 {
-  GtkCellRenderer __parent__;
-
-  PangoLayout*layout;
-  GtkWidget  *widget;
-  gbooleantext_static;
-  gchar  *text;
-  gintchar_width;
-  gintchar_height;
-  PangoWrapMode   wrap_mode;
-  gintwrap_width;
-  gbooleanfollow_state;
-  gintfocus_width;;
-  PangoAlignment  alignment;
+  GtkCellRenderer __parent__;
+
+  PangoLayout*layout;
+  GtkWidget  *widget;
+  gbooleantext_static;
+  gchar  *text;
+  gintchar_width;
+  gintchar_height;
+  PangoWrapMode   wrap_mode;
+  gintwrap_width;
+  PangoEllipsizeMode  ellipsize_mode;
+  gbooleanfollow_state;
+  gintfocus_width;
+  PangoAlignment  alignment;
 
   /* underline prelited rows */
-  gbooleanfollow_prelit;
+  gbooleanfollow_prelit;
 
   /* cell editing support */
-  GtkWidget  *entry;
-  gbooleanentry_menu_active;
-  gintentry_menu_popdown_timer_id;
+  GtkWidget  *entry;
+  gbooleanentry_menu_active;
+  gintentry_menu_popdown_timer_id;
 };
 
 
@@ -254,6 +256,24 @@ thunar_text_renderer_class_init (ThunarTextRendererClass 
*klass)
  -1, G_MAXINT, -1,
  EXO_PARAM_READWRITE));
 
+
+  /**
+   * ThunarTextRenderer:ellipsize-mode:
+   *
+   * Specifies whether to break the string into multiple lines or
+   * to shorten the line, if the cell renderer does not have enough room
+   * to display the entire string. This property has
+   * no effect unless the wrap-width property is set.
+   **/
+  g_object_class_install_property (gobject_class,
+   PROP_ELLIPSIZE_MODE,
+   g_param_spec_enum ("ellipsize-mode",
+  "ellipsize-mode",
+  "ellipsize-mode",
+  
PANGO_TYPE_ELLIPSIZE_MODE,
+  PANGO_ELLIPSIZE_NONE,
+  EXO_PARAM_READWRITE));
+
   /**
* ThunarTextRenderer::edited:
* @text_renderer : a #ThunarTextRenderer.
@@ -336,6 +356,10 @@ thunar_text_renderer_get_property (GObject*object,
   g_value_set_int (value, text_renderer->wrap_width);
   break;
 
+case PROP_ELLIPSIZE_MODE:
+  g_value_set_enum (value, text_renderer->ellipsize_mode);
+  break;
+
 default:
   G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
   break;
@@ -389,6 +413,10 @@ thunar_text_renderer_set_property (GObject  *object,
 gtk_cell_renderer_set_fixed_size (GTK_CELL_RENDERER (text_renderer), 
-1, -1);
   break;
 
+case PROP_ELLIPSIZE_MODE:
+  text_renderer->ellipsize_mode = g_value_get_enum (value);
+  break;
+
 default:
   G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
   break;
@@ -432,6 +460,7 @@ thunar_text_renderer_get_size (GtkCellRenderer *renderer,
   /* calculate the real text dimension */
   pango_layout_set_width (text_renderer->layout, text_renderer-&

[Xfce4-commits] Fixed compilation warnings

2012-11-17 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 24788ad2952d8afc4e2135d176bd62a7755a3d87 (commit)
   from c40c282be0037c4de230fc7178c786a5fbab3689 (commit)

commit 24788ad2952d8afc4e2135d176bd62a7755a3d87
Author: Andrzej 
Date:   Thu May 10 23:47:10 2012 +0900

Fixed compilation warnings

The remaining ones:
/usr/local/include/libindicator-0.4/libindicator/indicator-object.h:190:13: 
warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
come from libindicator headers.

 panel-plugin/indicator-box.c|   11 
 panel-plugin/indicator-button.c |4 ---
 panel-plugin/indicator.c|   55 +-
 3 files changed, 30 insertions(+), 40 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 78567b4..854f4a4 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -166,7 +166,6 @@ xfce_indicator_box_get_property (GObject*object,
  GParamSpec *pspec)
 {
   XfceIndicatorBox *box = XFCE_INDICATOR_BOX (object);
-  GPtrArray*array;
 
   switch (prop_id)
 {
@@ -194,9 +193,6 @@ xfce_indicator_box_set_property (GObject  *object,
 {
   XfceIndicatorBox *box = XFCE_INDICATOR_BOX (object);
   gint  val;
-  gint  size;
-  XfceIndicatorButton  *child;
-  GSList   *li;
 
   switch (prop_id)
 {
@@ -232,8 +228,6 @@ xfce_indicator_box_set_orientation (XfceIndicatorBox *box,
 GtkOrientationorientation)
 {
   gboolean  needs_update = FALSE;
-  XfceIndicatorButton  *child;
-  GSList   *li;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
 
@@ -264,9 +258,6 @@ xfce_indicator_box_set_size (XfceIndicatorBox *box,
  gint  nrows)
 {
   gboolean  needs_update = FALSE;
-  XfceIndicatorButton  *child;
-  GSList   *li;
-  gint  size;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
 
@@ -310,8 +301,6 @@ xfce_indicator_box_add (GtkContainer *container,
 GtkWidget*child)
 {
   XfceIndicatorBox*box = XFCE_INDICATOR_BOX (container);
-  XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (child);
-  gint size;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
   g_return_if_fail (GTK_IS_WIDGET (child));
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 97e26d3..ef8fa56 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -278,8 +278,6 @@ xfce_indicator_button_set_label (XfceIndicatorButton 
*button,
 static void
 on_pixbuf_changed (GtkImage *image, GParamSpec *pspec, XfceIndicatorButton 
*button)
 {
-  GdkPixbuf *pixbuf;
-
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (GTK_IS_IMAGE (image));
   g_return_if_fail (XFCE_IS_PANEL_IMAGE (button->icon));
@@ -293,8 +291,6 @@ void
 xfce_indicator_button_set_image (XfceIndicatorButton *button,
  GtkImage*image)
 {
-  GdkPixbuf *pixbuf;
-
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (GTK_IS_IMAGE (image));
 
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 88f4d42..09aab6a 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -154,9 +154,9 @@ static void
 indicator_class_init (IndicatorPluginClass *klass)
 {
   XfcePanelPluginClass *plugin_class;
-  GObjectClass *gobject_class;
+  //GObjectClass *gobject_class;
 
-  gobject_class = G_OBJECT_CLASS (klass);
+  //gobject_class = G_OBJECT_CLASS (klass);
   //gobject_class->get_property = indicator_get_property;
   //gobject_class->set_property = indicator_set_property;
 
@@ -196,7 +196,7 @@ indicator_init (IndicatorPlugin *indicator)
 static void
 indicator_free (XfcePanelPlugin *plugin)
 {
-  IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
+  //IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
   GtkWidget *dialog;
 
   /* check if the dialog is still open. if so, destroy it */
@@ -274,7 +274,6 @@ static void
 indicator_construct (XfcePanelPlugin *plugin)
 {
   IndicatorPlugin  *indicator = XFCE_INDICATOR_PLUGIN (plugin);
-  GtkRcStyle   *style;
   gint  indicators_loaded = 0;
   GtkWidget*label;
 
@@ -304,7 +303,7 @@ indicator_construct (XfcePanelPlugin *plugin)
 length = (indicator->excluded_modules != NULL) ? g_strv_length 
(indicator->excluded_modules) : 0;
 while ((name = g_dir_read_name(dir)) != NULL) {
   for (i = 0; i < length; ++i) {
-if (match = (g_strcmp0 (name, indicator->excluded_modules[i]) == 0))
+if ((match = g_strcmp0 (name, indicator->excluded_modules[i])) == 0)
   break;
   }
 
@@ -374,34 +373,40 @@ entry_removed (IndicatorObject * 

[Xfce4-commits] Make sure the menu is closed when the button is removed.

2012-11-17 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to aaa1b5f89857605cfbc512f17623d2c66e1f1512 (commit)
   from 24788ad2952d8afc4e2135d176bd62a7755a3d87 (commit)

commit aaa1b5f89857605cfbc512f17623d2c66e1f1512
Author: Andrzej 
Date:   Wed Jul 25 17:35:50 2012 +0900

Make sure the menu is closed when the button is removed.

 panel-plugin/indicator-button.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index ef8fa56..8c2aaa7 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -474,6 +474,11 @@ xfce_indicator_button_disconnect_signals 
(XfceIndicatorButton *button)
 {
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
 
+  if (button->menu != 0)
+{
+  gtk_menu_popdown (button->menu);
+}
+
   if (button->box_layout_changed_id != 0)
 {
   g_signal_handler_disconnect (button->buttonbox, 
button->box_layout_changed_id);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Removed unneeded event box causing issues with transparent panels.

2012-11-17 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 00633e1de8308a1456a46f8dc03f7baa2a62c30a (commit)
   from aaa1b5f89857605cfbc512f17623d2c66e1f1512 (commit)

commit 00633e1de8308a1456a46f8dc03f7baa2a62c30a
Author: Andrzej 
Date:   Sat Nov 17 21:39:39 2012 +

Removed unneeded event box causing issues with transparent panels.

For unknown reasons indicator plugin was handling transparency
correctly when run as an executable but not when run as a module.

 panel-plugin/indicator.c |   10 +-
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 09aab6a..e807328 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -80,7 +80,6 @@ struct _IndicatorPlugin
   /* panel widgets */
   GtkWidget   *item;
   GtkWidget   *buttonbox;
-  GtkWidget   *ebox;
 
   /* indicator settings */
   gchar  **excluded_modules;
@@ -179,16 +178,9 @@ indicator_init (IndicatorPlugin *indicator)
 {
   XfcePanelPlugin  *plugin = XFCE_PANEL_PLUGIN (indicator);
 
-  indicator->ebox = gtk_event_box_new();
-  gtk_widget_set_can_focus(GTK_WIDGET(indicator->ebox), TRUE);
-
   indicator->buttonbox = xfce_indicator_box_new (plugin);
-  gtk_container_add (GTK_CONTAINER (indicator->ebox), 
GTK_WIDGET(indicator->buttonbox));
-  gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator->ebox));
+  gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator->buttonbox));
   gtk_widget_show(GTK_WIDGET(indicator->buttonbox));
-  gtk_widget_show(GTK_WIDGET(indicator->ebox));
-  /* show the panel's right-click menu on this menu */
-  xfce_panel_plugin_add_action_widget (plugin, indicator->ebox);
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Properly connecting indicator-list-changed signal.

2013-03-12 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 290c5f4596900e67f3c2e87f730812e8e48a9333 (commit)
   from 0db001bdd6e764e2e375ac69ad01418c09c3b6da (commit)

commit 290c5f4596900e67f3c2e87f730812e8e48a9333
Author: Andrzej 
Date:   Tue Mar 12 22:13:44 2013 +

Properly connecting indicator-list-changed signal.

 panel-plugin/indicator-box.c|8 
 panel-plugin/indicator-config.c |5 +
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index a48f22b..3b820a9 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -113,10 +113,6 @@ xfce_indicator_box_init (XfceIndicatorBox *box)
 
   /* todo: no deallocation function for values */
   box->children = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, 
NULL);
-
-  box->indicator_list_changed_id =
-g_signal_connect_swapped (G_OBJECT (box->config), "indicator-list-changed",
-  G_CALLBACK (xfce_indicator_box_list_changed), 
box);
 }
 
 
@@ -146,6 +142,10 @@ xfce_indicator_box_new (IndicatorConfig *config)
 
   box->config = config;
 
+  box->indicator_list_changed_id =
+g_signal_connect_swapped (G_OBJECT (box->config), "indicator-list-changed",
+  G_CALLBACK (xfce_indicator_box_list_changed), 
box);
+
   return GTK_WIDGET (box);
 }
 
diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index f73ea94..09dbb96 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -596,6 +596,7 @@ indicator_config_blacklist_set (IndicatorConfig *config,
   g_hash_table_remove (config->blacklist, name);
 }
   g_object_notify (G_OBJECT (config), "blacklist");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
@@ -622,6 +623,7 @@ indicator_config_whitelist_set (IndicatorConfig *config,
   g_hash_table_remove (config->whitelist, name);
 }
   g_object_notify (G_OBJECT (config), "whitelist");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
@@ -668,6 +670,7 @@ indicator_config_add_known_indicator (IndicatorConfig 
*config,
   config->known_indicators = g_list_append (config->known_indicators, g_strdup 
(name));
 
   g_object_notify (G_OBJECT (config), "known-indicators");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
@@ -709,6 +712,7 @@ indicator_config_swap_known_indicators (IndicatorConfig 
*config,
   g_list_free (li_tmp);
 
   g_object_notify (G_OBJECT (config), "known-indicators");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
@@ -727,6 +731,7 @@ indicator_config_names_clear (IndicatorConfig *config)
 
   g_hash_table_remove_all (config->whitelist);
   g_object_notify (G_OBJECT (config), "whitelist");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Sort indicator entries by location.

2013-03-12 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 33d3eb312c04fb7ae12e2a316e52a838267e5e0a (commit)
   from 290c5f4596900e67f3c2e87f730812e8e48a9333 (commit)

commit 33d3eb312c04fb7ae12e2a316e52a838267e5e0a
Author: Andrzej 
Date:   Tue Mar 12 22:53:25 2013 +

Sort indicator entries by location.

(or by name_hint, or don't sort at all)

 panel-plugin/indicator-box.c|   32 +++-
 panel-plugin/indicator-button.c |   14 ++
 panel-plugin/indicator-button.h |2 ++
 3 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 3b820a9..c39435e 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -163,6 +163,32 @@ xfce_indicator_box_list_changed (XfceIndicatorBox *box,
 
 
 
+static gint
+xfce_indicator_box_sort_buttons (gconstpointer a,
+ gconstpointer b)
+{
+  XfceIndicatorButton *a0 = XFCE_INDICATOR_BUTTON (a);
+  XfceIndicatorButton *b0 = XFCE_INDICATOR_BUTTON (b);
+  guinta1, b1;
+
+  a1 = xfce_indicator_button_get_pos (a0);
+  b1 = xfce_indicator_button_get_pos (b0);
+
+  /* group all entries with location==0 at the beginning of the list
+   * but don't sort them (they may depend on insertion order) */
+
+  /* if there are two entries with the same non-zero location
+   * try to resolve their order by their name_hint */
+  if (a1 != 0 && a1 == b1)
+return -g_strcmp0 (xfce_indicator_button_get_entry(a0)->name_hint,
+   xfce_indicator_button_get_entry(b0)->name_hint);
+
+  /* else, use the location field */
+  return (a1-b1);
+}
+
+
+
 static void
 xfce_indicator_box_add (GtkContainer *container,
 GtkWidget*child)
@@ -178,7 +204,11 @@ xfce_indicator_box_add (GtkContainer *container,
 
   io_name = xfce_indicator_button_get_io_name (button);
   li = g_hash_table_lookup (box->children, io_name);
-  li = g_list_append (li, button);
+  if (xfce_indicator_button_get_pos (button) == 0)
+li = g_list_append (li, button);
+  else
+li = g_list_insert_sorted (li, button, xfce_indicator_box_sort_buttons);
+
   g_hash_table_replace (box->children, g_strdup (io_name), li);
 
   gtk_widget_set_parent (child, GTK_WIDGET (box));
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index f01db2f..98f547d 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -434,6 +434,20 @@ xfce_indicator_button_get_io_name (XfceIndicatorButton 
*button)
 
 
 
+guint
+xfce_indicator_button_get_pos (XfceIndicatorButton *button)
+{
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 0);
+
+  return indicator_object_get_location (button->io, button->entry);
+}
+
+
+
+
+
+
+
 GtkMenu *
 xfce_indicator_button_get_menu (XfceIndicatorButton *button)
 {
diff --git a/panel-plugin/indicator-button.h b/panel-plugin/indicator-button.h
index 5eb1dc1..b25efa6 100644
--- a/panel-plugin/indicator-button.h
+++ b/panel-plugin/indicator-button.h
@@ -59,6 +59,8 @@ IndicatorObject*xfce_indicator_button_get_io  
(XfceIndicatorButton
 
 const gchar*xfce_indicator_button_get_io_name (XfceIndicatorButton 
   *button);
 
+guint   xfce_indicator_button_get_pos (XfceIndicatorButton 
   *button);
+
 GtkMenu*xfce_indicator_button_get_menu(XfceIndicatorButton 
   *button);
 
 GtkWidget  *xfce_indicator_button_new (IndicatorObject 
   *io,
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Added "pretty names" and indicators for known indicators.

2013-03-12 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to b552265a8ed94468d24f6eeb387a2a7b762cc94c (commit)
   from 33d3eb312c04fb7ae12e2a316e52a838267e5e0a (commit)

commit b552265a8ed94468d24f6eeb387a2a7b762cc94c
Author: Andrzej 
Date:   Wed Mar 13 00:15:05 2013 +

Added "pretty names" and indicators for known indicators.

I've used listed indicators available in Ubuntu (12.10) repository.
The names are unofficial and icons are picked from my own system.
Please feel free to update/fix them.

 panel-plugin/indicator-dialog.c |   95 +++---
 panel-plugin/indicator-dialog.glade |   21 +++-
 2 files changed, 95 insertions(+), 21 deletions(-)

diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index 1387c76..d4740fe 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -43,6 +43,23 @@
 
 
 
+/* known indicator names */
+static const gchar *pretty_names[][3] =
+{
+  /* raw name,  pretty name, 
icon-name(?) */
+  { "libapplication.so",N_("Application Indicators"),   
"application-default-icon" },
+  { "libsoundmenu.so",  N_("Sound Menu"),   
"preferences-desktop-sound" },
+  { "libprintersmenu.so",   N_("Printers Menu"),
"printer" },
+  { "libpower.so",  N_("Power Management"), 
NULL },
+  { "libappmenu.so",N_("Application Menus (Global Menu)"),  
"menu-editor" },
+  { "libsession.so",N_("Session Management"),   
NULL },
+  { "libmessaging.so",  N_("Messaging Menu"),   
"indicator-messages" },
+  { "libdatetime.so",   N_("Date and Time"),
"time-admin" },
+};
+
+
+#define ICON_SIZE (22)
+
 static void  indicator_dialog_build   (IndicatorDialog 
 *dialog);
 static void  indicator_dialog_response(GtkWidget   
 *window,
gint
  response_id,
@@ -71,7 +88,8 @@ enum
   COLUMN_PIXBUF,
   COLUMN_TITLE,
   COLUMN_HIDDEN,
-  COLUMN_VISIBLE
+  COLUMN_VISIBLE,
+  COLUMN_TIP
 };
 
 
@@ -102,6 +120,7 @@ static void
 indicator_dialog_add_indicator (IndicatorDialog *dialog,
 GdkPixbuf   *pixbuf,
 const gchar *name,
+const gchar *pretty_name,
 gboolean hidden,
 gboolean visible)
 {
@@ -114,10 +133,11 @@ indicator_dialog_add_indicator (IndicatorDialog *dialog,
   /* insert in the store */
   gtk_list_store_append (GTK_LIST_STORE (dialog->store), &iter);
   gtk_list_store_set (GTK_LIST_STORE (dialog->store), &iter,
-  COLUMN_PIXBUF, pixbuf,
-  COLUMN_TITLE, name,
-  COLUMN_HIDDEN, hidden,
+  COLUMN_PIXBUF,  pixbuf,
+  COLUMN_TITLE,   (pretty_name != NULL) ? pretty_name : 
name,
+  COLUMN_HIDDEN,  hidden,
   COLUMN_VISIBLE, visible,
+  COLUMN_TIP, name,
   -1);
 }
 
@@ -128,6 +148,10 @@ indicator_dialog_update_indicator_names (IndicatorDialog 
*dialog)
 {
   GList*li;
   const gchar  *name;
+  const gchar  *pretty_name = NULL;
+  const gchar  *icon_name = NULL;
+  GdkPixbuf*pixbuf = NULL;
+  guint i;
 
   g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
   g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (dialog->config));
@@ -136,13 +160,35 @@ indicator_dialog_update_indicator_names (IndicatorDialog 
*dialog)
   for(li = indicator_config_get_known_indicators (dialog->config); li != NULL; 
li = li->next)
 {
   name = li->data;
+
+  /* check if we have a better name for the application */
+  for (i = 0; i < G_N_ELEMENTS (pretty_names); i++)
+{
+  if (strcmp (name, pretty_names[i][0]) == 0)
+{
+  pretty_name = pretty_names[i][1];
+  icon_name = pretty_names[i][2];
+  break;
+}
+}
+
+  /* try to load the icon name */
+  if (icon_name != NULL)
+pixbuf = xfce_panel_pixbuf_from_source (icon_name, NULL, ICON_SIZE);
+  else
+pixbuf = NULL;
+
+  /* insert indicator in the store */
   indicator_dialog_add_indicator
 (dialog,
- NULL,
+ pixbuf,
  name,
+ pretty_name,
  indicator_config_is_blac

[Xfce4-commits] Hiding one of "hidden"/"visible" columns to minimize confusion.

2013-03-12 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 346cfe1ab16173fc0c5fe13a23c144a94f99239e (commit)
   from b552265a8ed94468d24f6eeb387a2a7b762cc94c (commit)

commit 346cfe1ab16173fc0c5fe13a23c144a94f99239e
Author: Andrzej 
Date:   Wed Mar 13 01:16:13 2013 +

Hiding one of "hidden"/"visible" columns to minimize confusion.

 panel-plugin/indicator-dialog.c |   29 +
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index d4740fe..7422231 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -259,6 +259,32 @@ indicator_dialog_visible_toggled (GtkCellRendererToggle 
*renderer,
 
 
 static void
+indicator_dialog_mode_whitelist_toggled (GtkCheckButton*check_box,
+ IndicatorDialog   *dialog)
+{
+  GtkTreeViewColumn *column_visible, *column_hidden;
+  GObject   *treeview;
+  gboolean   mode_whitelist;
+
+  g_return_if_fail (GTK_IS_CHECK_BUTTON (check_box));
+  g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
+
+  mode_whitelist = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(check_box));
+
+  treeview = gtk_builder_get_object (GTK_BUILDER (dialog), 
"indicators-treeview");
+  g_return_if_fail (GTK_IS_TREE_VIEW (treeview));
+
+  column_visible = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 
COLUMN_VISIBLE);
+  column_hidden  = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 
COLUMN_HIDDEN);
+
+  gtk_tree_view_column_set_visible (column_visible,  mode_whitelist);
+  gtk_tree_view_column_set_visible (column_hidden,  !mode_whitelist);
+}
+
+
+
+
+static void
 indicator_dialog_swap_rows (IndicatorDialog  *dialog,
 GtkTreeIter  *iter_prev,
 GtkTreeIter  *iter)
@@ -445,6 +471,9 @@ indicator_dialog_build (IndicatorDialog *dialog)
   g_return_if_fail (GTK_IS_WIDGET (object));
   exo_mutual_binding_new (G_OBJECT (dialog->config), "mode-whitelist",
   G_OBJECT (object), "active");
+  g_signal_connect (G_OBJECT (object), "toggled",
+G_CALLBACK (indicator_dialog_mode_whitelist_toggled), 
dialog);
+  indicator_dialog_mode_whitelist_toggled (GTK_CHECK_BUTTON (object), 
dialog);
 
   dialog->store = gtk_builder_get_object (builder, "indicators-store");
   g_return_if_fail (GTK_IS_LIST_STORE (dialog->store));
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Force a configuration-changed signal at start-up.

2013-03-13 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 81c78516eec9103da0ba00c79ab2d936a91b6c99 (commit)
   from 346cfe1ab16173fc0c5fe13a23c144a94f99239e (commit)

commit 81c78516eec9103da0ba00c79ab2d936a91b6c99
Author: Andrzej 
Date:   Thu Mar 14 00:44:46 2013 +

Force a configuration-changed signal at start-up.

 panel-plugin/indicator-config.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index 09dbb96..c4bcf16 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -773,6 +773,8 @@ indicator_config_new (const gchar *property_base)
   property = g_strconcat (property_base, "/known-indicators", NULL);
   xfconf_g_property_bind (channel, property, 
XFCE_TYPE_INDICATOR_CONFIG_VALUE_ARRAY, config, "known-indicators");
   g_free (property);
+
+  g_signal_emit (G_OBJECT (config), 
indicator_config_signals[CONFIGURATION_CHANGED], 0);
 }
 
   return config;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed a regression, inconsistent border sizes.

2013-03-13 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 8eb305349bff65313d8300defa8918675cc38bf6 (commit)
   from 81c78516eec9103da0ba00c79ab2d936a91b6c99 (commit)

commit 8eb305349bff65313d8300defa8918675cc38bf6
Author: Andrzej 
Date:   Thu Mar 14 01:22:35 2013 +

Fixed a regression, inconsistent border sizes.

Not sure why different buttons had different x/ythickness values.
Fixed that by checking container's style. Also, reduced the border
size by 2px.

 panel-plugin/indicator-button.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 98f547d..0508674 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -469,8 +469,8 @@ xfce_indicator_button_get_icon_size (XfceIndicatorButton 
*button)
 
   indicator_size = xfce_indicator_button_get_size (button);
 
-  style = gtk_widget_get_style (GTK_WIDGET (button));
-  border_thickness = 2 * MAX (style->xthickness, style->ythickness) + 2;
+  style = gtk_widget_get_style (GTK_WIDGET (button->plugin));
+  border_thickness = 2 * MAX (style->xthickness, style->ythickness);
 
   return MIN (indicator_size - border_thickness,
   indicator_config_get_icon_size_max (button->config));
@@ -486,8 +486,8 @@ xfce_indicator_button_get_size (XfceIndicatorButton *button)
 
   g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 24);
 
-  style = gtk_widget_get_style (GTK_WIDGET (button));
-  border_thickness = 2 * MAX (style->xthickness, style->ythickness) + 2;
+  style = gtk_widget_get_style (GTK_WIDGET (button->plugin));
+  border_thickness = 2 * MAX (style->xthickness, style->ythickness) ;
 
   return MIN (indicator_config_get_panel_size (button->config) /
   indicator_config_get_nrows (button->config),
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed crash on Xfce 4.8 (no xfce_dialog_show_help)

2013-03-21 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to bc0abf05233f99011c77d4d6dd27943059be37bd (commit)
   from 8eb305349bff65313d8300defa8918675cc38bf6 (commit)

commit bc0abf05233f99011c77d4d6dd27943059be37bd
Author: Andrzej 
Date:   Fri Mar 22 00:30:15 2013 +

Fixed crash on Xfce 4.8 (no xfce_dialog_show_help)

Online help doesn't seem to work anyway (no page on docs.xfce.org for
non-core plugins), so for now have reverted to
goodies.xfce.org.

 panel-plugin/indicator-dialog.c |   75 +--
 1 files changed, 56 insertions(+), 19 deletions(-)

diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index 7422231..39280b5 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -41,6 +41,13 @@
 #include "indicator-dialog.h"
 #include "indicator-dialog_ui.h"
 
+#define PLUGIN_WEBSITE  
"http://goodies.xfce.org/projects/panel-plugins/xfce4-indicator-plugin";
+
+#ifdef LIBXFCE4UI_CHECK_VERSION
+#if LIBXFCE4UI_CHECK_VERSION (4,9,0)
+#define HAS_ONLINE_HELP
+#endif
+#endif
 
 
 /* known indicator names */
@@ -60,10 +67,12 @@ static const gchar *pretty_names[][3] =
 
 #define ICON_SIZE (22)
 
-static void  indicator_dialog_build   (IndicatorDialog 
 *dialog);
-static void  indicator_dialog_response(GtkWidget   
 *window,
-   gint
  response_id,
-   IndicatorDialog 
 *dialog);
+static void  indicator_dialog_build  
(IndicatorDialog  *dialog);
+static void  indicator_dialog_close_button_clicked   
(IndicatorDialog  *dialog,
+  GtkWidget
*button);
+
+static void  indicator_dialog_help_button_clicked
(IndicatorDialog  *dialog,
+  GtkWidget
*button);
 
 
 
@@ -454,8 +463,18 @@ indicator_dialog_build (IndicatorDialog *dialog)
 
   dialog->dialog = gtk_builder_get_object (builder, "dialog");
   g_return_if_fail (XFCE_IS_TITLED_DIALOG (dialog->dialog));
-  g_signal_connect (G_OBJECT (dialog->dialog), "response",
-G_CALLBACK (indicator_dialog_response), dialog);
+
+  object = gtk_builder_get_object (builder, "close-button");
+  g_return_if_fail (GTK_IS_BUTTON (object));
+  g_signal_connect_swapped (G_OBJECT (object), "clicked",
+G_CALLBACK 
(indicator_dialog_close_button_clicked),
+dialog);
+
+  object = gtk_builder_get_object (builder, "help-button");
+  g_return_if_fail (GTK_IS_BUTTON (object));
+  g_signal_connect_swapped (G_OBJECT (object), "clicked",
+G_CALLBACK 
(indicator_dialog_help_button_clicked),
+dialog);
 
   object = gtk_builder_get_object (builder, "size-max");
   g_return_if_fail (GTK_IS_WIDGET (object));
@@ -518,23 +537,41 @@ indicator_dialog_build (IndicatorDialog *dialog)
 
 
 static void
-indicator_dialog_response (GtkWidget*window,
-   gint  response_id,
-   IndicatorDialog  *dialog)
+indicator_dialog_close_button_clicked (IndicatorDialog *dialog,
+   GtkWidget   *button)
 {
-  g_return_if_fail (GTK_IS_DIALOG (window));
   g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
+  g_return_if_fail (GTK_IS_BUTTON (button));
+  g_return_if_fail (GTK_IS_WINDOW (dialog->dialog));
 
-  if (response_id == GTK_RESPONSE_HELP)
-{
-  xfce_dialog_show_help (GTK_WINDOW (window), "xfce4-indicator", "dialog", 
NULL);
-}
-  else
-{
-  gtk_widget_destroy (window);
+  gtk_widget_destroy (GTK_WIDGET (dialog->dialog));
+  g_object_unref (G_OBJECT (dialog));
+}
 
-  g_object_unref (G_OBJECT (dialog));
-}
+
+static void
+indicator_dialog_help_button_clicked (IndicatorDialog *dialog,
+  GtkWidget   *button)
+{
+  //#ifndef HAS_ONLINE_HELP
+  gboolean result;
+  //#endif
+
+  g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
+  g_return_if_fail (GTK_IS_BUTTON (button));
+  g_return_if_fail (GTK_IS_WINDOW (dialog->dialog));
+
+  /* Doesn't seem to work */
+  //#ifdef HAS_ONLINE_HELP
+  //xfce_dialog_show_help (GTK_WINDOW (dialog->dialog), "xfce4-indicator", 
"dialog", NULL);
+  //#else
+
+  result = g_spawn_command_line_async ("exo-open --launch WebBrowser " 
PLUGIN_WEBSITE, NULL);
+
+  if 

[Xfce4-commits] Added an About dialog.

2013-03-21 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to dd4f96d9db59a24ad421fc13e8c633a384ce92a4 (commit)
   from bc0abf05233f99011c77d4d6dd27943059be37bd (commit)

commit dd4f96d9db59a24ad421fc13e8c633a384ce92a4
Author: Andrzej 
Date:   Fri Mar 22 00:31:56 2013 +

Added an About dialog.

 panel-plugin/indicator.c |   32 
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index d5d56f8..26d0ebb 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -53,6 +53,7 @@ static void indicator_construct   
 (XfcePanelPlu
 static void indicator_free 
(XfcePanelPlugin   *plugin);
 static gboolean load_module(const 
gchar   *name,
 
IndicatorPlugin   *indicator);
+static void indicator_show_about   
(XfcePanelPlugin   *plugin);
 static void indicator_configure_plugin 
(XfcePanelPlugin   *plugin);
 static gboolean indicator_size_changed 
(XfcePanelPlugin   *plugin,
 gint   
size);
@@ -99,6 +100,7 @@ indicator_class_init (IndicatorPluginClass *klass)
   plugin_class->construct = indicator_construct;
   plugin_class->free_data = indicator_free;
   plugin_class->size_changed = indicator_size_changed;
+  plugin_class->about = indicator_show_about;
   plugin_class->configure_plugin = indicator_configure_plugin;
 #ifdef HAS_PANEL_49
   plugin_class->mode_changed = indicator_mode_changed;
@@ -135,6 +137,35 @@ indicator_free (XfcePanelPlugin *plugin)
 
 
 static void
+indicator_show_about (XfcePanelPlugin *plugin)
+{
+   GdkPixbuf *icon;
+
+   const gchar *auth[] = {
+ "Mark Trompell ", "Andrzej Radecki 
",
+ "Lionel Le Folgoc ", "Jason Conti 
",
+ "Nick Schermer ", "Evgeni Golov ", NULL 
};
+
+   g_return_if_fail (XFCE_IS_INDICATOR_PLUGIN (plugin));
+
+   icon = xfce_panel_pixbuf_from_source("xfce4-indicator-plugin", NULL, 32);
+   gtk_show_about_dialog(NULL,
+ "logo", icon,
+ "license", xfce_get_license_text 
(XFCE_LICENSE_TEXT_GPL),
+ "version", PACKAGE_VERSION,
+ "program-name", PACKAGE_NAME,
+ "comments", _("An indicator of something that needs 
your attention on the desktop"),
+ "website", 
"http://goodies.xfce.org/projects/panel-plugins/xfce4-indicator-plugin";,
+ "copyright", _("Copyright (c) 2009-2013\n"),
+ "authors", auth, NULL);
+
+   if(icon)
+ g_object_unref(G_OBJECT(icon));
+}
+
+
+
+static void
 indicator_configure_plugin (XfcePanelPlugin *plugin)
 {
   IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
@@ -202,6 +233,7 @@ indicator_construct (XfcePanelPlugin *plugin)
   GtkWidget*label;
 
   xfce_panel_plugin_menu_show_configure (plugin);
+  xfce_panel_plugin_menu_show_about (plugin);
 
   /* setup transation domain */
   xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Using 22px icon size by default.

2013-03-21 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 8c1c94439f5f7ba5e91f9c63ea7307c885de092c (commit)
   from dd4f96d9db59a24ad421fc13e8c633a384ce92a4 (commit)

commit 8c1c94439f5f7ba5e91f9c63ea7307c885de092c
Author: Andrzej 
Date:   Fri Mar 22 00:36:35 2013 +

Using 22px icon size by default.

This is the size of icons most (all?) indicators provide.

 panel-plugin/indicator-button.c |2 +-
 panel-plugin/indicator-config.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 0508674..8b269a6 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -465,7 +465,7 @@ xfce_indicator_button_get_icon_size (XfceIndicatorButton 
*button)
   gint border_thickness;
   GtkStyle*style;
 
-  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 24);
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 22);
 
   indicator_size = xfce_indicator_button_get_size (button);
 
diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index c4bcf16..d5f5cda 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -45,7 +45,7 @@
 
 
 
-#define DEFAULT_ICON_SIZE_MAX  24
+#define DEFAULT_ICON_SIZE_MAX  22
 #define DEFAULT_ALIGN_LEFT FALSE
 #define DEFAULT_EXCLUDED_MODULES   NULL
 #define DEFAULT_ORIENTATIONGTK_ORIENTATION_HORIZONTAL
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Reworked indicator entry sorting

2013-03-21 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 23dfad6c95ba2502b2c5d6b0c26722c3e09ff59e (commit)
   from 8c1c94439f5f7ba5e91f9c63ea7307c885de092c (commit)

commit 23dfad6c95ba2502b2c5d6b0c26722c3e09ff59e
Author: Andrzej 
Date:   Fri Mar 22 01:37:16 2013 +

Reworked indicator entry sorting

Special case for libapplication.so, where entries have non-unique
location fields. Sorting them by name (at least the order is same
every time the panel is started).

 panel-plugin/indicator-box.c |   31 +--
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index c39435e..4c9ae90 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -170,21 +170,38 @@ xfce_indicator_box_sort_buttons (gconstpointer a,
   XfceIndicatorButton *a0 = XFCE_INDICATOR_BUTTON (a);
   XfceIndicatorButton *b0 = XFCE_INDICATOR_BUTTON (b);
   guinta1, b1;
+  const gchar *a_io;
+  gint result = 0;
 
   a1 = xfce_indicator_button_get_pos (a0);
   b1 = xfce_indicator_button_get_pos (b0);
 
+  /* only need one */
+  a_io = xfce_indicator_button_get_io_name (a0);
+
+  // printf ("=== %s, %s; %s, %s; %d, %d", xfce_indicator_button_get_io_name 
(a0), xfce_indicator_button_get_io_name (b0), xfce_indicator_button_get_entry 
(a0)->name_hint, xfce_indicator_button_get_entry (b0)->name_hint, a1, b1);
+
+  /* special case for Application indicators (unreliable ordering) */
+  /* always compare by name and ignore location field */
+  if (a_io != NULL && g_strcmp0 (a_io, "libapplication.so") == 0)
+result = g_strcmp0 (xfce_indicator_button_get_entry(a0)->name_hint,
+xfce_indicator_button_get_entry(b0)->name_hint);
+
   /* group all entries with location==0 at the beginning of the list
* but don't sort them (they may depend on insertion order) */
 
+  if (result == 0 && (a1 != 0 || b1 != 0))
+result = a1-b1;
+
   /* if there are two entries with the same non-zero location
* try to resolve their order by their name_hint */
-  if (a1 != 0 && a1 == b1)
-return -g_strcmp0 (xfce_indicator_button_get_entry(a0)->name_hint,
-   xfce_indicator_button_get_entry(b0)->name_hint);
 
-  /* else, use the location field */
-  return (a1-b1);
+  if (result == 0)
+result =  g_strcmp0 (xfce_indicator_button_get_entry(a0)->name_hint,
+ xfce_indicator_button_get_entry(b0)->name_hint);
+
+  // printf (" -> %d\n", result);
+  return result;
 }
 
 
@@ -204,7 +221,9 @@ xfce_indicator_box_add (GtkContainer *container,
 
   io_name = xfce_indicator_button_get_io_name (button);
   li = g_hash_table_lookup (box->children, io_name);
-  if (xfce_indicator_button_get_pos (button) == 0)
+  // printf ("   +++ %s %s\n", io_name, xfce_indicator_button_get_entry 
(button)->name_hint);
+  if (g_strcmp0 (io_name, "libapplication.so") != 0 &&
+  xfce_indicator_button_get_pos (button) == 0)
 li = g_list_append (li, button);
   else
 li = g_list_insert_sorted (li, button, xfce_indicator_box_sort_buttons);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] indicator-button: minor fix to gtk_menu_popup call

2013-04-02 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to 985d34925075ffd8ea020cec1fd2e849d47aff83 (commit)
   from 23dfad6c95ba2502b2c5d6b0c26722c3e09ff59e (commit)

commit 985d34925075ffd8ea020cec1fd2e849d47aff83
Author: Andrzej 
Date:   Tue Apr 2 20:17:03 2013 +0100

indicator-button: minor fix to gtk_menu_popup call

Getting time from the event structure rather than from
gtk_get_current_event_time(). It does not solve menu flicker
issues present in some indicators (appmenu, qt-sni etc), though.
They seem to originate from the indicator itself.

 panel-plugin/indicator-button.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 8b269a6..74ed022 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -579,9 +579,8 @@ xfce_indicator_button_button_press (GtkWidget  *widget,
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),TRUE);
   gtk_menu_reposition (GTK_MENU (button->menu));
   gtk_menu_popup (button->menu, NULL, NULL,
-  xfce_panel_plugin_position_menu,
-  button->plugin,
-  1, gtk_get_current_event_time ());
+  xfce_panel_plugin_position_menu, button->plugin,
+  event->button, event->time);
   return TRUE;
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed #9040.

2013-04-02 Thread Andrzej
Updating branch refs/heads/andrzejr/tmp3
 to f60f6d59702faef79cb3c346002395cbd0696c86 (commit)
   from 985d34925075ffd8ea020cec1fd2e849d47aff83 (commit)

commit f60f6d59702faef79cb3c346002395cbd0696c86
Author: Andrzej 
Date:   Wed Apr 3 01:46:26 2013 +0100

Fixed #9040.

This required getting replacing XfcePanelImage with GtkImage. The former
does not work reliably with non-square icons and added automatization
is not needed in this case.

Only horizontal non-square icons are supported (vertical will be squeezed
into a square shape). Non-square icons are rendered in a single row
(like indicators with labels).

 panel-plugin/indicator-box.c|   16 +
 panel-plugin/indicator-button.c |   63 ++
 panel-plugin/indicator-button.h |2 +
 3 files changed, 54 insertions(+), 27 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 4c9ae90..c181009 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -336,7 +336,7 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
   gint row;
   gint nrows;
   gint x;
-  gboolean has_label;
+  gboolean has_label, rectangular_icon;
   GtkOrientation   panel_orientation;
 
   panel_size = indicator_config_get_panel_size (box->config);
@@ -359,9 +359,10 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
 
   gtk_widget_size_request (GTK_WIDGET (button), &child_req);
   has_label = (xfce_indicator_button_get_label (button) != NULL);
+  rectangular_icon = xfce_indicator_button_is_icon_rectangular 
(button);
 
   /* wrap rows if column is overflowing or a label is encountered */
-  if (row > 0 && (has_label || row >= nrows))
+  if (row > 0 && (has_label || row >= nrows || rectangular_icon))
 {
   x += length;
   row = 0;
@@ -371,7 +372,7 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
   length =
 MAX (length, (panel_orientation == GTK_ORIENTATION_HORIZONTAL) ? 
child_req.width :child_req.height);
 
-  if (has_label || row >= nrows)
+  if (has_label || row >= nrows || rectangular_icon)
 {
   x += length;
   row = 0;
@@ -416,7 +417,7 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   gint length, width;
   gint row;
   gint nrows;
-  gboolean has_label;
+  gboolean has_label, rectangular_icon;
   GtkOrientation   panel_orientation;
 
   row = 0;
@@ -445,9 +446,10 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   gtk_widget_get_child_requisition (GTK_WIDGET (button), &child_req);
 
   has_label = (xfce_indicator_button_get_label (button) != NULL);
+  rectangular_icon = xfce_indicator_button_is_icon_rectangular 
(button);
 
   /* wrap rows if column is overflowing or a label is encountered */
-  if (row > 0 && (has_label || row >= nrows))
+  if (row > 0 && (has_label || row >= nrows || rectangular_icon))
 {
   x += length;
   y = 0;
@@ -455,7 +457,7 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   length = 0;
 }
 
-  width = (has_label) ? panel_size : size;
+  width = (has_label || rectangular_icon) ? panel_size : size;
   length = MAX (length,
 (panel_orientation == GTK_ORIENTATION_HORIZONTAL) ? 
child_req.width :child_req.height);
 
@@ -479,7 +481,7 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
 
   gtk_widget_size_allocate (GTK_WIDGET (button), &child_alloc);
 
-  if (has_label || row >= nrows)
+  if (has_label || row >= nrows || rectangular_icon)
 {
   x += length;
   y = 0;
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 74ed022..25a3572 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -67,6 +67,7 @@ struct _XfceIndicatorButton
   GtkWidget*label;
   GtkWidget*icon;
   GtkWidget*orig_icon;
+  gboolean  rectangular_icon;
 
   gulongorig_icon_changed_id;
   gulongconfiguration_changed_id;
@@ -119,6 +120,7 @@ xfce_indicator_button_init (XfceIndicatorButton *button)
   button->icon = NULL;
   button->orig_icon_changed_id = 0;
   button->configuration_changed_id = 0;
+  button->rectangular_icon = FALSE;
 
   button->align_box = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
   gtk_container_add (GTK_CONTAINER (button), button->align_box);
@@ -214,8 +216,6 @@ xfce_indicator_b

[Xfce4-commits] Bugfix in icon/pixbuf resizing code.

2013-04-03 Thread Andrzej
Updating branch refs/heads/master
 to 65e9712bdd3f1f7013856ff8af0e311a57fa8d34 (commit)
   from 791ab4d9f75fe2916cfffeca225a7c52ef5290c6 (commit)

commit 65e9712bdd3f1f7013856ff8af0e311a57fa8d34
Author: Andrzej 
Date:   Wed Apr 3 22:33:51 2013 +0100

Bugfix in icon/pixbuf resizing code.

Icons were occasionally stretched to unnatural aspect ratio.
This could be observed e.g. in applications menu plugin in multi-row
panels and/or non-square icons.

 libxfce4panel/xfce-panel-convenience.c |   12 +---
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/libxfce4panel/xfce-panel-convenience.c 
b/libxfce4panel/xfce-panel-convenience.c
index a3f3be1..7902360 100644
--- a/libxfce4panel/xfce-panel-convenience.c
+++ b/libxfce4panel/xfce-panel-convenience.c
@@ -158,7 +158,7 @@ xfce_panel_pixbuf_from_source_at_size (const gchar  *source,
   gchar *name;
   gchar *filename;
   gint   src_w, src_h;
-  gdoublewratio, hratio;
+  gdoubleratio;
   GdkPixbuf *dest;
   GError*error = NULL;
   gint   size = MIN (dest_width, dest_height);
@@ -231,13 +231,11 @@ xfce_panel_pixbuf_from_source_at_size (const gchar  
*source,
   if (src_w > dest_width || src_h > dest_height)
 {
   /* calculate the new dimensions */
-  wratio = (gdouble) src_w / (gdouble) size;
-  hratio = (gdouble) src_h / (gdouble) size;
+  ratio = MIN ((gdouble) dest_width / (gdouble) src_w,
+   (gdouble) dest_height / (gdouble) src_h);
 
-  if (hratio > wratio)
-dest_width  = rint (src_w / hratio);
-  else
-dest_height = rint (src_h / wratio);
+  dest_width  = rint (src_w * ratio);
+  dest_height = rint (src_h * ratio);
 
   dest = gdk_pixbuf_scale_simple (pixbuf,
   MAX (dest_width, 1),
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ApplicationsMenu: Update the icon in the config dialog

2013-04-03 Thread Andrzej
Updating branch refs/heads/master
 to fb747e80da2bdc568354c8090ca0c9d05acace2c (commit)
   from 65e9712bdd3f1f7013856ff8af0e311a57fa8d34 (commit)

commit fb747e80da2bdc568354c8090ca0c9d05acace2c
Author: Andrzej 
Date:   Wed Apr 3 23:49:02 2013 +0100

ApplicationsMenu: Update the icon in the config dialog

...after closing the icon chooser.

 plugins/applicationsmenu/applicationsmenu.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/plugins/applicationsmenu/applicationsmenu.c 
b/plugins/applicationsmenu/applicationsmenu.c
index efe1c30..bf28607 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -579,6 +579,9 @@ applications_menu_plugin_configure_plugin_icon_chooser 
(GtkWidget  *
 {
   icon = exo_icon_chooser_dialog_get_icon (EXO_ICON_CHOOSER_DIALOG 
(chooser));
   g_object_set (G_OBJECT (plugin), "button-icon", icon, NULL);
+  xfce_panel_image_set_from_source (XFCE_PANEL_IMAGE (plugin->dialog_icon),
+exo_str_is_empty (plugin->button_icon) 
?
+DEFAULT_ICON_NAME : 
plugin->button_icon);
   g_free (icon);
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ApplicationsMenu: support for non-square icons and layout fixes

2013-04-03 Thread Andrzej
Updating branch refs/heads/master
 to 24d5634f2d13d1ff44dbbdf6dbf34d2ea27dd1ea (commit)
   from fb747e80da2bdc568354c8090ca0c9d05acace2c (commit)

commit 24d5634f2d13d1ff44dbbdf6dbf34d2ea27dd1ea
Author: Andrzej 
Date:   Wed Apr 3 23:58:19 2013 +0100

ApplicationsMenu: support for non-square icons and layout fixes

Switched to GtkImage for the button icon. It works better with non-square
icons. Slightly adjusted the button layout (spacing) to match other
plugins&HIG.

It might be a good idea to move contents of the _size_changed method to
a timeout event (loading icon etc.).

 plugins/applicationsmenu/applicationsmenu.c |   90 ---
 1 files changed, 41 insertions(+), 49 deletions(-)

diff --git a/plugins/applicationsmenu/applicationsmenu.c 
b/plugins/applicationsmenu/applicationsmenu.c
index bf28607..b86e438 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -237,11 +237,12 @@ applications_menu_plugin_init (ApplicationsMenuPlugin 
*plugin)
   g_signal_connect (G_OBJECT (plugin->button), "button-press-event",
   G_CALLBACK (applications_menu_plugin_menu), plugin);
 
-  plugin->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 1);
+  plugin->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2);
+  gtk_container_set_border_width (GTK_CONTAINER (plugin->box), 0);
   gtk_container_add (GTK_CONTAINER (plugin->button), plugin->box);
   gtk_widget_show (plugin->box);
 
-  plugin->icon = xfce_panel_image_new_from_source (DEFAULT_ICON_NAME);
+  plugin->icon = gtk_image_new ();
   gtk_box_pack_start (GTK_BOX (plugin->box), plugin->icon, FALSE, FALSE, 0);
   gtk_widget_show (plugin->icon);
 
@@ -360,8 +361,6 @@ applications_menu_plugin_set_property (GObject  *object,
 case PROP_BUTTON_ICON:
   g_free (plugin->button_icon);
   plugin->button_icon = g_value_dup_string (value);
-  xfce_panel_image_set_from_source (XFCE_PANEL_IMAGE (plugin->icon),
-  exo_str_is_empty (plugin->button_icon) ? DEFAULT_ICON_NAME : 
plugin->button_icon);
 
   force_a_resize = TRUE;
   break;
@@ -444,16 +443,17 @@ applications_menu_plugin_size_changed (XfcePanelPlugin 
*panel_plugin,
 {
   ApplicationsMenuPlugin *plugin = XFCE_APPLICATIONS_MENU_PLUGIN 
(panel_plugin);
   gintrow_size;
-  ginticon_size;
   GtkStyle   *style;
   XfcePanelPluginMode mode;
   GtkRequisition  label_size;
   GtkOrientation  orientation;
   gintborder_thickness;
-  gdouble icon_wh_ratio;
   GdkPixbuf  *icon;
-
-  row_size = size / xfce_panel_plugin_get_nrows (panel_plugin);
+  ginticon_width_max, icon_height_max;
+  ginticon_width = 0;
+  GdkScreen  *screen;
+  GtkIconTheme   *icon_theme = NULL;
+  gchar  *icon_name;
 
   gtk_box_set_child_packing (GTK_BOX (plugin->box), plugin->icon,
  !plugin->show_button_title,
@@ -467,50 +467,42 @@ applications_menu_plugin_size_changed (XfcePanelPlugin 
*panel_plugin,
   else
 orientation = GTK_ORIENTATION_VERTICAL;
 
-  if (!plugin->show_button_title)
+  row_size = size / xfce_panel_plugin_get_nrows (panel_plugin);
+  style = gtk_widget_get_style (plugin->button);
+  border_thickness = 2 * MAX (style->xthickness, style->ythickness) + 2;
+
+  /* arbitrary limit on non-square icon width in horizontal panel */
+  icon_width_max = (mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) ?
+6 * row_size - border_thickness :
+size - border_thickness;
+  icon_height_max = row_size - border_thickness;
+
+  screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
+  if (G_LIKELY (screen != NULL))
+icon_theme = gtk_icon_theme_get_for_screen (screen);
+
+  icon_name = exo_str_is_empty (plugin->button_icon) ?
+DEFAULT_ICON_NAME : plugin->button_icon;
+
+  icon = xfce_panel_pixbuf_from_source_at_size (icon_name,
+icon_theme,
+icon_width_max,
+icon_height_max);
+
+  if (G_LIKELY (icon != NULL))
 {
-  xfce_panel_image_set_size (XFCE_PANEL_IMAGE (plugin->icon), -1);
-
-/* get scale of the icon for non-squared custom files */
-if (mode != XFCE_PANEL_PLUGIN_MODE_DESKBAR
-&& plugin->button_icon != NULL
-&& g_path_is_absolute (plugin->button_icon))
-  {
-icon = gdk_pixbuf_new_from_file (plugin->button_icon, NULL);
-if (G_LIKELY (icon != NULL))
-  {
-icon_wh_ratio = (gdouble) gdk_pixbuf_get_width (icon) / 
(gdouble) gdk_pixbuf_get_height (icon);
-g_o

[Xfce4-commits] Creating branch andrzejr/systray

2013-04-03 Thread Andrzej
Updating branch refs/heads/andrzejr/systray
 as new branch
 to 75715329587059cd0808e88dc723be59f7af4b74 (commit)

Branches are created implicitly by pushing. This mail only exists to 
let you know that there was code pushed to 

  refs/heads/andrzejr/systray

for the first time. Mails for the commits that lead to the creation 
of the branch will follow after this mail.
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] systray plugin: limiting icon size to row size, fixing orientation.

2013-04-03 Thread Andrzej
Updating branch refs/heads/andrzejr/systray
 to bf15d88d9554bba3c39a95b07482a3c5cf4b9736 (commit)
   from d4c989369d06c667337512955c65948a8ed0e166 (commit)

commit bf15d88d9554bba3c39a95b07482a3c5cf4b9736
Author: Andrzej 
Date:   Tue Jan 17 00:13:54 2012 +0900

systray plugin: limiting icon size to row size, fixing orientation.

Icon size is now max row size.
The user controlled max icon size is still available for 4.8 compat.
Maybe a better way would be to allow the user to set
a min number of rows instead of max icon size?

Centering of group of icons in the panel is disabled for consistency
with other plugins and the itembar behavior. (icons are flushed to
the top (horizontal mode) or to the left).

Allocation order of icons is changed to mimic that of itembar.
Icons are allocated along the columns (not rows, as it was before).

Haven't tested the support for non-square icons
- hopefully it still works. Can anyone confirm that?

 plugins/systray/systray-box.c |   37 ++---
 plugins/systray/systray-box.h |3 +++
 plugins/systray/systray.c |   14 ++
 3 files changed, 47 insertions(+), 7 deletions(-)

diff --git a/plugins/systray/systray-box.c b/plugins/systray/systray-box.c
index 06f0b46..827a1e1 100644
--- a/plugins/systray/systray-box.c
+++ b/plugins/systray/systray-box.c
@@ -100,6 +100,9 @@ struct _SystrayBox
 
   /* allocated size by the plugin */
   gint  size_alloc;
+
+  /* (minimum) number of rows */
+  gint  nrows;
 };
 
 
@@ -147,6 +150,7 @@ systray_box_init (SystrayBox *box)
   box->childeren = NULL;
   box->size_max = SIZE_MAX_DEFAULT;
   box->size_alloc = SIZE_MAX_DEFAULT;
+  box->nrows = 1;
   box->n_hidden_childeren = 0;
   box->n_visible_children = 0;
   box->horizontal = TRUE;
@@ -223,6 +227,8 @@ systray_box_size_get_max_child_size (SystrayBox *box,
   break;
 }
 
+  rows = MAX (rows, box->nrows);
+
   row_size = (alloc_size - (rows - 1) * SPACING) / rows;
   row_size = MIN (box->size_max, row_size);
 
@@ -389,7 +395,7 @@ systray_box_size_allocate (GtkWidget *widget,
   gdouble ratio;
   gintx, x_start, x_end;
   ginty, y_start, y_end;
-  gintoffset;
+  gintoffset = 0;
   GSList *li;
   gintalloc_size;
   gintidx;
@@ -400,7 +406,7 @@ systray_box_size_allocate (GtkWidget *widget,
 
   alloc_size = box->horizontal ? allocation->height : allocation->width;
 
-  systray_box_size_get_max_child_size (box, alloc_size, &rows, &row_size, 
&offset);
+  systray_box_size_get_max_child_size (box, alloc_size, &rows, &row_size, 
NULL);
 
   panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "allocate rows=%d, row_size=%d, 
w=%d, h=%d, horiz=%s, border=%d",
 rows, row_size, allocation->width, allocation->height,
@@ -454,7 +460,7 @@ systray_box_size_allocate (GtkWidget *widget,
 {
   ratio = (gdouble) child_req.width / (gdouble) child_req.height;
 
-  if (box->horizontal)
+  if (!box->horizontal)
 {
   child_alloc.height = row_size;
   child_alloc.width = row_size * ratio;
@@ -492,8 +498,8 @@ systray_box_size_allocate (GtkWidget *widget,
   ratio = 1.00;
 }
 
-  if ((box->horizontal && x + child_alloc.width > x_end)
-  || (!box->horizontal && y + child_alloc.height > y_end))
+  if ((!box->horizontal && x + child_alloc.width > x_end)
+  || (box->horizontal && y + child_alloc.height > y_end))
 {
   if (ratio >= 2
   && li->next != NULL)
@@ -508,7 +514,7 @@ systray_box_size_allocate (GtkWidget *widget,
   goto restart_allocation;
 }
 
-  if (box->horizontal)
+  if (!box->horizontal)
 {
   x = x_start;
   y += row_size + SPACING;
@@ -549,7 +555,7 @@ systray_box_size_allocate (GtkWidget *widget,
   child_alloc.x += x;
   child_alloc.y += y;
 
-  if (box->horizontal)
+  if (!box->horizontal)
 x += row_size * ratio + SPACING;
   else
 y += row_size * ratio + SPACING;
@@ -743,6 +749,23 @@ systray_box_set_size_alloc (SystrayBox *box,
 
 
 void
+systray_box_set_nrows (SystrayBox *box,
+   gintnrows)
+{
+  panel_return_if_fail (XFCE_IS_SYSTRAY_BOX (box));
+
+  if (G_LIKELY (nrows != box->nrows))
+{
+  box->nrows = nrows;
+
+  if (box->childeren != NULL)
+gtk_widget_queue_resize (GTK_WIDGET (box));
+}
+}
+
+
+
+void
 systray_box_set_show_hidden (SystrayBox 

[Xfce4-commits] systray: reworked layout mechanism.

2013-04-03 Thread Andrzej
Updating branch refs/heads/andrzejr/systray
 to 22867c5e4f507864c45cb43f1b984a4f2f2934b9 (commit)
   from bf15d88d9554bba3c39a95b07482a3c5cf4b9736 (commit)

commit 22867c5e4f507864c45cb43f1b984a4f2f2934b9
Author: Andrzej 
Date:   Thu Jan 26 18:54:00 2012 +0900

systray: reworked layout mechanism.

Previous commit was badly broken (non-square icons were braking the layout).

Changes:
- Propagating orientation settings to systray manager.
- systray-box size_request/size_allocate use now integer arithmetic.
- ... and slot mechanism (all slots are assumed to be square,
  this may look like a limitation but the icons look better this way).
- ... works with any horizontal/vertical icons
  (this is required because addition of the deskbar mode)
- Icon sizes are slightly smaller than the row size to match icon sizes
  in "small" plugins. This is only an approximation and is not accurate
  across all gtk styles and icon sizes.
- Scaling down the row size by 1px when the icons don't fit was removed.
  Icons should now fit unless some complex conflicting non-square icons are
  used.

Limitations:
- Non-square icons (tested with "workrave") sometimes want
  multi-row _and_ multi-column allocation.
  This is not supported (it would complicate the layout significantly
  for little benefit).
  If this happens, one dimension of the icon will be clipped
  to the row size. Workaround: use a larger row size.

 plugins/systray/systray-box.c |  300 +++--
 plugins/systray/systray.c |   30 +++--
 2 files changed, 187 insertions(+), 143 deletions(-)

diff --git a/plugins/systray/systray-box.c b/plugins/systray/systray-box.c
index 827a1e1..13ab3c8 100644
--- a/plugins/systray/systray-box.c
+++ b/plugins/systray/systray-box.c
@@ -204,12 +204,13 @@ systray_box_size_get_max_child_size (SystrayBox *box,
  gintalloc_size,
  gint   *rows_ret,
  gint   *row_size_ret,
- gint   *offset_ret)
+ gint   *icon_size_ret)
 {
   GtkWidget *widget = GTK_WIDGET (box);
   gint   size;
   gint   rows;
   gint   row_size;
+  gint   icon_size;
 
   alloc_size -= 2 * GTK_CONTAINER (widget)->border_width;
 
@@ -230,7 +231,10 @@ systray_box_size_get_max_child_size (SystrayBox *box,
   rows = MAX (rows, box->nrows);
 
   row_size = (alloc_size - (rows - 1) * SPACING) / rows;
-  row_size = MIN (box->size_max, row_size);
+
+  /* limiting the icon size to the row_size */
+  /* adding an arbitrary padding added to mimic the size of other icons in the 
panel */
+  icon_size = MIN (box->size_max, row_size - 2);
 
   if (rows_ret != NULL)
 *rows_ret = rows;
@@ -238,13 +242,34 @@ systray_box_size_get_max_child_size (SystrayBox *box,
   if (row_size_ret != NULL)
 *row_size_ret = row_size;
 
-  if (offset_ret != NULL)
-{
-  rows = MIN (rows, box->n_visible_children);
-  *offset_ret = (alloc_size - (rows * row_size + (rows - 1) * SPACING)) / 
2;
-  if (*offset_ret < 1)
-*offset_ret = 0;
-}
+  if (icon_size_ret != NULL)
+*icon_size_ret = icon_size;
+}
+
+
+
+static gint
+systray_box_calc_seq_cells (gint row_size,
+gint icon_size,
+gdouble  aspect,
+gint limit,
+gint*longer_edge_ret)
+{
+  gintlonger_edge;
+  gintseq_cells_1;
+
+  /* assume aspect > 1 */
+  longer_edge = rint (icon_size * aspect);
+  seq_cells_1 =
+rint (ceil ((gdouble) (longer_edge - icon_size - SPACING) / (gdouble) 
row_size));
+
+  if (limit > 0)
+seq_cells_1 = MIN (seq_cells_1, limit - 1);
+
+  if (longer_edge_ret != NULL)
+*longer_edge_ret = seq_cells_1 * (row_size + SPACING) + icon_size;
+
+  return seq_cells_1 + 1;
 }
 
 
@@ -259,22 +284,26 @@ systray_box_size_request (GtkWidget  *widget,
   GtkRequisition  child_req;
   gintn_hidden_childeren = 0;
   gintrows;
-  gdouble cols;
+  gintcols;
   gintrow_size;
-  gdouble cells;
+  ginticon_size;
+  gintcells;
   gintmin_seq_cells = -1;
+  gintseq_cells;
+  gintlimit;
   gdouble ratio;
   GSList *li;
   gbooleanhidden;
+  gbooleanperpendicular;
   gintcol_px;
   gintrow_px;
 
   box->n_visible_children = 0;
 
   /* get some info about the n_rows we're going to allocate */
-  systray_box_size_get_max_child_size (box, box->size_alloc, &rows, &row_size, 
NULL);
+  systray_box_size_get_max_child_size (box, box->size_alloc, &

[Xfce4-commits] systray: fixing visual artifacts, bug #8399.

2013-04-03 Thread Andrzej
Updating branch refs/heads/andrzejr/systray
 to 75715329587059cd0808e88dc723be59f7af4b74 (commit)
   from 22867c5e4f507864c45cb43f1b984a4f2f2934b9 (commit)

commit 75715329587059cd0808e88dc723be59f7af4b74
Author: Andrzej 
Date:   Sat Jan 28 01:31:59 2012 +0900

systray: fixing visual artifacts, bug #8399.

cols variable (number of columns in horizontal mode) was calculated
incorrectly and wasn't checked during allocation.

At start-up (in vertical modes) the allocation->height was occasionally
equal to 1, which made some icons to be temporarily allocated outside
the systray. Some applications didn't like it.

In addition to the actual fix, an optimization "fast path" was added to
filter out common start-up cases early.

A similar (although not that often) issue was observed in older systray
versions, which could indicate an error in coordinate checking. Coordinate
checking is now replaced with slot column/row checking.

 plugins/systray/systray-box.c |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/plugins/systray/systray-box.c b/plugins/systray/systray-box.c
index 13ab3c8..a64664d 100644
--- a/plugins/systray/systray-box.c
+++ b/plugins/systray/systray-box.c
@@ -435,6 +435,11 @@ systray_box_size_allocate (GtkWidget *widget,
   gintalloc_size;
   gintidx;
 
+  /* Performance optimization. The allocation size is checked in detail below. 
*/
+  /* This is just a fast path for some obvious cases, which occur during 
start-up. */
+  if (allocation->width < 10 || allocation->height < 10)
+return;
+
   widget->allocation = *allocation;
 
   border = GTK_CONTAINER (widget)->border_width;
@@ -444,10 +449,10 @@ systray_box_size_allocate (GtkWidget *widget,
   systray_box_size_get_max_child_size (box, alloc_size, &rows, &row_size, 
&icon_size);
 
   alloc_size = (box->horizontal ? allocation->width : allocation->height) - 2 
* border;
-  cols = ceil ((gdouble) (alloc_size - row_size) / (gdouble) (row_size + 
SPACING)) + 1;
+  cols = floor ((gdouble) (alloc_size - row_size) / (gdouble) (row_size + 
SPACING)) + 1;
 
-  panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "allocate rows=%d, row_size=%d, 
w=%d, h=%d, horiz=%s, border=%d",
-rows, row_size, allocation->width, allocation->height,
+  panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "allocate rows=%d, cols=%d, 
row_size=%d, w=%d, h=%d, horiz=%s, border=%d",
+rows, cols, row_size, allocation->width, 
allocation->height,
 PANEL_DEBUG_BOOL (box->horizontal), border);
 
 
@@ -481,9 +486,11 @@ systray_box_size_allocate (GtkWidget *widget,
   restart_allocation:
 
   slot = 0;
+  col = 0;
+
   g_slist_free (occupied_slots);
 
-  for (li = box->childeren; li != NULL; li = li->next)
+  for (li = box->childeren; li != NULL && col < cols; li = li->next)
 {
   child = GTK_WIDGET (li->data);
   panel_return_if_fail (XFCE_IS_SYSTRAY_SOCKET (child));
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Reworked entry_removed handler

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to d59fbfc202bd55d0821037b250e89cb31100457e (commit)
   from 2bf70a11a8707924c3a2e3cf2ff265a4f0410f9b (commit)

commit d59fbfc202bd55d0821037b250e89cb31100457e
Author: Andrzej 
Date:   Thu Mar 29 23:49:06 2012 +0900

Reworked entry_removed handler

 panel-plugin/indicator-box.c|   23 +++
 panel-plugin/indicator-box.h|   12 ++--
 panel-plugin/indicator-button.h |4 
 panel-plugin/indicator.c|   17 +
 4 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 95376dd..700a218 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -519,3 +519,26 @@ xfce_indicator_box_get_row_size (XfceIndicatorBox *box)
 
   return MIN (box->panel_size / box->nrows, box->icon_size_max + 
border_thickness);
 }
+
+
+XfceIndicatorButton *
+xfce_indicator_box_get_button (XfceIndicatorBox *box,
+   IndicatorObjectEntry *entry)
+{
+  GSList  *li;
+  GtkWidget   *child;
+  XfceIndicatorButton *button;
+
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BOX (box), NULL);
+
+  for (li = box->children; li != NULL; li = li->next)
+{
+  child = GTK_WIDGET (li->data);
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (child), NULL);
+
+  button = XFCE_INDICATOR_BUTTON (child);
+  if (xfce_indicator_button_get_entry (button) == entry)
+return button;
+}
+  return NULL;
+}
diff --git a/panel-plugin/indicator-box.h b/panel-plugin/indicator-box.h
index b28c9d2..e302279 100644
--- a/panel-plugin/indicator-box.h
+++ b/panel-plugin/indicator-box.h
@@ -18,6 +18,11 @@
 #ifndef __INDICATOR_BOX_H__
 #define __INDICATOR_BOX_H__
 
+#include 
+#include 
+#include 
+#include "indicator-button.h"
+
 G_BEGIN_DECLS
 
 GType xfce_indicator_box_get_type (void);
@@ -51,14 +56,17 @@ struct _XfceIndicatorBoxClass
   GtkContainerClass __parent__;
 };
 
-void xfce_indicator_box_set_orientation (XfceIndicatorBox *button,
+void xfce_indicator_box_set_orientation (XfceIndicatorBox *box,
  GtkOrientation panel_orientation,
  GtkOrientation orientation);
 
-void xfce_indicator_box_set_size (XfceIndicatorBox *button,
+void xfce_indicator_box_set_size (XfceIndicatorBox *box,
   gint panel_size,
   gint nrows);
 
+XfceIndicatorButton *xfce_indicator_box_get_button (XfceIndicatorBox *box,
+IndicatorObjectEntry 
*entry);
+
 GtkWidget *xfce_indicator_box_new ();
 
 G_END_DECLS
diff --git a/panel-plugin/indicator-button.h b/panel-plugin/indicator-button.h
index 80e93fb..129aa22 100644
--- a/panel-plugin/indicator-button.h
+++ b/panel-plugin/indicator-button.h
@@ -18,6 +18,10 @@
 #ifndef __INDICATOR_BUTTON_H__
 #define __INDICATOR_BUTTON_H__
 
+#include 
+#include 
+#include 
+
 G_BEGIN_DECLS
 
 GType xfce_indicator_button_get_type (void);
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index e0b2551..e1047cc 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -361,21 +361,14 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * 
entry, gpointer user_d
 
 
 static void
-entry_removed_cb (GtkWidget * widget, gpointer userdata)
+entry_removed (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer 
user_data)
 {
-  gpointer data = (gpointer) xfce_indicator_button_get_entry 
(XFCE_INDICATOR_BUTTON (widget));
-
-  if (data != userdata)
-return;
-
-  gtk_widget_destroy(widget);
-}
+  XfceIndicatorButton *button;
 
+  button = xfce_indicator_box_get_button (XFCE_INDICATOR_BOX (user_data), 
entry);
 
-static void
-entry_removed (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer 
user_data)
-{
-  gtk_container_foreach(GTK_CONTAINER(user_data), entry_removed_cb, entry);
+  if (button != NULL)
+gtk_widget_destroy (GTK_WIDGET (button));
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Making the plugin a library and a subclass of XfcePanelPlugin

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to f84d012dc997211a43236325bca50dc7092ec3e3 (commit)
   from d59fbfc202bd55d0821037b250e89cb31100457e (commit)

commit f84d012dc997211a43236325bca50dc7092ec3e3
Author: Andrzej 
Date:   Sat Mar 31 21:57:43 2012 +0900

Making the plugin a library and a subclass of XfcePanelPlugin

The plugin is now installed as a library and to a different directory
(following convention of other plugins).

The plugin is now an object of IndicatorPlugin class, which extends
XfcePanelPlugin. This is for making definition of properties and integration
with xfconf easier.

Conflicts:

panel-plugin/indicator.c

 configure.in.in|7 +
 panel-plugin/Makefile.am   |   55 ---
 panel-plugin/indicator.c   |  165 
 ...ndicator.desktop.in.in => indicator.desktop.in} |4 +-
 panel-plugin/indicator.h   |   32 ++--
 5 files changed, 158 insertions(+), 105 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 3280c7f..b308dbd 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -30,6 +30,7 @@ dnl ***
 AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
 AM_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE()
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 dnl 
 dnl *** Check for basic programs ***
@@ -40,6 +41,12 @@ AC_PROG_INSTALL()
 AC_PROG_LIBTOOL()
 AC_PROG_INTLTOOL()
 
+dnl **
+dnl *** Initialize libtool ***
+dnl **
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
 dnl **
 dnl *** Check for standard headers ***
 dnl **
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index c07a45c..0010923 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,19 +1,24 @@
+
 INCLUDES = 
\
-I$(top_srcdir) 
\
-   -DG_LOG_DOMAIN=\"xfce4-indicator-plugin\"   \
+   -DG_LOG_DOMAIN=\"libindicator-plugin\"  \
-DPACKAGE_LOCALE_DIR=\"$(localedir)\"   \
$(PLATFORM_CPPFLAGS)
 
 #
 # Indicator plugin
 #
-plugin_PROGRAMS =  
\
-   xfce4-indicator-plugin
+plugindir = \
+   $(libdir)/xfce4/panel/plugins
+
+plugin_LTLIBRARIES = \
+   libindicator-plugin.la
 
-plugindir =
\
-   $(libexecdir)/xfce4/panel-plugins
+libindicator_built_sources = \
+   indicator-dialog_ui.h
 
-xfce4_indicator_plugin_SOURCES =   \
+libindicator_plugin_la_SOURCES = \
+   $(libindicator_built_sources) \
indicator-button.c  
\
indicator-button.h  
\
indicator-box.c 
\
@@ -21,7 +26,7 @@ xfce4_indicator_plugin_SOURCES =  
\
indicator.c 
\
indicator.h 

 
-xfce4_indicator_plugin_CFLAGS =\
+libindicator_plugin_la_CFLAGS = \
$(GTK_CFLAGS) \
$(EXO_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS)  \
@@ -33,8 +38,14 @@ xfce4_indicator_plugin_CFLAGS =  
\
-DINDICATOR_ICONS_DIR=\""$(INDICATORICONSDIR)"\" \
-DINDICATOR_DIR=\""$(INDICATORDIR)"\"
 
+libindicator_plugin_la_LDFLAGS = \
+   -avoid-version \
+   -module \
+   -no-undefined \
+   -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+   $(PLATFORM_LDFLAGS)
 
-xfce4_indicator_plugin_LDADD = \
+libindicator_plugin_la_LIBADD = \
$(GTK_LIBS) \
$(EXO_LIBS) \
$(LIBXFCE4UTIL_LIBS)\
@@ -46,16 +57,10 @@ xfce4_indicator_plugin_LDADD =  
\
 # Desktop file
 #
 desktopdir =   
\
-   $(datadir)/xfce4/panel-plugins
-
-desktop_in_in_files =  \
-   indicator.desktop.in.in
-
-desktop_in_files = 
\
-   $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+   $(datadir)/xfce4/panel/plugin

[Xfce4-commits] Reverted glade related change - not ready yet.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 02a4e03020680a20333035397f49f99186941635 (commit)
   from f84d012dc997211a43236325bca50dc7092ec3e3 (commit)

commit 02a4e03020680a20333035397f49f99186941635
Author: Andrzej 
Date:   Sat Mar 31 23:57:38 2012 +0900

Reverted glade related change - not ready yet.

 panel-plugin/Makefile.am |   15 ---
 1 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 0010923..f0697e1 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -14,11 +14,7 @@ plugindir = \
 plugin_LTLIBRARIES = \
libindicator-plugin.la
 
-libindicator_built_sources = \
-   indicator-dialog_ui.h
-
 libindicator_plugin_la_SOURCES = \
-   $(libindicator_built_sources) \
indicator-button.c  
\
indicator-button.h  
\
indicator-box.c 
\
@@ -73,15 +69,4 @@ EXTRA_DIST = 
\
 DISTCLEANFILES = \
$(desktop_DATA)
 
-if MAINTAINER_MODE
-BUILT_SOURCES = \
-   $(libindicator_plugin_built_sources)
-
-DISTCLEANFILES += \
-   $(libindicator_plugin_built_sources)
-
-indicator-dialog_ui.h: indicator-dialog.glade
-   $(AM_V_GEN) exo-csource --static --strip-comments --strip-content 
--name=indicator_dialog_ui $< >$@
-endif
-
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Added comments.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to e79f2b355ddb6600fbea0ebebb03ade066807842 (commit)
   from 44ef2fa54ba164b9b434b01d82ca739b4b49a9ce (commit)

commit e79f2b355ddb6600fbea0ebebb03ade066807842
Author: Andrzej 
Date:   Sun Apr 1 03:07:06 2012 +0900

Added comments.

 panel-plugin/indicator-box.c|9 +
 panel-plugin/indicator-button.c |   10 ++
 panel-plugin/indicator-dialog.c |9 +
 panel-plugin/indicator.c|9 +
 4 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 700a218..0643a3f 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -15,6 +15,15 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+
+
+/*
+ *  This file implements a container class for holding indicator buttons.
+ *
+ */
+
+
+
 #include 
 #include 
 #include 
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 9763da5..c89bdaf 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -15,6 +15,16 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+
+
+/*
+ *  This file implements an indicator button class corresponding to
+ *  a single indicator object entry.
+ *
+ */
+
+
+
 #include 
 #include 
 #include 
diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index 0ad6c04..a2241c5 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -16,6 +16,15 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+
+
+/*
+ *  This file implements a preferences dialog. The class extends GtkBuilder.
+ *
+ */
+
+
+
 #ifdef HAVE_CONFIG_H
 #include 
 #endif
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index c51603e..9d2bc52 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -15,6 +15,15 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+
+
+/*
+ *  This file implements the main plugin class.
+ *
+ */
+
+
+
 #ifdef HAVE_CONFIG_H
 #include 
 #endif
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Experiment with preferences dialog.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 44ef2fa54ba164b9b434b01d82ca739b4b49a9ce (commit)
   from 02a4e03020680a20333035397f49f99186941635 (commit)

commit 44ef2fa54ba164b9b434b01d82ca739b4b49a9ce
Author: Andrzej 
Date:   Sun Apr 1 03:06:19 2012 +0900

Experiment with preferences dialog.

Added an XfceIndicatorDialog class based on GtkBuilder.
Added dependency on libxfce4ui (v.4.8 - not checked if earlier revisions
work)

The UI file (stub) was copied from the systray plugin.

 configure.in.in |1 +
 panel-plugin/Makefile.am|   19 +++
 panel-plugin/indicator-dialog.c |  172 
 panel-plugin/indicator-dialog.glade |  293 +++
 panel-plugin/indicator-dialog.h |   43 +
 panel-plugin/indicator.c|   26 +++-
 panel-plugin/indicator.h|8 +-
 7 files changed, 558 insertions(+), 4 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index b308dbd..e2bdeaf 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -74,6 +74,7 @@ dnl ***
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
 XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.2])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.2])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
 XDT_CHECK_PACKAGE([INDICATOR], [indicator], [0.3.0], 
[indicator_pkgname=indicator], [XDT_CHECK_PACKAGE([INDICATOR], [indicator-0.4], 
[0.3.90], [indicator_pkgname=indicator-0.4], [])])
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index f0697e1..80c33f0 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -14,11 +14,17 @@ plugindir = \
 plugin_LTLIBRARIES = \
libindicator-plugin.la
 
+libindicator_built_sources = \
+   indicator-dialog_ui.h
+
 libindicator_plugin_la_SOURCES = \
+   $(libindicator_built_sources) \
indicator-button.c  
\
indicator-button.h  
\
indicator-box.c 
\
indicator-box.h 
\
+   indicator-dialog.c \
+   indicator-dialog.h \
indicator.c 
\
indicator.h 

 
@@ -26,6 +32,7 @@ libindicator_plugin_la_CFLAGS = \
$(GTK_CFLAGS) \
$(EXO_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS)  \
+   $(LIBXFCE4UI_CFLAGS) \
$(LIBXFCE4PANEL_CFLAGS) \
$(XFCONF_CFLAGS)\
$(INDICATOR_CFLAGS) \
@@ -45,6 +52,7 @@ libindicator_plugin_la_LIBADD = \
$(GTK_LIBS) \
$(EXO_LIBS) \
$(LIBXFCE4UTIL_LIBS)\
+   $(LIBXFCE4UI_LIBS) \
$(LIBXFCE4PANEL_LIBS)   \
$(XFCONF_LIBS)  \
$(INDICATOR_LIBS)
@@ -69,4 +77,15 @@ EXTRA_DIST = 
\
 DISTCLEANFILES = \
$(desktop_DATA)
 
+if MAINTAINER_MODE
+BUILT_SOURCES = \
+   $(libindicator_built_sources)
+
+DISTCLEANFILES += \
+   $(libindicator_built_sources)
+
+indicator-dialog_ui.h: indicator-dialog.glade
+   $(AM_V_GEN) exo-csource --static --strip-comments --strip-content 
--name=indicator_dialog_ui $< >$@
+endif
+
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
new file mode 100644
index 000..0ad6c04
--- /dev/null
+++ b/panel-plugin/indicator-dialog.c
@@ -0,0 +1,172 @@
+/*
+ *  Copyright (C) 2012 Andrzej 
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include 
+#endif
+
+

[Xfce4-commits] bugfix: fixed label orientation.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 81aecb3bc340f90b460d73f61d2ddea443416075 (commit)
   from c90af565ed597a79071ea2559451f2c781716cfd (commit)

commit 81aecb3bc340f90b460d73f61d2ddea443416075
Author: Andrzej 
Date:   Mon Apr 2 11:00:42 2012 +0900

bugfix: fixed label orientation.

The error occurred in appmenu labels at switching the panel mode
from vertical to e.g. deskbar. There was a race condition between
setting the label and setting the button orientation.

 panel-plugin/indicator-button.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index c89bdaf..3b634cf 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -223,6 +223,8 @@ xfce_indicator_button_set_label (XfceIndicatorButton 
*button,
 
   button->label = GTK_WIDGET (label);
   g_object_ref (G_OBJECT (button->label));
+  gtk_label_set_angle (GTK_LABEL (button->label),
+   (button->orientation == GTK_ORIENTATION_VERTICAL) ? 
-90 : 0);
   gtk_box_pack_end (GTK_BOX (button->box), button->label, TRUE, FALSE, 1);
 }
   xfce_indicator_button_update_layout (button);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Reworked dialog UI.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to c90af565ed597a79071ea2559451f2c781716cfd (commit)
   from e79f2b355ddb6600fbea0ebebb03ade066807842 (commit)

commit c90af565ed597a79071ea2559451f2c781716cfd
Author: Andrzej 
Date:   Sun Apr 1 23:41:53 2012 +0900

Reworked dialog UI.

 panel-plugin/indicator-dialog.glade |  313 +--
 1 files changed, 226 insertions(+), 87 deletions(-)

diff --git a/panel-plugin/indicator-dialog.glade 
b/panel-plugin/indicator-dialog.glade
index 7c715a4..5194a0d 100644
--- a/panel-plugin/indicator-dialog.glade
+++ b/panel-plugin/indicator-dialog.glade
@@ -1,4 +1,4 @@
-
+
 
   
   
@@ -16,44 +16,93 @@
 
   
   
+False
 Indicators
-325
-425
+425
+525
 gtk-properties
 normal
 
   
 True
-vertical
+False
 2
+
+  
+True
+False
+end
+
+  
+gtk-close
+True
+True
+True
+False
+True
+  
+  
+False
+False
+0
+  
+
+
+  
+gtk-help
+True
+True
+True
+False
+True
+  
+  
+False
+False
+1
+True
+  
+
+  
+  
+False
+True
+end
+0
+  
+
 
   
 True
+False
 6
-vertical
 6
 
   
 True
+False
 0
 none
 
   
 True
+False
 12
 
   
 True
+False
 6
-vertical
 6
 
   
 True
+False
 12
 
   
 True
+False
 0
 _Maximum icon size (px):
 True
@@ -61,6 +110,7 @@
   
   
 False
+True
 0
   
 
@@ -68,32 +118,59 @@
   
 True
 True
+False
+False
+True
+True
 size-adjustment
 True
   
   
 False
+True
 1
   
 
   
   
+True
+True
 0
   
 
 
-  
-Show 
_frame
+  
+Show 
indicators unless hidden
 True
 True
 False
-True
+False
+True
 True
+radiobutton-blacklist
   
   
+True
+True
 1
   
 
+
+  
+Hide 
invisible indicators
+True
+True
+False
+False
+True
+True
+  
+  
+True
+True
+2
+  
+
   
 
   
@@ -101,6 +178,7

[Xfce4-commits] Cleaning some runtime GObject assert violations

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to d0bef06d946defc9fb2ae3682b1498092906713e (commit)
   from 81aecb3bc340f90b460d73f61d2ddea443416075 (commit)

commit d0bef06d946defc9fb2ae3682b1498092906713e
Author: Andrzej 
Date:   Sun Apr 8 23:57:21 2012 +0900

Cleaning some runtime GObject assert violations

 panel-plugin/indicator-button.c |   42 --
 1 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 3b634cf..58810ad 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -93,35 +93,18 @@ xfce_indicator_button_finalize (GObject *object)
   XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (object);
 
   if (button->label != NULL)
-{
-  g_object_unref (G_OBJECT (button->label));
-  button->label = NULL;
-}
+g_object_unref (G_OBJECT (button->label));
   if (button->orig_icon != NULL)
-{
-  g_object_unref (G_OBJECT (button->orig_icon));
-  button->orig_icon = NULL;
-}
+g_object_unref (G_OBJECT (button->orig_icon));
   if (button->icon != NULL)
-{
-  g_object_unref (G_OBJECT (button->icon));
-  button->icon = NULL;
-}
-  if (button->io != NULL)
-{
-  g_object_unref (G_OBJECT (button->io));
-  button->io = NULL;
-}
-  if (button->entry != NULL)
-{
-  g_object_unref (G_OBJECT (button->entry));
-  button->entry = NULL;
-}
+g_object_unref (G_OBJECT (button->icon));
   if (button->menu != NULL)
-{
-  g_object_unref (G_OBJECT (button->menu));
-  button->menu = NULL;
-}
+g_object_unref (G_OBJECT (button->menu));
+  /* IndicatorObjectEntry is not GObject */
+  /* if (button->entry != NULL) */
+  /*   g_object_unref (G_OBJECT (button->entry)); */
+  if (button->io != NULL)
+g_object_unref (G_OBJECT (button->io));
 
   G_OBJECT_CLASS (xfce_indicator_button_parent_class)->finalize (object);
 }
@@ -442,10 +425,11 @@ xfce_indicator_button_new (IndicatorObject *io,
   XfceIndicatorButton *button = g_object_new (XFCE_TYPE_INDICATOR_BUTTON, 
NULL);
   button->io = io;
   button->entry = entry;
-  g_object_ref (G_OBJECT (button->io));
-  g_object_ref (G_OBJECT (button->entry));
+  if (button->io != NULL)
+g_object_ref (G_OBJECT (button->io));
+  /* IndicatorObjectEntry is not GObject */
+  /* g_object_ref (G_OBJECT (button->entry)); */
   return GTK_WIDGET (button);
 }
 
 
-
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed panel 4.9 assert (widget not constructed)

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 57b1394a49142a979d77f089819f9c45f49320ab (commit)
   from d0bef06d946defc9fb2ae3682b1498092906713e (commit)

commit 57b1394a49142a979d77f089819f9c45f49320ab
Author: Andrzej 
Date:   Sun Apr 8 23:59:25 2012 +0900

Fixed panel 4.9 assert (widget not constructed)

and some compilation warning fixes.

 panel-plugin/indicator.c |  130 +
 1 files changed, 61 insertions(+), 69 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 9d2bc52..aa986dc 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -175,74 +175,17 @@ static void
 indicator_init (IndicatorPlugin *indicator)
 {
   XfcePanelPlugin  *plugin = XFCE_PANEL_PLUGIN (indicator);
-  GtkRcStyle   *style;
-
-  /* setup transation domain */
-  xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
 
-  GtkOrientation  orientation;
-  gint indicators_loaded = 0;
-
-  /* get the current orientation */
-  orientation = xfce_panel_plugin_get_orientation (plugin);
-
-  /* Init some theme/icon stuff */
-  gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
-  INDICATOR_ICONS_DIR);
-  /*gtk_widget_set_name(GTK_WIDGET (indicator->plugin), "indicator-plugin");*/
+  indicator->ebox = gtk_event_box_new();
+  gtk_widget_set_can_focus(GTK_WIDGET(indicator->ebox), TRUE);
 
   indicator->buttonbox = xfce_indicator_box_new ();
-
-  /* initialize xfconf */
-  if (xfconf_init(NULL)){
-/* get the list of excluded modules */
-indicator_read (indicator);
-  }
-  /* load 'em */
-  if (g_file_test(INDICATOR_DIR, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
-GDir * dir = g_dir_open(INDICATOR_DIR, 0, NULL);
-
-const gchar * name;
-guint i, length;
-gboolean match = FALSE;
-
-length = (indicator->excluded_modules != NULL) ? g_strv_length 
(indicator->excluded_modules) : 0;
-while ((name = g_dir_read_name(dir)) != NULL) {
-  for (i = 0; i < length; ++i) {
-if (match = (g_strcmp0 (name, indicator->excluded_modules[i]) == 0))
-  break;
-  }
-
-  if (G_UNLIKELY (match)) {
-g_debug ("Excluding module: %s", name);
-continue;
-  }
-
-  if (load_module(name, indicator))
-indicators_loaded++;
-}
-g_dir_close (dir);
-  }
-
-  if (indicators_loaded == 0) {
-/* A label to allow for click through */
-indicator->item = xfce_indicator_button_new(NULL, NULL);
-xfce_indicator_button_set_label(XFCE_INDICATOR_BUTTON(indicator->item),
-GTK_LABEL (gtk_label_new(_("No 
Indicators";
-gtk_container_add (GTK_CONTAINER (plugin), indicator->item);
-gtk_widget_show(indicator->item);
-/* show the panel's right-click menu on this menu */
-xfce_panel_plugin_add_action_widget (plugin, indicator->item);
-  } else {
-indicator->ebox = gtk_event_box_new();
-gtk_widget_set_can_focus(GTK_WIDGET(indicator->ebox), TRUE);
-gtk_container_add (GTK_CONTAINER (indicator->ebox), 
GTK_WIDGET(indicator->buttonbox));
-gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator->ebox));
-gtk_widget_show(GTK_WIDGET(indicator->buttonbox));
-gtk_widget_show(GTK_WIDGET(indicator->ebox));
-/* show the panel's right-click menu on this menu */
-xfce_panel_plugin_add_action_widget (plugin, indicator->ebox);
-  }
+  gtk_container_add (GTK_CONTAINER (indicator->ebox), 
GTK_WIDGET(indicator->buttonbox));
+  gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator->ebox));
+  gtk_widget_show(GTK_WIDGET(indicator->buttonbox));
+  gtk_widget_show(GTK_WIDGET(indicator->ebox));
+  /* show the panel's right-click menu on this menu */
+  xfce_panel_plugin_add_action_widget (plugin, indicator->ebox);
 }
 
 
@@ -357,11 +300,59 @@ menu_deactivate (GtkMenu *menu,
 static void
 indicator_construct (XfcePanelPlugin *plugin)
 {
-  IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
+  IndicatorPlugin  *indicator = XFCE_INDICATOR_PLUGIN (plugin);
+  GtkRcStyle   *style;
+  gint  indicators_loaded = 0;
 
   xfce_panel_plugin_menu_show_configure (plugin);
 
-  //consider moving some stuff from indicator_init() here
+  /* setup transation domain */
+  xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+
+  /* Init some theme/icon stuff */
+  gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
+  INDICATOR_ICONS_DIR);
+  /*gtk_widget_set_name(GTK_WIDGET (indicator->plugin), "indicator-plugin");*/
+
+  /* initialize xfconf */
+  if (xfconf_init(NULL)){
+/* get the list of excluded modules */
+indicator_read (indicator);
+  }
+  /* load 'em */
+  if (g_file_test(INDICATOR_DIR, (G_FILE

[Xfce4-commits] compilation error fix

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 8af1dffe564bf937c61ff0d3381a1d543b628e5b (commit)
   from fb8b0c8d6ca2337d7e4187685ee98dbe5e8420a0 (commit)

commit 8af1dffe564bf937c61ff0d3381a1d543b628e5b
Author: Andrzej 
Date:   Sat Apr 28 01:25:19 2012 +0900

compilation error fix

 panel-plugin/indicator-button.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 51f82cc..364d137 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -57,7 +57,6 @@ xfce_indicator_button_init (XfceIndicatorButton *button)
   gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
   gtk_widget_set_name (GTK_WIDGET (button), "indicator-button");
 
-  button->group = NULL;
   button->entry = NULL;
   button->menu = NULL;
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Added "align-left" property

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to fb8b0c8d6ca2337d7e4187685ee98dbe5e8420a0 (commit)
   from 57b1394a49142a979d77f089819f9c45f49320ab (commit)

commit fb8b0c8d6ca2337d7e4187685ee98dbe5e8420a0
Author: Andrzej 
Date:   Fri Apr 27 20:41:59 2012 +0900

Added "align-left" property

It also improves handling of button alignment
(uses GtkAlignment instead of GtkArray).

 panel-plugin/indicator-box.c|   31 +++-
 panel-plugin/indicator-box.h|1 +
 panel-plugin/indicator-button.c |   68 +-
 panel-plugin/indicator-button.h |5 +++
 panel-plugin/indicator-dialog.c |6 +++
 panel-plugin/indicator-dialog.glade |   15 
 panel-plugin/indicator.c|3 ++
 7 files changed, 101 insertions(+), 28 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 0643a3f..ffaf455 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -61,7 +61,8 @@ static gint xfce_indicator_box_get_row_size   
(XfceIndicatorBox
 enum
 {
   PROP_0,
-  PROP_ICON_SIZE_MAX
+  PROP_ICON_SIZE_MAX,
+  PROP_ALIGN_LEFT
 };
 
 G_DEFINE_TYPE (XfceIndicatorBox, xfce_indicator_box, GTK_TYPE_CONTAINER)
@@ -96,6 +97,13 @@ xfce_indicator_box_class_init (XfceIndicatorBoxClass *klass)
   128,
   24,
   EXO_PARAM_READWRITE));
+  g_object_class_install_property (gobject_class,
+   PROP_ALIGN_LEFT,
+   g_param_spec_boolean ("align-left", NULL, 
NULL,
+ FALSE,
+ EXO_PARAM_READWRITE));
+
+
 }
 
 
@@ -112,6 +120,7 @@ xfce_indicator_box_init (XfceIndicatorBox *box)
 
   box->nrows = 1;
   box->icon_size_max = 24;
+  box->align_left = FALSE;
   box->panel_size = 16;
   box->panel_orientation = GTK_ORIENTATION_HORIZONTAL;
   box->orientation = GTK_ORIENTATION_HORIZONTAL;
@@ -150,6 +159,10 @@ xfce_indicator_box_get_property (GObject*object,
   g_value_set_uint (value, box->icon_size_max);
   break;
 
+case PROP_ALIGN_LEFT:
+  g_value_set_boolean (value, box->align_left);
+  break;
+
 default:
   G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
   break;
@@ -184,7 +197,20 @@ xfce_indicator_box_set_property (GObject  *object,
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
   xfce_indicator_button_set_size (child, box->panel_size, size);
 }
-  gtk_widget_queue_resize (GTK_WIDGET (box));
+}
+  break;
+
+case PROP_ALIGN_LEFT:
+  val = g_value_get_boolean (value);
+  if (box->align_left != val)
+{
+  box->align_left = val;
+  for (li = box->children; li != NULL; li = li->next)
+{
+  child = XFCE_INDICATOR_BUTTON (li->data);
+  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
+  xfce_indicator_button_set_align_left (child, box->align_left);
+}
 }
   break;
 
@@ -299,6 +325,7 @@ xfce_indicator_box_add (GtkContainer *container,
   xfce_indicator_button_set_orientation (button, box->panel_orientation, 
box->orientation);
   size = xfce_indicator_box_get_row_size (box);
   xfce_indicator_button_set_size (button, box->panel_size, size);
+  xfce_indicator_button_set_align_left (button, box->align_left);
 
   gtk_widget_queue_resize (GTK_WIDGET (container));
 }
diff --git a/panel-plugin/indicator-box.h b/panel-plugin/indicator-box.h
index e302279..79b212d 100644
--- a/panel-plugin/indicator-box.h
+++ b/panel-plugin/indicator-box.h
@@ -46,6 +46,7 @@ struct _XfceIndicatorBox
   gint  panel_size;
   gint  nrows;
   gint  icon_size_max;
+  gboolean  align_left;
 
   GtkOrientationpanel_orientation;
   GtkOrientationorientation;
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 58810ad..51f82cc 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -51,15 +51,13 @@ xfce_indicator_button_class_init (XfceIndicatorButtonClass 
*klass)
 static void
 xfce_indicator_button_init (XfceIndicatorButton *button)
 {
-  GtkWidget   *outer_container;
-
   GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (button), GTK_CAN_DEFAULT | 
GTK_CAN_FOCUS);
   gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
   gtk_button_set_use_underline (GTK_BUTTON (button),TRUE);
   gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
   gtk_widget_set_name (GTK_WIDGET (button), "indicator-button");
 
-  button->io = NULL;
+ 

[Xfce4-commits] Moved button-related event handlers to buttons

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 2cb73e6d4175c5d693e91cc5357ac4564912e18f (commit)
   from c9785b9b7beb502e6b7bd03cbfbc6cd765040a29 (commit)

commit 2cb73e6d4175c5d693e91cc5357ac4564912e18f
Author: Andrzej 
Date:   Sat Apr 28 19:03:13 2012 +0900

Moved button-related event handlers to buttons

 panel-plugin/indicator-box.c|   16 +-
 panel-plugin/indicator-box.h|5 +++
 panel-plugin/indicator-button.c |   65 ++-
 panel-plugin/indicator.c|   55 +
 panel-plugin/indicator.h|4 --
 5 files changed, 85 insertions(+), 60 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 37248c4..78567b4 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -292,9 +292,14 @@ xfce_indicator_box_set_size (XfceIndicatorBox *box,
 
 
 GtkWidget *
-xfce_indicator_box_new ()
+xfce_indicator_box_new (XfcePanelPlugin *plugin)
 {
   XfceIndicatorBox *box = g_object_new (XFCE_TYPE_INDICATOR_BOX, NULL);
+
+  box->plugin = plugin;
+  if (box->plugin != NULL)
+g_object_ref (G_OBJECT (box->plugin));
+
   return GTK_WIDGET (box);
 }
 
@@ -633,3 +638,12 @@ xfce_indicator_box_get_align_left (XfceIndicatorBox *box)
 
   return box->align_left;
 }
+
+
+XfcePanelPlugin *
+xfce_indicator_box_get_plugin (XfceIndicatorBox *box)
+{
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BOX (box), NULL);
+
+  return box->plugin;
+}
diff --git a/panel-plugin/indicator-box.h b/panel-plugin/indicator-box.h
index e4ee8c9..d0746c8 100644
--- a/panel-plugin/indicator-box.h
+++ b/panel-plugin/indicator-box.h
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 G_BEGIN_DECLS
 
@@ -40,6 +41,8 @@ struct _XfceIndicatorBox
 {
   GtkContainer  __parent__;
 
+  XfcePanelPlugin  *plugin;
+
   GSList   *children;
 
   gint  panel_size;
@@ -82,6 +85,8 @@ gboolean xfce_indicator_box_get_align_left (XfceIndicatorBox 
*box);
 void xfce_indicator_box_remove_entry (XfceIndicatorBox *box,
   IndicatorObjectEntry *entry);
 
+XfcePanelPlugin *xfce_indicator_box_get_plugin (XfceIndicatorBox *box);
+
 GtkWidget *xfce_indicator_box_new ();
 
 G_END_DECLS
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 58ff3cc..ac0f432 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -32,8 +32,21 @@
 
 #include "indicator-button.h"
 
+
+#include 
+//#ifndef INDICATOR_OBJECT_SIGNAL_ENTRY_SCROLLED
+//#define INDICATOR_OBJECT_SIGNAL_ENTRY_SCROLLED "scroll-entry"
+//#endif
+
+
 static void xfce_indicator_button_finalize(GObject 
   *object);
 static gint xfce_indicator_button_get_icon_size   
(XfceIndicatorButton*button);
+static gboolean xfce_indicator_button_button_press(GtkWidget   
   *widget,
+   
GdkEventButton *event);
+static gboolean xfce_indicator_button_scroll  (GtkWidget   
   *widget,
+   
GdkEventScroll *event);
+static void xfce_indicator_button_menu_deactivate 
(XfceIndicatorButton*button,
+   GtkMenu 
   *menu);
 
 
 G_DEFINE_TYPE (XfceIndicatorButton, xfce_indicator_button, 
GTK_TYPE_TOGGLE_BUTTON)
@@ -41,10 +54,16 @@ G_DEFINE_TYPE (XfceIndicatorButton, xfce_indicator_button, 
GTK_TYPE_TOGGLE_BUTTO
 static void
 xfce_indicator_button_class_init (XfceIndicatorButtonClass *klass)
 {
-  GObjectClass   *gobject_class;
+  GObjectClass  *gobject_class;
+  GtkWidgetClass*widget_class;
 
   gobject_class = G_OBJECT_CLASS (klass);
   gobject_class->finalize = xfce_indicator_button_finalize;
+
+  widget_class = GTK_WIDGET_CLASS (klass);
+  widget_class->button_press_event = xfce_indicator_button_button_press;
+  widget_class->scroll_event = xfce_indicator_button_scroll;
+
 }
 
 
@@ -314,6 +333,8 @@ xfce_indicator_button_set_menu (XfceIndicatorButton *button,
 g_object_unref (G_OBJECT (button->menu));
   button->menu = menu;
   g_object_ref (G_OBJECT (button->menu));
+  g_signal_connect_swapped (G_OBJECT (button->menu), "deactivate",
+G_CALLBACK 
(xfce_indicator_button_menu_deactivate), button);
   gtk_menu_attach_to_widget(menu, GTK_WIDGET (button), NULL);
 }
 }
@@ -454,3 +475,45 @@ xfce_indicator_button_disconnect_signals 
(XfceIndicatorButton *button)
 
 }
 
+
+static gboolean
+xfce_indicator_button_button_press (GtkWidget  *widget,
+GdkEventButton *event)
+{
+  XfceIndicatorButton *button = XFCE_INDICATO

[Xfce4-commits] Fixed missing placeholder label (regression)

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to c40c282be0037c4de230fc7178c786a5fbab3689 (commit)
   from 2cb73e6d4175c5d693e91cc5357ac4564912e18f (commit)

commit c40c282be0037c4de230fc7178c786a5fbab3689
Author: Andrzej 
Date:   Sun Apr 29 02:33:43 2012 +0900

Fixed missing placeholder label (regression)

also, use an ellipsis mode for labels in the deskbar mode.

 panel-plugin/indicator-button.c |   23 ---
 panel-plugin/indicator.c|   17 ++---
 2 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index ac0f432..97e26d3 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -131,30 +131,47 @@ static void
 xfce_indicator_button_update_layout (XfceIndicatorButton *button)
 {
   GtkRequisition  label_size;
+  gfloat  align_x;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (button->buttonbox));
 
+  if (button->label != NULL)
+gtk_label_set_ellipsize (GTK_LABEL (button->label), PANGO_ELLIPSIZE_NONE);
+
+  /* deskbar mode? */
   if (button->label != NULL &&
   xfce_indicator_box_get_panel_orientation (button->buttonbox) == 
GTK_ORIENTATION_VERTICAL &&
   xfce_indicator_box_get_indicator_orientation (button->buttonbox) == 
GTK_ORIENTATION_HORIZONTAL)
 {
   gtk_widget_size_request (button->label, &label_size);
 
+  /* check if icon and label fit side by side */
   if (!xfce_indicator_box_get_align_left (button->buttonbox)
   || (button->icon != NULL
   && label_size.width >
   xfce_indicator_box_get_panel_size (button->buttonbox)
   - xfce_indicator_box_get_indicator_size (button->buttonbox)))
 {
-  gtk_alignment_set (GTK_ALIGNMENT (button->align_box), 0.5, 0.5, 0.0, 
0.0);
+  align_x = 0.5;
   gtk_orientable_set_orientation (GTK_ORIENTABLE (button->box), 
GTK_ORIENTATION_VERTICAL);
 }
   else
 {
-  gtk_alignment_set (GTK_ALIGNMENT (button->align_box), 0.0, 0.5, 0.0, 
0.0);
+  align_x = 0.0;
   gtk_orientable_set_orientation (GTK_ORIENTABLE (button->box), 
GTK_ORIENTATION_HORIZONTAL);
 }
+
+  /* check if label alone fits in the panel */
+  if (label_size.width > xfce_indicator_box_get_panel_size 
(button->buttonbox) - 6)
+{
+  gtk_alignment_set (GTK_ALIGNMENT (button->align_box), align_x, 0.5, 
1.0, 0.0);
+  gtk_label_set_ellipsize (GTK_LABEL (button->label), 
PANGO_ELLIPSIZE_END);
+}
+  else
+{
+  gtk_alignment_set (GTK_ALIGNMENT (button->align_box), align_x, 0.5, 
0.0, 0.0);
+}
 }
   else
 {
@@ -482,7 +499,7 @@ xfce_indicator_button_button_press (GtkWidget  *widget,
 {
   XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (widget);
 
-  if( event->button == 1) /* left click only */
+  if(event->button == 1 && button->menu != NULL) /* left click only */
 {
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),TRUE);
   gtk_menu_popup (button->menu, NULL, NULL,
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index f152a02..88f4d42 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -276,6 +276,7 @@ indicator_construct (XfcePanelPlugin *plugin)
   IndicatorPlugin  *indicator = XFCE_INDICATOR_PLUGIN (plugin);
   GtkRcStyle   *style;
   gint  indicators_loaded = 0;
+  GtkWidget*label;
 
   xfce_panel_plugin_menu_show_configure (plugin);
 
@@ -321,10 +322,11 @@ indicator_construct (XfcePanelPlugin *plugin)
   if (indicators_loaded == 0) {
 /* A label to allow for click through */
 indicator->item = xfce_indicator_button_new(NULL, NULL, XFCE_INDICATOR_BOX 
(indicator->buttonbox));
-xfce_indicator_button_set_label(XFCE_INDICATOR_BUTTON(indicator->item),
-GTK_LABEL (gtk_label_new(_("No 
Indicators";
+label = gtk_label_new ( _("No Indicators"));
+xfce_indicator_button_set_label (XFCE_INDICATOR_BUTTON (indicator->item), 
GTK_LABEL (label));
 gtk_container_add (GTK_CONTAINER (indicator->buttonbox), indicator->item);
-gtk_widget_show(indicator->item);
+gtk_widget_show (label);
+gtk_widget_show (indicator->item);
   }
 }
 
@@ -335,6 +337,15 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * 
entry, gpointer user_d
   XfcePanelPlugin *plugin = XFCE_PANEL_PLUGIN (user_data);
   IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
   GtkWidget * button = xfce_indicator_button_new (io, entry, 
XFCE_INDICATOR_BOX (indicator->buttonbox));
+
+  /* remove placeholder item when there are real entries to be added */
+  if (indicator->

[Xfce4-commits] Refactored XfceIndicatorButton class

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to c9785b9b7beb502e6b7bd03cbfbc6cd765040a29 (commit)
   from 8af1dffe564bf937c61ff0d3381a1d543b628e5b (commit)

commit c9785b9b7beb502e6b7bd03cbfbc6cd765040a29
Author: Andrzej 
Date:   Sat Apr 28 15:31:55 2012 +0900

Refactored XfceIndicatorButton class

Moved box-specific fields to XfceIndicatorBox and added
a box-layout-changed signal to update all buttons at once.
This may also be faster and less glitchy as signals
are merged by the main loop.

 panel-plugin/indicator-box.c|  141 +
 panel-plugin/indicator-box.h|   20 +++-
 panel-plugin/indicator-button.c |  222 ---
 panel-plugin/indicator-button.h |   29 ++
 panel-plugin/indicator.c|   11 +--
 5 files changed, 241 insertions(+), 182 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index ffaf455..37248c4 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -65,6 +65,15 @@ enum
   PROP_ALIGN_LEFT
 };
 
+enum
+{
+  BOX_LAYOUT_CHANGED,
+  LAST_SIGNAL
+};
+
+static guint xfce_indicator_box_signals[LAST_SIGNAL] = { 0, };
+
+
 G_DEFINE_TYPE (XfceIndicatorBox, xfce_indicator_box, GTK_TYPE_CONTAINER)
 
 static void
@@ -103,7 +112,13 @@ xfce_indicator_box_class_init (XfceIndicatorBoxClass 
*klass)
  FALSE,
  EXO_PARAM_READWRITE));
 
-
+  xfce_indicator_box_signals[BOX_LAYOUT_CHANGED] =
+g_signal_new (g_intern_static_string ("box-layout-changed"),
+  G_TYPE_FROM_CLASS (gobject_class),
+  G_SIGNAL_RUN_LAST,
+  0, NULL, NULL,
+  g_cclosure_marshal_VOID__VOID,
+  G_TYPE_NONE, 0);
 }
 
 
@@ -190,13 +205,7 @@ xfce_indicator_box_set_property (GObject  *object,
   if (box->icon_size_max != val)
 {
   box->icon_size_max = val;
-  size = xfce_indicator_box_get_row_size (box);
-  for (li = box->children; li != NULL; li = li->next)
-{
-  child = XFCE_INDICATOR_BUTTON (li->data);
-  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
-  xfce_indicator_button_set_size (child, box->panel_size, size);
-}
+  g_signal_emit (G_OBJECT (box), 
xfce_indicator_box_signals[BOX_LAYOUT_CHANGED], 0);
 }
   break;
 
@@ -205,12 +214,7 @@ xfce_indicator_box_set_property (GObject  *object,
   if (box->align_left != val)
 {
   box->align_left = val;
-  for (li = box->children; li != NULL; li = li->next)
-{
-  child = XFCE_INDICATOR_BUTTON (li->data);
-  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
-  xfce_indicator_button_set_align_left (child, box->align_left);
-}
+  g_signal_emit (G_OBJECT (box), 
xfce_indicator_box_signals[BOX_LAYOUT_CHANGED], 0);
 }
   break;
 
@@ -247,12 +251,7 @@ xfce_indicator_box_set_orientation (XfceIndicatorBox *box,
 
   if (needs_update)
 {
-  for (li = box->children; li != NULL; li = li->next)
-{
-  child = XFCE_INDICATOR_BUTTON (li->data);
-  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
-  xfce_indicator_button_set_orientation (child, panel_orientation, 
orientation);
-}
+  g_signal_emit (G_OBJECT (box), 
xfce_indicator_box_signals[BOX_LAYOUT_CHANGED], 0);
   gtk_widget_queue_resize (GTK_WIDGET (box));
 }
 }
@@ -285,13 +284,7 @@ xfce_indicator_box_set_size (XfceIndicatorBox *box,
 
   if (needs_update)
 {
-  size = xfce_indicator_box_get_row_size (box);
-  for (li = box->children; li != NULL; li = li->next)
-{
-  child = XFCE_INDICATOR_BUTTON (li->data);
-  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
-  xfce_indicator_button_set_size (child, panel_size, size);
-}
+  g_signal_emit (G_OBJECT (box), 
xfce_indicator_box_signals[BOX_LAYOUT_CHANGED], 0);
   gtk_widget_queue_resize (GTK_WIDGET (box));
 }
 }
@@ -322,10 +315,6 @@ xfce_indicator_box_add (GtkContainer *container,
   box->children = g_slist_append (box->children, child);
 
   gtk_widget_set_parent (child, GTK_WIDGET (box));
-  xfce_indicator_button_set_orientation (button, box->panel_orientation, 
box->orientation);
-  size = xfce_indicator_box_get_row_size (box);
-  xfce_indicator_button_set_size (button, box->panel_size, size);
-  xfce_indicator_button_set_align_left (button, box->align_left);
 
   gtk_widget_queue_resize (GTK_WIDGET (container));
 }
@@ -402,9 +391,7 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
   row = 0;
   length = 0;
   x = 0;
-  //nrows = MAX (box->nrows,
-  // box->panel_size / xfce_indicat

[Xfce4-commits] Make sure the menu is closed when the button is removed.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to aaa1b5f89857605cfbc512f17623d2c66e1f1512 (commit)
   from 24788ad2952d8afc4e2135d176bd62a7755a3d87 (commit)

commit aaa1b5f89857605cfbc512f17623d2c66e1f1512
Author: Andrzej 
Date:   Wed Jul 25 17:35:50 2012 +0900

Make sure the menu is closed when the button is removed.

 panel-plugin/indicator-button.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index ef8fa56..8c2aaa7 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -474,6 +474,11 @@ xfce_indicator_button_disconnect_signals 
(XfceIndicatorButton *button)
 {
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
 
+  if (button->menu != 0)
+{
+  gtk_menu_popdown (button->menu);
+}
+
   if (button->box_layout_changed_id != 0)
 {
   g_signal_handler_disconnect (button->buttonbox, 
button->box_layout_changed_id);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Worked around crashes when plugin is loaded as an external plugin.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 707ad099934c2e3ff7aab18c0601b6072e23f782 (commit)
   from 00633e1de8308a1456a46f8dc03f7baa2a62c30a (commit)

commit 707ad099934c2e3ff7aab18c0601b6072e23f782
Author: Andrzej 
Date:   Sun Dec 2 21:34:37 2012 +

Worked around crashes when plugin is loaded as an external plugin.

The plugin used to crash when xfce4-panel was compiled with
--enable-debug and the plugin was configured as an external module
(X-XFCE-Internal=FALSE in indicator.desktop file).

This was caused by the wrapper binary setting a more restrictive
fatal mask than the xfce4-panel binary. As we are linking external
code (indicators) we have no control over their use of g_warning or
g_critical.

This commit relaxes the fatal mask so that the use of g_warning or
g_critical does not crash the plugin.

 panel-plugin/indicator.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index e807328..47c5e1b 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -178,6 +178,12 @@ indicator_init (IndicatorPlugin *indicator)
 {
   XfcePanelPlugin  *plugin = XFCE_PANEL_PLUGIN (indicator);
 
+  /* Indicators print a lot of warnings. By default, "wrapper"
+ makes them critical, so the plugin "crashes" when run as an external
+ plugin but not internal one (loaded by "xfce4-panel" itself).
+ The following lines makes only g_error critical. */
+  g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
+
   indicator->buttonbox = xfce_indicator_box_new (plugin);
   gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator->buttonbox));
   gtk_widget_show(GTK_WIDGET(indicator->buttonbox));
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Plugged a memory leak.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 94c371f5760b00df1cbba141a12c3192aa339e2b (commit)
   from 1c76403a300e778ca5e170acbbf3f01dde9c8c18 (commit)

commit 94c371f5760b00df1cbba141a12c3192aa339e2b
Author: Andrzej 
Date:   Tue Dec 25 23:56:10 2012 +

Plugged a memory leak.

 panel-plugin/indicator-button.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 109544f..74f7d28 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -228,6 +228,7 @@ xfce_indicator_button_update_icon (XfceIndicatorButton 
*button)
   (pixbuf_s, (gint) (size * aspect), size,
GDK_INTERP_BILINEAR);
   xfce_panel_image_set_from_pixbuf (XFCE_PANEL_IMAGE (button->icon), 
pixbuf_d);
+  g_object_unref (G_OBJECT (pixbuf_d));
 }
   else
 {
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Removed unneeded event box causing issues with transparent panels.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 00633e1de8308a1456a46f8dc03f7baa2a62c30a (commit)
   from aaa1b5f89857605cfbc512f17623d2c66e1f1512 (commit)

commit 00633e1de8308a1456a46f8dc03f7baa2a62c30a
Author: Andrzej 
Date:   Sat Nov 17 21:39:39 2012 +

Removed unneeded event box causing issues with transparent panels.

For unknown reasons indicator plugin was handling transparency
correctly when run as an executable but not when run as a module.

 panel-plugin/indicator.c |   10 +-
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 09aab6a..e807328 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -80,7 +80,6 @@ struct _IndicatorPlugin
   /* panel widgets */
   GtkWidget   *item;
   GtkWidget   *buttonbox;
-  GtkWidget   *ebox;
 
   /* indicator settings */
   gchar  **excluded_modules;
@@ -179,16 +178,9 @@ indicator_init (IndicatorPlugin *indicator)
 {
   XfcePanelPlugin  *plugin = XFCE_PANEL_PLUGIN (indicator);
 
-  indicator->ebox = gtk_event_box_new();
-  gtk_widget_set_can_focus(GTK_WIDGET(indicator->ebox), TRUE);
-
   indicator->buttonbox = xfce_indicator_box_new (plugin);
-  gtk_container_add (GTK_CONTAINER (indicator->ebox), 
GTK_WIDGET(indicator->buttonbox));
-  gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator->ebox));
+  gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator->buttonbox));
   gtk_widget_show(GTK_WIDGET(indicator->buttonbox));
-  gtk_widget_show(GTK_WIDGET(indicator->ebox));
-  /* show the panel's right-click menu on this menu */
-  xfce_panel_plugin_add_action_widget (plugin, indicator->ebox);
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed compilation warnings

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 24788ad2952d8afc4e2135d176bd62a7755a3d87 (commit)
   from c40c282be0037c4de230fc7178c786a5fbab3689 (commit)

commit 24788ad2952d8afc4e2135d176bd62a7755a3d87
Author: Andrzej 
Date:   Thu May 10 23:47:10 2012 +0900

Fixed compilation warnings

The remaining ones:
/usr/local/include/libindicator-0.4/libindicator/indicator-object.h:190:13: 
warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
come from libindicator headers.

 panel-plugin/indicator-box.c|   11 
 panel-plugin/indicator-button.c |4 ---
 panel-plugin/indicator.c|   55 +-
 3 files changed, 30 insertions(+), 40 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 78567b4..854f4a4 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -166,7 +166,6 @@ xfce_indicator_box_get_property (GObject*object,
  GParamSpec *pspec)
 {
   XfceIndicatorBox *box = XFCE_INDICATOR_BOX (object);
-  GPtrArray*array;
 
   switch (prop_id)
 {
@@ -194,9 +193,6 @@ xfce_indicator_box_set_property (GObject  *object,
 {
   XfceIndicatorBox *box = XFCE_INDICATOR_BOX (object);
   gint  val;
-  gint  size;
-  XfceIndicatorButton  *child;
-  GSList   *li;
 
   switch (prop_id)
 {
@@ -232,8 +228,6 @@ xfce_indicator_box_set_orientation (XfceIndicatorBox *box,
 GtkOrientationorientation)
 {
   gboolean  needs_update = FALSE;
-  XfceIndicatorButton  *child;
-  GSList   *li;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
 
@@ -264,9 +258,6 @@ xfce_indicator_box_set_size (XfceIndicatorBox *box,
  gint  nrows)
 {
   gboolean  needs_update = FALSE;
-  XfceIndicatorButton  *child;
-  GSList   *li;
-  gint  size;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
 
@@ -310,8 +301,6 @@ xfce_indicator_box_add (GtkContainer *container,
 GtkWidget*child)
 {
   XfceIndicatorBox*box = XFCE_INDICATOR_BOX (container);
-  XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (child);
-  gint size;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
   g_return_if_fail (GTK_IS_WIDGET (child));
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 97e26d3..ef8fa56 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -278,8 +278,6 @@ xfce_indicator_button_set_label (XfceIndicatorButton 
*button,
 static void
 on_pixbuf_changed (GtkImage *image, GParamSpec *pspec, XfceIndicatorButton 
*button)
 {
-  GdkPixbuf *pixbuf;
-
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (GTK_IS_IMAGE (image));
   g_return_if_fail (XFCE_IS_PANEL_IMAGE (button->icon));
@@ -293,8 +291,6 @@ void
 xfce_indicator_button_set_image (XfceIndicatorButton *button,
  GtkImage*image)
 {
-  GdkPixbuf *pixbuf;
-
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (GTK_IS_IMAGE (image));
 
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 88f4d42..09aab6a 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -154,9 +154,9 @@ static void
 indicator_class_init (IndicatorPluginClass *klass)
 {
   XfcePanelPluginClass *plugin_class;
-  GObjectClass *gobject_class;
+  //GObjectClass *gobject_class;
 
-  gobject_class = G_OBJECT_CLASS (klass);
+  //gobject_class = G_OBJECT_CLASS (klass);
   //gobject_class->get_property = indicator_get_property;
   //gobject_class->set_property = indicator_set_property;
 
@@ -196,7 +196,7 @@ indicator_init (IndicatorPlugin *indicator)
 static void
 indicator_free (XfcePanelPlugin *plugin)
 {
-  IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
+  //IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
   GtkWidget *dialog;
 
   /* check if the dialog is still open. if so, destroy it */
@@ -274,7 +274,6 @@ static void
 indicator_construct (XfcePanelPlugin *plugin)
 {
   IndicatorPlugin  *indicator = XFCE_INDICATOR_PLUGIN (plugin);
-  GtkRcStyle   *style;
   gint  indicators_loaded = 0;
   GtkWidget*label;
 
@@ -304,7 +303,7 @@ indicator_construct (XfcePanelPlugin *plugin)
 length = (indicator->excluded_modules != NULL) ? g_strv_length 
(indicator->excluded_modules) : 0;
 while ((name = g_dir_read_name(dir)) != NULL) {
   for (i = 0; i < length; ++i) {
-if (match = (g_strcmp0 (name, indicator->excluded_modules[i]) == 0))
+if ((match = g_strcmp0 (name, indicator->excluded_modules[i])) == 0)
   break;
   }
 
@@ -374,34 +373,40 @@ entry_removed (IndicatorObject * io, Indic

[Xfce4-commits] Fixed menu positioning.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 1c76403a300e778ca5e170acbbf3f01dde9c8c18 (commit)
   from 707ad099934c2e3ff7aab18c0601b6072e23f782 (commit)

commit 1c76403a300e778ca5e170acbbf3f01dde9c8c18
Author: Andrzej 
Date:   Sun Dec 9 02:46:58 2012 +

Fixed menu positioning.

Occasionally, e.g. when indicator was placed near the bottom
of a vertical panel, the first click on a button resulted
in an incorrect position/size of the menu. Subsequent clicks
were "fixing" this behavior.

This commit repositions the menu to reset its position and size.

 panel-plugin/indicator-button.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 8c2aaa7..109544f 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -503,6 +503,7 @@ xfce_indicator_button_button_press (GtkWidget  *widget,
   if(event->button == 1 && button->menu != NULL) /* left click only */
 {
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),TRUE);
+  gtk_menu_reposition (GTK_MENU (button->menu));
   gtk_menu_popup (button->menu, NULL, NULL,
   xfce_panel_plugin_position_menu,
   xfce_indicator_box_get_plugin (button->buttonbox),
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Added support for indicator reordering.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 0db001bdd6e764e2e375ac69ad01418c09c3b6da (commit)
   from 86c62c471dcaf3f2a9b84a501e9e49d2ffc1152e (commit)

commit 0db001bdd6e764e2e375ac69ad01418c09c3b6da
Author: Andrzej 
Date:   Tue Mar 12 02:08:51 2013 +

Added support for indicator reordering.

Fairly extensive changes to the indicator container class.
Needs testing with more complex indicators (globalmenu etc).

 panel-plugin/indicator-box.c|  318 +++
 panel-plugin/indicator-button.c |   13 ++
 panel-plugin/indicator-button.h |   28 ++--
 panel-plugin/indicator.c|   12 +-
 4 files changed, 227 insertions(+), 144 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 2766bc1..a48f22b 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -34,6 +34,8 @@
 #include "indicator-button.h"
 
 static void xfce_indicator_box_finalize   (GObject 
 *object);
+static void xfce_indicator_box_list_changed   
(XfceIndicatorBox *box,
+   IndicatorConfig 
 *config);
 static void xfce_indicator_box_add(GtkContainer
 *container,
GtkWidget   
 *child);
 static void xfce_indicator_box_remove (GtkContainer
 *container,
@@ -55,7 +57,7 @@ struct _XfceIndicatorBox
 
   IndicatorConfig  *config;
 
-  GSList   *children;
+  GHashTable   *children;
 
   gint  panel_size;
   gint  nrows;
@@ -64,6 +66,8 @@ struct _XfceIndicatorBox
 
   GtkOrientationpanel_orientation;
   GtkOrientationorientation;
+
+  gulongindicator_list_changed_id;
 };
 
 struct _XfceIndicatorBoxClass
@@ -107,7 +111,12 @@ xfce_indicator_box_init (XfceIndicatorBox *box)
   gtk_widget_set_can_focus(GTK_WIDGET(box), TRUE);
   gtk_container_set_border_width(GTK_CONTAINER(box), 0);
 
-  box->children = NULL;
+  /* todo: no deallocation function for values */
+  box->children = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, 
NULL);
+
+  box->indicator_list_changed_id =
+g_signal_connect_swapped (G_OBJECT (box->config), "indicator-list-changed",
+  G_CALLBACK (xfce_indicator_box_list_changed), 
box);
 }
 
 
@@ -117,12 +126,14 @@ xfce_indicator_box_finalize (GObject *object)
 {
   XfceIndicatorBox *box = XFCE_INDICATOR_BOX (object);
 
-  if (box->children != NULL)
+  if (box->indicator_list_changed_id != 0)
 {
-  g_slist_free (box->children);
-  g_debug ("Not all icons have been removed from the indicator icon box.");
+  g_signal_handler_disconnect (box->config, 
box->indicator_list_changed_id);
+  box->indicator_list_changed_id = 0;
 }
 
+  g_hash_table_destroy (box->children);
+
   G_OBJECT_CLASS (xfce_indicator_box_parent_class)->finalize (object);
 }
 
@@ -141,16 +152,34 @@ xfce_indicator_box_new (IndicatorConfig *config)
 
 
 static void
+xfce_indicator_box_list_changed (XfceIndicatorBox *box,
+ IndicatorConfig  *config)
+{
+  g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
+  g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (config));
+
+  gtk_widget_queue_resize (GTK_WIDGET (box));
+}
+
+
+
+static void
 xfce_indicator_box_add (GtkContainer *container,
 GtkWidget*child)
 {
   XfceIndicatorBox*box = XFCE_INDICATOR_BOX (container);
+  XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (child);
+  GList   *li;
+  const gchar *io_name;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
-  g_return_if_fail (GTK_IS_WIDGET (child));
+  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (child->parent == NULL);
 
-  box->children = g_slist_append (box->children, child);
+  io_name = xfce_indicator_button_get_io_name (button);
+  li = g_hash_table_lookup (box->children, io_name);
+  li = g_list_append (li, button);
+  g_hash_table_replace (box->children, g_strdup (io_name), li);
 
   gtk_widget_set_parent (child, GTK_WIDGET (box));
 
@@ -163,17 +192,22 @@ static void
 xfce_indicator_box_remove (GtkContainer *container,
GtkWidget*child)
 {
-  XfceIndicatorBox *box = XFCE_INDICATOR_BOX (container);
-  GSList   *li;
+  XfceIndicatorBox*box = XFCE_INDICATOR_BOX (container);
+  XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (child);
+  GList   *li, *li_tmp;
+  const gchar *io_name;
 
   /* search the child */
-  li = g_slist_find (box->children, child);
-  if (G_LIKELY (li != NULL))
+  io_name = xfce_indicator_button_get_io_name (button);
+  li = g_hash_table_lookup (box->children, io_name);
+  li_tmp = g_list_fin

[Xfce4-commits] Sort indicator entries by location.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 33d3eb312c04fb7ae12e2a316e52a838267e5e0a (commit)
   from 290c5f4596900e67f3c2e87f730812e8e48a9333 (commit)

commit 33d3eb312c04fb7ae12e2a316e52a838267e5e0a
Author: Andrzej 
Date:   Tue Mar 12 22:53:25 2013 +

Sort indicator entries by location.

(or by name_hint, or don't sort at all)

 panel-plugin/indicator-box.c|   32 +++-
 panel-plugin/indicator-button.c |   14 ++
 panel-plugin/indicator-button.h |2 ++
 3 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 3b820a9..c39435e 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -163,6 +163,32 @@ xfce_indicator_box_list_changed (XfceIndicatorBox *box,
 
 
 
+static gint
+xfce_indicator_box_sort_buttons (gconstpointer a,
+ gconstpointer b)
+{
+  XfceIndicatorButton *a0 = XFCE_INDICATOR_BUTTON (a);
+  XfceIndicatorButton *b0 = XFCE_INDICATOR_BUTTON (b);
+  guinta1, b1;
+
+  a1 = xfce_indicator_button_get_pos (a0);
+  b1 = xfce_indicator_button_get_pos (b0);
+
+  /* group all entries with location==0 at the beginning of the list
+   * but don't sort them (they may depend on insertion order) */
+
+  /* if there are two entries with the same non-zero location
+   * try to resolve their order by their name_hint */
+  if (a1 != 0 && a1 == b1)
+return -g_strcmp0 (xfce_indicator_button_get_entry(a0)->name_hint,
+   xfce_indicator_button_get_entry(b0)->name_hint);
+
+  /* else, use the location field */
+  return (a1-b1);
+}
+
+
+
 static void
 xfce_indicator_box_add (GtkContainer *container,
 GtkWidget*child)
@@ -178,7 +204,11 @@ xfce_indicator_box_add (GtkContainer *container,
 
   io_name = xfce_indicator_button_get_io_name (button);
   li = g_hash_table_lookup (box->children, io_name);
-  li = g_list_append (li, button);
+  if (xfce_indicator_button_get_pos (button) == 0)
+li = g_list_append (li, button);
+  else
+li = g_list_insert_sorted (li, button, xfce_indicator_box_sort_buttons);
+
   g_hash_table_replace (box->children, g_strdup (io_name), li);
 
   gtk_widget_set_parent (child, GTK_WIDGET (box));
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index f01db2f..98f547d 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -434,6 +434,20 @@ xfce_indicator_button_get_io_name (XfceIndicatorButton 
*button)
 
 
 
+guint
+xfce_indicator_button_get_pos (XfceIndicatorButton *button)
+{
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 0);
+
+  return indicator_object_get_location (button->io, button->entry);
+}
+
+
+
+
+
+
+
 GtkMenu *
 xfce_indicator_button_get_menu (XfceIndicatorButton *button)
 {
diff --git a/panel-plugin/indicator-button.h b/panel-plugin/indicator-button.h
index 5eb1dc1..b25efa6 100644
--- a/panel-plugin/indicator-button.h
+++ b/panel-plugin/indicator-button.h
@@ -59,6 +59,8 @@ IndicatorObject*xfce_indicator_button_get_io  
(XfceIndicatorButton
 
 const gchar*xfce_indicator_button_get_io_name (XfceIndicatorButton 
   *button);
 
+guint   xfce_indicator_button_get_pos (XfceIndicatorButton 
   *button);
+
 GtkMenu*xfce_indicator_button_get_menu(XfceIndicatorButton 
   *button);
 
 GtkWidget  *xfce_indicator_button_new (IndicatorObject 
   *io,
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Properly connecting indicator-list-changed signal.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 290c5f4596900e67f3c2e87f730812e8e48a9333 (commit)
   from 0db001bdd6e764e2e375ac69ad01418c09c3b6da (commit)

commit 290c5f4596900e67f3c2e87f730812e8e48a9333
Author: Andrzej 
Date:   Tue Mar 12 22:13:44 2013 +

Properly connecting indicator-list-changed signal.

 panel-plugin/indicator-box.c|8 
 panel-plugin/indicator-config.c |5 +
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index a48f22b..3b820a9 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -113,10 +113,6 @@ xfce_indicator_box_init (XfceIndicatorBox *box)
 
   /* todo: no deallocation function for values */
   box->children = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, 
NULL);
-
-  box->indicator_list_changed_id =
-g_signal_connect_swapped (G_OBJECT (box->config), "indicator-list-changed",
-  G_CALLBACK (xfce_indicator_box_list_changed), 
box);
 }
 
 
@@ -146,6 +142,10 @@ xfce_indicator_box_new (IndicatorConfig *config)
 
   box->config = config;
 
+  box->indicator_list_changed_id =
+g_signal_connect_swapped (G_OBJECT (box->config), "indicator-list-changed",
+  G_CALLBACK (xfce_indicator_box_list_changed), 
box);
+
   return GTK_WIDGET (box);
 }
 
diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index f73ea94..09dbb96 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -596,6 +596,7 @@ indicator_config_blacklist_set (IndicatorConfig *config,
   g_hash_table_remove (config->blacklist, name);
 }
   g_object_notify (G_OBJECT (config), "blacklist");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
@@ -622,6 +623,7 @@ indicator_config_whitelist_set (IndicatorConfig *config,
   g_hash_table_remove (config->whitelist, name);
 }
   g_object_notify (G_OBJECT (config), "whitelist");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
@@ -668,6 +670,7 @@ indicator_config_add_known_indicator (IndicatorConfig 
*config,
   config->known_indicators = g_list_append (config->known_indicators, g_strdup 
(name));
 
   g_object_notify (G_OBJECT (config), "known-indicators");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
@@ -709,6 +712,7 @@ indicator_config_swap_known_indicators (IndicatorConfig 
*config,
   g_list_free (li_tmp);
 
   g_object_notify (G_OBJECT (config), "known-indicators");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
@@ -727,6 +731,7 @@ indicator_config_names_clear (IndicatorConfig *config)
 
   g_hash_table_remove_all (config->whitelist);
   g_object_notify (G_OBJECT (config), "whitelist");
+  g_signal_emit (G_OBJECT (config), indicator_config_signals 
[INDICATOR_LIST_CHANGED], 0);
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed a regression, inconsistent border sizes.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 8eb305349bff65313d8300defa8918675cc38bf6 (commit)
   from 81c78516eec9103da0ba00c79ab2d936a91b6c99 (commit)

commit 8eb305349bff65313d8300defa8918675cc38bf6
Author: Andrzej 
Date:   Thu Mar 14 01:22:35 2013 +

Fixed a regression, inconsistent border sizes.

Not sure why different buttons had different x/ythickness values.
Fixed that by checking container's style. Also, reduced the border
size by 2px.

 panel-plugin/indicator-button.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 98f547d..0508674 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -469,8 +469,8 @@ xfce_indicator_button_get_icon_size (XfceIndicatorButton 
*button)
 
   indicator_size = xfce_indicator_button_get_size (button);
 
-  style = gtk_widget_get_style (GTK_WIDGET (button));
-  border_thickness = 2 * MAX (style->xthickness, style->ythickness) + 2;
+  style = gtk_widget_get_style (GTK_WIDGET (button->plugin));
+  border_thickness = 2 * MAX (style->xthickness, style->ythickness);
 
   return MIN (indicator_size - border_thickness,
   indicator_config_get_icon_size_max (button->config));
@@ -486,8 +486,8 @@ xfce_indicator_button_get_size (XfceIndicatorButton *button)
 
   g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 24);
 
-  style = gtk_widget_get_style (GTK_WIDGET (button));
-  border_thickness = 2 * MAX (style->xthickness, style->ythickness) + 2;
+  style = gtk_widget_get_style (GTK_WIDGET (button->plugin));
+  border_thickness = 2 * MAX (style->xthickness, style->ythickness) ;
 
   return MIN (indicator_config_get_panel_size (button->config) /
   indicator_config_get_nrows (button->config),
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Hiding one of "hidden"/"visible" columns to minimize confusion.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 346cfe1ab16173fc0c5fe13a23c144a94f99239e (commit)
   from b552265a8ed94468d24f6eeb387a2a7b762cc94c (commit)

commit 346cfe1ab16173fc0c5fe13a23c144a94f99239e
Author: Andrzej 
Date:   Wed Mar 13 01:16:13 2013 +

Hiding one of "hidden"/"visible" columns to minimize confusion.

 panel-plugin/indicator-dialog.c |   29 +
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index d4740fe..7422231 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -259,6 +259,32 @@ indicator_dialog_visible_toggled (GtkCellRendererToggle 
*renderer,
 
 
 static void
+indicator_dialog_mode_whitelist_toggled (GtkCheckButton*check_box,
+ IndicatorDialog   *dialog)
+{
+  GtkTreeViewColumn *column_visible, *column_hidden;
+  GObject   *treeview;
+  gboolean   mode_whitelist;
+
+  g_return_if_fail (GTK_IS_CHECK_BUTTON (check_box));
+  g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
+
+  mode_whitelist = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(check_box));
+
+  treeview = gtk_builder_get_object (GTK_BUILDER (dialog), 
"indicators-treeview");
+  g_return_if_fail (GTK_IS_TREE_VIEW (treeview));
+
+  column_visible = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 
COLUMN_VISIBLE);
+  column_hidden  = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 
COLUMN_HIDDEN);
+
+  gtk_tree_view_column_set_visible (column_visible,  mode_whitelist);
+  gtk_tree_view_column_set_visible (column_hidden,  !mode_whitelist);
+}
+
+
+
+
+static void
 indicator_dialog_swap_rows (IndicatorDialog  *dialog,
 GtkTreeIter  *iter_prev,
 GtkTreeIter  *iter)
@@ -445,6 +471,9 @@ indicator_dialog_build (IndicatorDialog *dialog)
   g_return_if_fail (GTK_IS_WIDGET (object));
   exo_mutual_binding_new (G_OBJECT (dialog->config), "mode-whitelist",
   G_OBJECT (object), "active");
+  g_signal_connect (G_OBJECT (object), "toggled",
+G_CALLBACK (indicator_dialog_mode_whitelist_toggled), 
dialog);
+  indicator_dialog_mode_whitelist_toggled (GTK_CHECK_BUTTON (object), 
dialog);
 
   dialog->store = gtk_builder_get_object (builder, "indicators-store");
   g_return_if_fail (GTK_IS_LIST_STORE (dialog->store));
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Added "pretty names" and indicators for known indicators.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to b552265a8ed94468d24f6eeb387a2a7b762cc94c (commit)
   from 33d3eb312c04fb7ae12e2a316e52a838267e5e0a (commit)

commit b552265a8ed94468d24f6eeb387a2a7b762cc94c
Author: Andrzej 
Date:   Wed Mar 13 00:15:05 2013 +

Added "pretty names" and indicators for known indicators.

I've used listed indicators available in Ubuntu (12.10) repository.
The names are unofficial and icons are picked from my own system.
Please feel free to update/fix them.

 panel-plugin/indicator-dialog.c |   95 +++---
 panel-plugin/indicator-dialog.glade |   21 +++-
 2 files changed, 95 insertions(+), 21 deletions(-)

diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index 1387c76..d4740fe 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -43,6 +43,23 @@
 
 
 
+/* known indicator names */
+static const gchar *pretty_names[][3] =
+{
+  /* raw name,  pretty name, 
icon-name(?) */
+  { "libapplication.so",N_("Application Indicators"),   
"application-default-icon" },
+  { "libsoundmenu.so",  N_("Sound Menu"),   
"preferences-desktop-sound" },
+  { "libprintersmenu.so",   N_("Printers Menu"),
"printer" },
+  { "libpower.so",  N_("Power Management"), 
NULL },
+  { "libappmenu.so",N_("Application Menus (Global Menu)"),  
"menu-editor" },
+  { "libsession.so",N_("Session Management"),   
NULL },
+  { "libmessaging.so",  N_("Messaging Menu"),   
"indicator-messages" },
+  { "libdatetime.so",   N_("Date and Time"),
"time-admin" },
+};
+
+
+#define ICON_SIZE (22)
+
 static void  indicator_dialog_build   (IndicatorDialog 
 *dialog);
 static void  indicator_dialog_response(GtkWidget   
 *window,
gint
  response_id,
@@ -71,7 +88,8 @@ enum
   COLUMN_PIXBUF,
   COLUMN_TITLE,
   COLUMN_HIDDEN,
-  COLUMN_VISIBLE
+  COLUMN_VISIBLE,
+  COLUMN_TIP
 };
 
 
@@ -102,6 +120,7 @@ static void
 indicator_dialog_add_indicator (IndicatorDialog *dialog,
 GdkPixbuf   *pixbuf,
 const gchar *name,
+const gchar *pretty_name,
 gboolean hidden,
 gboolean visible)
 {
@@ -114,10 +133,11 @@ indicator_dialog_add_indicator (IndicatorDialog *dialog,
   /* insert in the store */
   gtk_list_store_append (GTK_LIST_STORE (dialog->store), &iter);
   gtk_list_store_set (GTK_LIST_STORE (dialog->store), &iter,
-  COLUMN_PIXBUF, pixbuf,
-  COLUMN_TITLE, name,
-  COLUMN_HIDDEN, hidden,
+  COLUMN_PIXBUF,  pixbuf,
+  COLUMN_TITLE,   (pretty_name != NULL) ? pretty_name : 
name,
+  COLUMN_HIDDEN,  hidden,
   COLUMN_VISIBLE, visible,
+  COLUMN_TIP, name,
   -1);
 }
 
@@ -128,6 +148,10 @@ indicator_dialog_update_indicator_names (IndicatorDialog 
*dialog)
 {
   GList*li;
   const gchar  *name;
+  const gchar  *pretty_name = NULL;
+  const gchar  *icon_name = NULL;
+  GdkPixbuf*pixbuf = NULL;
+  guint i;
 
   g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
   g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (dialog->config));
@@ -136,13 +160,35 @@ indicator_dialog_update_indicator_names (IndicatorDialog 
*dialog)
   for(li = indicator_config_get_known_indicators (dialog->config); li != NULL; 
li = li->next)
 {
   name = li->data;
+
+  /* check if we have a better name for the application */
+  for (i = 0; i < G_N_ELEMENTS (pretty_names); i++)
+{
+  if (strcmp (name, pretty_names[i][0]) == 0)
+{
+  pretty_name = pretty_names[i][1];
+  icon_name = pretty_names[i][2];
+  break;
+}
+}
+
+  /* try to load the icon name */
+  if (icon_name != NULL)
+pixbuf = xfce_panel_pixbuf_from_source (icon_name, NULL, ICON_SIZE);
+  else
+pixbuf = NULL;
+
+  /* insert indicator in the store */
   indicator_dialog_add_indicator
 (dialog,
- NULL,
+ pixbuf,
  name,
+ pretty_name,
  indicator_config_is_blac

[Xfce4-commits] Force a configuration-changed signal at start-up.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 81c78516eec9103da0ba00c79ab2d936a91b6c99 (commit)
   from 346cfe1ab16173fc0c5fe13a23c144a94f99239e (commit)

commit 81c78516eec9103da0ba00c79ab2d936a91b6c99
Author: Andrzej 
Date:   Thu Mar 14 00:44:46 2013 +

Force a configuration-changed signal at start-up.

 panel-plugin/indicator-config.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index 09dbb96..c4bcf16 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -773,6 +773,8 @@ indicator_config_new (const gchar *property_base)
   property = g_strconcat (property_base, "/known-indicators", NULL);
   xfconf_g_property_bind (channel, property, 
XFCE_TYPE_INDICATOR_CONFIG_VALUE_ARRAY, config, "known-indicators");
   g_free (property);
+
+  g_signal_emit (G_OBJECT (config), 
indicator_config_signals[CONFIGURATION_CHANGED], 0);
 }
 
   return config;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Using 22px icon size by default.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 8c1c94439f5f7ba5e91f9c63ea7307c885de092c (commit)
   from dd4f96d9db59a24ad421fc13e8c633a384ce92a4 (commit)

commit 8c1c94439f5f7ba5e91f9c63ea7307c885de092c
Author: Andrzej 
Date:   Fri Mar 22 00:36:35 2013 +

Using 22px icon size by default.

This is the size of icons most (all?) indicators provide.

 panel-plugin/indicator-button.c |2 +-
 panel-plugin/indicator-config.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 0508674..8b269a6 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -465,7 +465,7 @@ xfce_indicator_button_get_icon_size (XfceIndicatorButton 
*button)
   gint border_thickness;
   GtkStyle*style;
 
-  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 24);
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 22);
 
   indicator_size = xfce_indicator_button_get_size (button);
 
diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index c4bcf16..d5f5cda 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -45,7 +45,7 @@
 
 
 
-#define DEFAULT_ICON_SIZE_MAX  24
+#define DEFAULT_ICON_SIZE_MAX  22
 #define DEFAULT_ALIGN_LEFT FALSE
 #define DEFAULT_EXCLUDED_MODULES   NULL
 #define DEFAULT_ORIENTATIONGTK_ORIENTATION_HORIZONTAL
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed crash on Xfce 4.8 (no xfce_dialog_show_help)

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to bc0abf05233f99011c77d4d6dd27943059be37bd (commit)
   from 8eb305349bff65313d8300defa8918675cc38bf6 (commit)

commit bc0abf05233f99011c77d4d6dd27943059be37bd
Author: Andrzej 
Date:   Fri Mar 22 00:30:15 2013 +

Fixed crash on Xfce 4.8 (no xfce_dialog_show_help)

Online help doesn't seem to work anyway (no page on docs.xfce.org for
non-core plugins), so for now have reverted to
goodies.xfce.org.

 panel-plugin/indicator-dialog.c |   75 +--
 1 files changed, 56 insertions(+), 19 deletions(-)

diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index 7422231..39280b5 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -41,6 +41,13 @@
 #include "indicator-dialog.h"
 #include "indicator-dialog_ui.h"
 
+#define PLUGIN_WEBSITE  
"http://goodies.xfce.org/projects/panel-plugins/xfce4-indicator-plugin";
+
+#ifdef LIBXFCE4UI_CHECK_VERSION
+#if LIBXFCE4UI_CHECK_VERSION (4,9,0)
+#define HAS_ONLINE_HELP
+#endif
+#endif
 
 
 /* known indicator names */
@@ -60,10 +67,12 @@ static const gchar *pretty_names[][3] =
 
 #define ICON_SIZE (22)
 
-static void  indicator_dialog_build   (IndicatorDialog 
 *dialog);
-static void  indicator_dialog_response(GtkWidget   
 *window,
-   gint
  response_id,
-   IndicatorDialog 
 *dialog);
+static void  indicator_dialog_build  
(IndicatorDialog  *dialog);
+static void  indicator_dialog_close_button_clicked   
(IndicatorDialog  *dialog,
+  GtkWidget
*button);
+
+static void  indicator_dialog_help_button_clicked
(IndicatorDialog  *dialog,
+  GtkWidget
*button);
 
 
 
@@ -454,8 +463,18 @@ indicator_dialog_build (IndicatorDialog *dialog)
 
   dialog->dialog = gtk_builder_get_object (builder, "dialog");
   g_return_if_fail (XFCE_IS_TITLED_DIALOG (dialog->dialog));
-  g_signal_connect (G_OBJECT (dialog->dialog), "response",
-G_CALLBACK (indicator_dialog_response), dialog);
+
+  object = gtk_builder_get_object (builder, "close-button");
+  g_return_if_fail (GTK_IS_BUTTON (object));
+  g_signal_connect_swapped (G_OBJECT (object), "clicked",
+G_CALLBACK 
(indicator_dialog_close_button_clicked),
+dialog);
+
+  object = gtk_builder_get_object (builder, "help-button");
+  g_return_if_fail (GTK_IS_BUTTON (object));
+  g_signal_connect_swapped (G_OBJECT (object), "clicked",
+G_CALLBACK 
(indicator_dialog_help_button_clicked),
+dialog);
 
   object = gtk_builder_get_object (builder, "size-max");
   g_return_if_fail (GTK_IS_WIDGET (object));
@@ -518,23 +537,41 @@ indicator_dialog_build (IndicatorDialog *dialog)
 
 
 static void
-indicator_dialog_response (GtkWidget*window,
-   gint  response_id,
-   IndicatorDialog  *dialog)
+indicator_dialog_close_button_clicked (IndicatorDialog *dialog,
+   GtkWidget   *button)
 {
-  g_return_if_fail (GTK_IS_DIALOG (window));
   g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
+  g_return_if_fail (GTK_IS_BUTTON (button));
+  g_return_if_fail (GTK_IS_WINDOW (dialog->dialog));
 
-  if (response_id == GTK_RESPONSE_HELP)
-{
-  xfce_dialog_show_help (GTK_WINDOW (window), "xfce4-indicator", "dialog", 
NULL);
-}
-  else
-{
-  gtk_widget_destroy (window);
+  gtk_widget_destroy (GTK_WIDGET (dialog->dialog));
+  g_object_unref (G_OBJECT (dialog));
+}
 
-  g_object_unref (G_OBJECT (dialog));
-}
+
+static void
+indicator_dialog_help_button_clicked (IndicatorDialog *dialog,
+  GtkWidget   *button)
+{
+  //#ifndef HAS_ONLINE_HELP
+  gboolean result;
+  //#endif
+
+  g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
+  g_return_if_fail (GTK_IS_BUTTON (button));
+  g_return_if_fail (GTK_IS_WINDOW (dialog->dialog));
+
+  /* Doesn't seem to work */
+  //#ifdef HAS_ONLINE_HELP
+  //xfce_dialog_show_help (GTK_WINDOW (dialog->dialog), "xfce4-indicator", 
"dialog", NULL);
+  //#else
+
+  result = g_spawn_command_line_async ("exo-open --launch WebBrowser " 
PLUGIN_WEBSITE, NULL);
+
+  if (G_UNLIK

[Xfce4-commits] Added an About dialog.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to dd4f96d9db59a24ad421fc13e8c633a384ce92a4 (commit)
   from bc0abf05233f99011c77d4d6dd27943059be37bd (commit)

commit dd4f96d9db59a24ad421fc13e8c633a384ce92a4
Author: Andrzej 
Date:   Fri Mar 22 00:31:56 2013 +

Added an About dialog.

 panel-plugin/indicator.c |   32 
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index d5d56f8..26d0ebb 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -53,6 +53,7 @@ static void indicator_construct   
 (XfcePanelPlu
 static void indicator_free 
(XfcePanelPlugin   *plugin);
 static gboolean load_module(const 
gchar   *name,
 
IndicatorPlugin   *indicator);
+static void indicator_show_about   
(XfcePanelPlugin   *plugin);
 static void indicator_configure_plugin 
(XfcePanelPlugin   *plugin);
 static gboolean indicator_size_changed 
(XfcePanelPlugin   *plugin,
 gint   
size);
@@ -99,6 +100,7 @@ indicator_class_init (IndicatorPluginClass *klass)
   plugin_class->construct = indicator_construct;
   plugin_class->free_data = indicator_free;
   plugin_class->size_changed = indicator_size_changed;
+  plugin_class->about = indicator_show_about;
   plugin_class->configure_plugin = indicator_configure_plugin;
 #ifdef HAS_PANEL_49
   plugin_class->mode_changed = indicator_mode_changed;
@@ -135,6 +137,35 @@ indicator_free (XfcePanelPlugin *plugin)
 
 
 static void
+indicator_show_about (XfcePanelPlugin *plugin)
+{
+   GdkPixbuf *icon;
+
+   const gchar *auth[] = {
+ "Mark Trompell ", "Andrzej Radecki 
",
+ "Lionel Le Folgoc ", "Jason Conti 
",
+ "Nick Schermer ", "Evgeni Golov ", NULL 
};
+
+   g_return_if_fail (XFCE_IS_INDICATOR_PLUGIN (plugin));
+
+   icon = xfce_panel_pixbuf_from_source("xfce4-indicator-plugin", NULL, 32);
+   gtk_show_about_dialog(NULL,
+ "logo", icon,
+ "license", xfce_get_license_text 
(XFCE_LICENSE_TEXT_GPL),
+ "version", PACKAGE_VERSION,
+ "program-name", PACKAGE_NAME,
+ "comments", _("An indicator of something that needs 
your attention on the desktop"),
+ "website", 
"http://goodies.xfce.org/projects/panel-plugins/xfce4-indicator-plugin";,
+ "copyright", _("Copyright (c) 2009-2013\n"),
+ "authors", auth, NULL);
+
+   if(icon)
+ g_object_unref(G_OBJECT(icon));
+}
+
+
+
+static void
 indicator_configure_plugin (XfcePanelPlugin *plugin)
 {
   IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
@@ -202,6 +233,7 @@ indicator_construct (XfcePanelPlugin *plugin)
   GtkWidget*label;
 
   xfce_panel_plugin_menu_show_configure (plugin);
+  xfce_panel_plugin_menu_show_about (plugin);
 
   /* setup transation domain */
   xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] indicator-button: minor fix to gtk_menu_popup call

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 985d34925075ffd8ea020cec1fd2e849d47aff83 (commit)
   from 23dfad6c95ba2502b2c5d6b0c26722c3e09ff59e (commit)

commit 985d34925075ffd8ea020cec1fd2e849d47aff83
Author: Andrzej 
Date:   Tue Apr 2 20:17:03 2013 +0100

indicator-button: minor fix to gtk_menu_popup call

Getting time from the event structure rather than from
gtk_get_current_event_time(). It does not solve menu flicker
issues present in some indicators (appmenu, qt-sni etc), though.
They seem to originate from the indicator itself.

 panel-plugin/indicator-button.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 8b269a6..74ed022 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -579,9 +579,8 @@ xfce_indicator_button_button_press (GtkWidget  *widget,
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),TRUE);
   gtk_menu_reposition (GTK_MENU (button->menu));
   gtk_menu_popup (button->menu, NULL, NULL,
-  xfce_panel_plugin_position_menu,
-  button->plugin,
-  1, gtk_get_current_event_time ());
+  xfce_panel_plugin_position_menu, button->plugin,
+  event->button, event->time);
   return TRUE;
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Reworked indicator entry sorting

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 23dfad6c95ba2502b2c5d6b0c26722c3e09ff59e (commit)
   from 8c1c94439f5f7ba5e91f9c63ea7307c885de092c (commit)

commit 23dfad6c95ba2502b2c5d6b0c26722c3e09ff59e
Author: Andrzej 
Date:   Fri Mar 22 01:37:16 2013 +

Reworked indicator entry sorting

Special case for libapplication.so, where entries have non-unique
location fields. Sorting them by name (at least the order is same
every time the panel is started).

 panel-plugin/indicator-box.c |   31 +--
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index c39435e..4c9ae90 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -170,21 +170,38 @@ xfce_indicator_box_sort_buttons (gconstpointer a,
   XfceIndicatorButton *a0 = XFCE_INDICATOR_BUTTON (a);
   XfceIndicatorButton *b0 = XFCE_INDICATOR_BUTTON (b);
   guinta1, b1;
+  const gchar *a_io;
+  gint result = 0;
 
   a1 = xfce_indicator_button_get_pos (a0);
   b1 = xfce_indicator_button_get_pos (b0);
 
+  /* only need one */
+  a_io = xfce_indicator_button_get_io_name (a0);
+
+  // printf ("=== %s, %s; %s, %s; %d, %d", xfce_indicator_button_get_io_name 
(a0), xfce_indicator_button_get_io_name (b0), xfce_indicator_button_get_entry 
(a0)->name_hint, xfce_indicator_button_get_entry (b0)->name_hint, a1, b1);
+
+  /* special case for Application indicators (unreliable ordering) */
+  /* always compare by name and ignore location field */
+  if (a_io != NULL && g_strcmp0 (a_io, "libapplication.so") == 0)
+result = g_strcmp0 (xfce_indicator_button_get_entry(a0)->name_hint,
+xfce_indicator_button_get_entry(b0)->name_hint);
+
   /* group all entries with location==0 at the beginning of the list
* but don't sort them (they may depend on insertion order) */
 
+  if (result == 0 && (a1 != 0 || b1 != 0))
+result = a1-b1;
+
   /* if there are two entries with the same non-zero location
* try to resolve their order by their name_hint */
-  if (a1 != 0 && a1 == b1)
-return -g_strcmp0 (xfce_indicator_button_get_entry(a0)->name_hint,
-   xfce_indicator_button_get_entry(b0)->name_hint);
 
-  /* else, use the location field */
-  return (a1-b1);
+  if (result == 0)
+result =  g_strcmp0 (xfce_indicator_button_get_entry(a0)->name_hint,
+ xfce_indicator_button_get_entry(b0)->name_hint);
+
+  // printf (" -> %d\n", result);
+  return result;
 }
 
 
@@ -204,7 +221,9 @@ xfce_indicator_box_add (GtkContainer *container,
 
   io_name = xfce_indicator_button_get_io_name (button);
   li = g_hash_table_lookup (box->children, io_name);
-  if (xfce_indicator_button_get_pos (button) == 0)
+  // printf ("   +++ %s %s\n", io_name, xfce_indicator_button_get_entry 
(button)->name_hint);
+  if (g_strcmp0 (io_name, "libapplication.so") != 0 &&
+  xfce_indicator_button_get_pos (button) == 0)
 li = g_list_append (li, button);
   else
 li = g_list_insert_sorted (li, button, xfce_indicator_box_sort_buttons);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Fixed #9040.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to f60f6d59702faef79cb3c346002395cbd0696c86 (commit)
   from 985d34925075ffd8ea020cec1fd2e849d47aff83 (commit)

commit f60f6d59702faef79cb3c346002395cbd0696c86
Author: Andrzej 
Date:   Wed Apr 3 01:46:26 2013 +0100

Fixed #9040.

This required getting replacing XfcePanelImage with GtkImage. The former
does not work reliably with non-square icons and added automatization
is not needed in this case.

Only horizontal non-square icons are supported (vertical will be squeezed
into a square shape). Non-square icons are rendered in a single row
(like indicators with labels).

 panel-plugin/indicator-box.c|   16 +
 panel-plugin/indicator-button.c |   63 ++
 panel-plugin/indicator-button.h |2 +
 3 files changed, 54 insertions(+), 27 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 4c9ae90..c181009 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -336,7 +336,7 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
   gint row;
   gint nrows;
   gint x;
-  gboolean has_label;
+  gboolean has_label, rectangular_icon;
   GtkOrientation   panel_orientation;
 
   panel_size = indicator_config_get_panel_size (box->config);
@@ -359,9 +359,10 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
 
   gtk_widget_size_request (GTK_WIDGET (button), &child_req);
   has_label = (xfce_indicator_button_get_label (button) != NULL);
+  rectangular_icon = xfce_indicator_button_is_icon_rectangular 
(button);
 
   /* wrap rows if column is overflowing or a label is encountered */
-  if (row > 0 && (has_label || row >= nrows))
+  if (row > 0 && (has_label || row >= nrows || rectangular_icon))
 {
   x += length;
   row = 0;
@@ -371,7 +372,7 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
   length =
 MAX (length, (panel_orientation == GTK_ORIENTATION_HORIZONTAL) ? 
child_req.width :child_req.height);
 
-  if (has_label || row >= nrows)
+  if (has_label || row >= nrows || rectangular_icon)
 {
   x += length;
   row = 0;
@@ -416,7 +417,7 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   gint length, width;
   gint row;
   gint nrows;
-  gboolean has_label;
+  gboolean has_label, rectangular_icon;
   GtkOrientation   panel_orientation;
 
   row = 0;
@@ -445,9 +446,10 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   gtk_widget_get_child_requisition (GTK_WIDGET (button), &child_req);
 
   has_label = (xfce_indicator_button_get_label (button) != NULL);
+  rectangular_icon = xfce_indicator_button_is_icon_rectangular 
(button);
 
   /* wrap rows if column is overflowing or a label is encountered */
-  if (row > 0 && (has_label || row >= nrows))
+  if (row > 0 && (has_label || row >= nrows || rectangular_icon))
 {
   x += length;
   y = 0;
@@ -455,7 +457,7 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   length = 0;
 }
 
-  width = (has_label) ? panel_size : size;
+  width = (has_label || rectangular_icon) ? panel_size : size;
   length = MAX (length,
 (panel_orientation == GTK_ORIENTATION_HORIZONTAL) ? 
child_req.width :child_req.height);
 
@@ -479,7 +481,7 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
 
   gtk_widget_size_allocate (GTK_WIDGET (button), &child_alloc);
 
-  if (has_label || row >= nrows)
+  if (has_label || row >= nrows || rectangular_icon)
 {
   x += length;
   y = 0;
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 74ed022..25a3572 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -67,6 +67,7 @@ struct _XfceIndicatorButton
   GtkWidget*label;
   GtkWidget*icon;
   GtkWidget*orig_icon;
+  gboolean  rectangular_icon;
 
   gulongorig_icon_changed_id;
   gulongconfiguration_changed_id;
@@ -119,6 +120,7 @@ xfce_indicator_button_init (XfceIndicatorButton *button)
   button->icon = NULL;
   button->orig_icon_changed_id = 0;
   button->configuration_changed_id = 0;
+  button->rectangular_icon = FALSE;
 
   button->align_box = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
   gtk_container_add (GTK_CONTAINER (button), button->align_box);
@@ -214,8 +216,6 @@ xfce_indicator_b

[Xfce4-commits] button: Compilation fix.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to a7ae93ad809b386634f84e11c6ef1bea0eb3b6ca (commit)
   from 305bd32976b88219e2432154c8500877283eb7ac (commit)

commit a7ae93ad809b386634f84e11c6ef1bea0eb3b6ca
Author: Andrzej 
Date:   Fri Apr 5 01:00:00 2013 +0100

button: Compilation fix.

There is no 'orientation' field in IndicatorButton. The label orientation
is set in the following _update_layout() call.

 panel-plugin/indicator-button.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index b24606a..25a3572 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -307,8 +307,6 @@ xfce_indicator_button_set_label (XfceIndicatorButton 
*button,
 
   button->label = GTK_WIDGET (label);
   g_object_ref (G_OBJECT (button->label));
-  gtk_label_set_angle (GTK_LABEL (button->label),
-   (button->orientation == GTK_ORIENTATION_VERTICAL) ? 
-90 : 0);
   gtk_box_pack_end (GTK_BOX (button->box), button->label, TRUE, FALSE, 1);
   g_signal_connect(G_OBJECT(button->label), "notify::label", 
G_CALLBACK(xfce_indicator_button_label_changed), button);
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Updated list of files for translation

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 7f332e0fcedb818a5adfa497dcba1a3ffb272d8e (commit)
   from a7ae93ad809b386634f84e11c6ef1bea0eb3b6ca (commit)

commit 7f332e0fcedb818a5adfa497dcba1a3ffb272d8e
Author: Andrzej 
Date:   Fri Apr 5 01:12:20 2013 +0100

Updated list of files for translation

 po/POTFILES.in |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 24ff214..b800280 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,2 +1,7 @@
+panel-plugin/indicator.desktop.in
 panel-plugin/indicator.c
-panel-plugin/indicator.desktop.in.in
+panel-plugin/indicator-box.c
+panel-plugin/indicator-button.c
+panel-plugin/indicator-config.c
+panel-plugin/indicator-dialog.c
+panel-plugin/indicator-dialog.glade
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Creating branch andrzejr/gtk3

2013-04-06 Thread Andrzej
Updating branch refs/heads/andrzejr/gtk3
 as new branch
 to 72a3de8c1c84b89a242519e87de6f597dc5a93d3 (commit)

Branches are created implicitly by pushing. This mail only exists to 
let you know that there was code pushed to 

  refs/heads/andrzejr/gtk3

for the first time. Mails for the commits that lead to the creation 
of the branch will follow after this mail.
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Initial port to gtk3

2013-04-06 Thread Andrzej
Updating branch refs/heads/andrzejr/gtk3
 to 72a3de8c1c84b89a242519e87de6f597dc5a93d3 (commit)
   from c47509d7c9394329ee3dad48ef8e93751be61b67 (commit)

commit 72a3de8c1c84b89a242519e87de6f597dc5a93d3
Author: Andrzej 
Date:   Sun Apr 7 01:15:10 2013 +0100

Initial port to gtk3

Doesn't work yet - needs a modified gtk2 xfce4-panel that loads wrapper3
on demand.

 configure.in.in   |   13 +-
 panel-plugin/Makefile.am  |2 -
 panel-plugin/indicator-box.c  |   46 +
 panel-plugin/indicator-button.c   |6 +++-
 panel-plugin/indicator-config.c   |   37 -
 panel-plugin/indicator-dialog.c   |   14 +-
 panel-plugin/indicator.desktop.in |1 +
 7 files changed, 85 insertions(+), 34 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index fd7258c..6ac22dd 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -72,13 +72,14 @@ XDT_CHECK_LIBX11_REQUIRE()
 dnl ***
 dnl *** Check for required packages ***
 dnl ***
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
-XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.2])
-XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.2])
+XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.6.0])
+dnl XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.9.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.9.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-2.0], [4.10.0])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
-XDT_CHECK_PACKAGE([INDICATOR], [indicator], [0.3.0], 
[indicator_pkgname=indicator], [XDT_CHECK_PACKAGE([INDICATOR], [indicator-0.4], 
[0.3.90], [indicator_pkgname=indicator-0.4], [])])
+dnl XDT_CHECK_PACKAGE([INDICATOR], [indicator3], [0.4.0], 
[indicator_pkgname=indicator], [XDT_CHECK_PACKAGE([INDICATOR], 
[indicator3-0.4], [0.3.90], [indicator_pkgname=indicator3-0.4], [])])
+XDT_CHECK_PACKAGE([INDICATOR], [indicator3-0.4], [0.4.0])
 
 dnl ***
 dnl *** Check for debugging support ***
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index fcec7f7..7eb6ac0 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -32,7 +32,6 @@ libindicator_plugin_la_SOURCES = \
 
 libindicator_plugin_la_CFLAGS = \
$(GTK_CFLAGS) \
-   $(EXO_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS)  \
$(LIBXFCE4UI_CFLAGS) \
$(LIBXFCE4PANEL_CFLAGS) \
@@ -52,7 +51,6 @@ libindicator_plugin_la_LDFLAGS = \
 
 libindicator_plugin_la_LIBADD = \
$(GTK_LIBS) \
-   $(EXO_LIBS) \
$(LIBXFCE4UTIL_LIBS)\
$(LIBXFCE4UI_LIBS) \
$(LIBXFCE4PANEL_LIBS)   \
diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index c181009..6e1332f 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -26,7 +26,7 @@
 
 #include 
 #include 
-#include 
+//#include 
 #include 
 #include 
 
@@ -47,6 +47,12 @@ static void xfce_indicator_box_forall
 (GtkContainer
 static GTypexfce_indicator_box_child_type (GtkContainer
 *container);
 static void xfce_indicator_box_size_request   (GtkWidget   
 *widget,
GtkRequisition  
 *requisition);
+static void xfce_indicator_box_get_preferred_width (GtkWidget  
 *widget,
+gint   
 *minimal_width,
+gint   
 *natural_width);
+static void xfce_indicator_box_get_preferred_height (GtkWidget 
  *widget,
+ gint  
  *minimal_height,
+ gint  
  *natural_height);
 static void xfce_indicator_box_size_allocate  (GtkWidget   
 *widget,
GtkAllocation   
 *allocation);
 
@@ -91,7 +97,9 @@ xfce_indicator_box_class_init (XfceIndicatorBoxClass *klass)
   gobject_class->finalize = xfce_indicator_box_finalize;
 
   gtkwidget_class = GTK_WIDGET_CLASS (klass);
-  gtkwidget_class->size_request = xfce_indicator_box_size_request;
+  //gtkwidget_class->size_request = xfce_indicator_box_size_request;
+  gtkwidget_class->get_preferred_width = 
xfce_indicator_box_get_preferred_width;
+  gtkwidget_class->get_preferred_height = 
xfce_indicator_box_get_preferred_height

[Xfce4-commits] Changes needed for the plugin not to crash at load time.

2013-04-07 Thread Andrzej
Updating branch refs/heads/andrzejr/gtk3
 to ed35886b41b7d1b7059822773ce423c3e3dbe962 (commit)
   from 72a3de8c1c84b89a242519e87de6f597dc5a93d3 (commit)

commit ed35886b41b7d1b7059822773ce423c3e3dbe962
Author: Andrzej 
Date:   Sun Apr 7 22:44:44 2013 +0100

Changes needed for the plugin not to crash at load time.

For some reason X-XFCE-Gtk3 has to be FALSE (an error in
the corresponding panel changes).

 panel-plugin/indicator-button.c   |3 ++-
 panel-plugin/indicator.desktop.in |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index dd11169..ca1458c 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -128,7 +128,8 @@ xfce_indicator_button_init (XfceIndicatorButton *button)
   gtk_container_add (GTK_CONTAINER (button), button->align_box);
   gtk_widget_show (button->align_box);
 
-  button->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 1);
+  //button->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 1);
+  button->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1);
   gtk_container_add (GTK_CONTAINER (button->align_box), button->box);
   gtk_widget_show (button->box);
 }
diff --git a/panel-plugin/indicator.desktop.in 
b/panel-plugin/indicator.desktop.in
index 5f722ab..aba66ee 100644
--- a/panel-plugin/indicator.desktop.in
+++ b/panel-plugin/indicator.desktop.in
@@ -6,4 +6,4 @@ _Comment=An indicator of something that needs your attention on 
the desktop
 Icon=xfce4-indicator-plugin
 X-XFCE-Module=indicator-plugin
 X-XFCE-Internal=FALSE
-X-XFCE-Gtk3=TRUE
+X-XFCE-Gtk3=FALSE
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Creating branch andrzejr/wrapper3

2013-04-07 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 as new branch
 to 55f09b17a823fa1c5828f43e321311ca7f5ba891 (commit)

Branches are created implicitly by pushing. This mail only exists to 
let you know that there was code pushed to 

  refs/heads/andrzejr/wrapper3

for the first time. Mails for the commits that lead to the creation 
of the branch will follow after this mail.
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] Loading external gtk3 panel plugins in gtk2 panel.

2013-04-07 Thread Andrzej
Updating branch refs/heads/andrzejr/wrapper3
 to 55f09b17a823fa1c5828f43e321311ca7f5ba891 (commit)
   from 0c1006f024404f69790b63965d8073660faadf50 (commit)

commit 55f09b17a823fa1c5828f43e321311ca7f5ba891
Author: Andrzej 
Date:   Sun Apr 7 22:49:33 2013 +0100

Loading external gtk3 panel plugins in gtk2 panel.

Requires a gtk3 version of libxfce4-panel and wrapper to be compiled
from another branch.

This commit is only a quick hack to make the plugins to load.
It should be reworked (starting from better naming) for a release
version.

 panel/panel-module.c  |   19 +--
 panel/panel-plugin-external-wrapper.c |8 +++-
 panel/panel-plugin-external-wrapper.h |1 +
 panel/panel-plugin-external.c |   18 ++
 panel/panel-plugin-external.h |1 +
 5 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/panel/panel-module.c b/panel/panel-module.c
index ba39320..6abd362 100644
--- a/panel/panel-module.c
+++ b/panel/panel-module.c
@@ -63,6 +63,7 @@ enum _PanelModuleRunMode
   UNKNOWN,/* Unset */
   INTERNAL,   /* plugin library will be loaded in the panel */
   WRAPPER,/* external library with comunication through 
PanelPluginExternal */
+  WRAPPER3,   /* external library with comunication through 
PanelPluginExternal */
   EXTERNAL_46 /* external executable with comunication through 
PanelPluginExternal46 */
 };
 
@@ -360,7 +361,16 @@ panel_module_new_from_desktop_file (const gchar *filename,
   /* run mode of the module, by default everything runs in
* the wrapper, unless defined otherwise */
   if (force_external || !xfce_rc_read_bool_entry (rc, 
"X-XFCE-Internal", FALSE))
-module->mode = WRAPPER;
+if (!xfce_rc_read_bool_entry (rc, "X-XFCE-Gtk3", TRUE))
+  {
+printf ("wrapper3 %s\n", path);
+module->mode = WRAPPER3;
+  }
+else
+  {
+printf ("wrapper %s\n", path);
+module->mode = WRAPPER;
+  }
   else
 module->mode = INTERNAL;
 }
@@ -481,8 +491,13 @@ panel_module_new_plugin (PanelModule  *module,
   /* fall-through (make wrapper plugin), probably a plugin with
* preinit_func which is not supported for internal plugins */
 
+case WRAPPER3:
+  plugin = panel_plugin_external_wrapper_new (module, unique_id, TRUE, 
arguments);
+  debug_type = "external-wrapper3";
+  break;
+
 case WRAPPER:
-  plugin = panel_plugin_external_wrapper_new (module, unique_id, 
arguments);
+  plugin = panel_plugin_external_wrapper_new (module, unique_id, FALSE, 
arguments);
   debug_type = "external-wrapper";
   break;
 
diff --git a/panel/panel-plugin-external-wrapper.c 
b/panel/panel-plugin-external-wrapper.c
index 06f6e63..89c5674 100644
--- a/panel/panel-plugin-external-wrapper.c
+++ b/panel/panel-plugin-external-wrapper.c
@@ -52,6 +52,7 @@
 
 
 #define WRAPPER_BIN HELPERDIR G_DIR_SEPARATOR_S "wrapper"
+#define WRAPPER3_BIN HELPERDIR G_DIR_SEPARATOR_S "wrapper3"
 
 
 
@@ -218,7 +219,10 @@ panel_plugin_external_wrapper_get_argv 
(PanelPluginExternal   *external,
 
   /* setup the basic argv */
   argv = g_new0 (gchar *, argc + 1);
-  argv[PLUGIN_ARGV_0] = g_strdup (WRAPPER_BIN);
+  if (external->is_gtk3)
+argv[PLUGIN_ARGV_0] = g_strdup (WRAPPER3_BIN);
+  else
+argv[PLUGIN_ARGV_0] = g_strdup (WRAPPER_BIN);
   argv[PLUGIN_ARGV_FILENAME] = g_strdup (panel_module_get_filename 
(external->module));
   argv[PLUGIN_ARGV_UNIQUE_ID] = g_strdup_printf ("%d", external->unique_id);;
   argv[PLUGIN_ARGV_SOCKET_ID] = g_strdup_printf ("%u", gtk_socket_get_id 
(GTK_SOCKET (external)));;
@@ -366,6 +370,7 @@ panel_plugin_external_wrapper_dbus_remote_event_result 
(PanelPluginExternalWrapp
 GtkWidget *
 panel_plugin_external_wrapper_new (PanelModule  *module,
gint  unique_id,
+   gboolean  is_gtk3,
gchar   **arguments)
 {
   panel_return_val_if_fail (PANEL_IS_MODULE (module), NULL);
@@ -374,5 +379,6 @@ panel_plugin_external_wrapper_new (PanelModule  *module,
   return g_object_new (PANEL_TYPE_PLUGIN_EXTERNAL_WRAPPER,
"module", module,
"unique-id", unique_id,
+   "is-gtk3", is_gtk3,
"arguments", arguments, NULL);
 }
diff --git a/panel/panel-plugin-external-wrapper.h 
b/panel/panel-plugin-external-wrapper.h
index eaa3ee9..e4bb1b2 100644
--- a/panel/panel-plugin-external-wrapper.h
+++ b/panel/panel-plugin-external-wrapper.h
@@ -40,6 +40,7 @@ GType  panel_plugin_external_wrapper_get_type (void) 
G_GN

[Xfce4-commits] Bugfix in icon/pixbuf resizing code.

2013-04-07 Thread Andrzej
Updating branch refs/heads/nick/gtk3
 to 65e9712bdd3f1f7013856ff8af0e311a57fa8d34 (commit)
   from 791ab4d9f75fe2916cfffeca225a7c52ef5290c6 (commit)

commit 65e9712bdd3f1f7013856ff8af0e311a57fa8d34
Author: Andrzej 
Date:   Wed Apr 3 22:33:51 2013 +0100

Bugfix in icon/pixbuf resizing code.

Icons were occasionally stretched to unnatural aspect ratio.
This could be observed e.g. in applications menu plugin in multi-row
panels and/or non-square icons.

 libxfce4panel/xfce-panel-convenience.c |   12 +---
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/libxfce4panel/xfce-panel-convenience.c 
b/libxfce4panel/xfce-panel-convenience.c
index a3f3be1..7902360 100644
--- a/libxfce4panel/xfce-panel-convenience.c
+++ b/libxfce4panel/xfce-panel-convenience.c
@@ -158,7 +158,7 @@ xfce_panel_pixbuf_from_source_at_size (const gchar  *source,
   gchar *name;
   gchar *filename;
   gint   src_w, src_h;
-  gdoublewratio, hratio;
+  gdoubleratio;
   GdkPixbuf *dest;
   GError*error = NULL;
   gint   size = MIN (dest_width, dest_height);
@@ -231,13 +231,11 @@ xfce_panel_pixbuf_from_source_at_size (const gchar  
*source,
   if (src_w > dest_width || src_h > dest_height)
 {
   /* calculate the new dimensions */
-  wratio = (gdouble) src_w / (gdouble) size;
-  hratio = (gdouble) src_h / (gdouble) size;
+  ratio = MIN ((gdouble) dest_width / (gdouble) src_w,
+   (gdouble) dest_height / (gdouble) src_h);
 
-  if (hratio > wratio)
-dest_width  = rint (src_w / hratio);
-  else
-dest_height = rint (src_h / wratio);
+  dest_width  = rint (src_w * ratio);
+  dest_height = rint (src_h * ratio);
 
   dest = gdk_pixbuf_scale_simple (pixbuf,
   MAX (dest_width, 1),
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ApplicationsMenu: Update the icon in the config dialog

2013-04-07 Thread Andrzej
Updating branch refs/heads/nick/gtk3
 to fb747e80da2bdc568354c8090ca0c9d05acace2c (commit)
   from 65e9712bdd3f1f7013856ff8af0e311a57fa8d34 (commit)

commit fb747e80da2bdc568354c8090ca0c9d05acace2c
Author: Andrzej 
Date:   Wed Apr 3 23:49:02 2013 +0100

ApplicationsMenu: Update the icon in the config dialog

...after closing the icon chooser.

 plugins/applicationsmenu/applicationsmenu.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/plugins/applicationsmenu/applicationsmenu.c 
b/plugins/applicationsmenu/applicationsmenu.c
index efe1c30..bf28607 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -579,6 +579,9 @@ applications_menu_plugin_configure_plugin_icon_chooser 
(GtkWidget  *
 {
   icon = exo_icon_chooser_dialog_get_icon (EXO_ICON_CHOOSER_DIALOG 
(chooser));
   g_object_set (G_OBJECT (plugin), "button-icon", icon, NULL);
+  xfce_panel_image_set_from_source (XFCE_PANEL_IMAGE (plugin->dialog_icon),
+exo_str_is_empty (plugin->button_icon) 
?
+DEFAULT_ICON_NAME : 
plugin->button_icon);
   g_free (icon);
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ApplicationsMenu: support for non-square icons and layout fixes

2013-04-07 Thread Andrzej
Updating branch refs/heads/nick/gtk3
 to 24d5634f2d13d1ff44dbbdf6dbf34d2ea27dd1ea (commit)
   from fb747e80da2bdc568354c8090ca0c9d05acace2c (commit)

commit 24d5634f2d13d1ff44dbbdf6dbf34d2ea27dd1ea
Author: Andrzej 
Date:   Wed Apr 3 23:58:19 2013 +0100

ApplicationsMenu: support for non-square icons and layout fixes

Switched to GtkImage for the button icon. It works better with non-square
icons. Slightly adjusted the button layout (spacing) to match other
plugins&HIG.

It might be a good idea to move contents of the _size_changed method to
a timeout event (loading icon etc.).

 plugins/applicationsmenu/applicationsmenu.c |   90 ---
 1 files changed, 41 insertions(+), 49 deletions(-)

diff --git a/plugins/applicationsmenu/applicationsmenu.c 
b/plugins/applicationsmenu/applicationsmenu.c
index bf28607..b86e438 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -237,11 +237,12 @@ applications_menu_plugin_init (ApplicationsMenuPlugin 
*plugin)
   g_signal_connect (G_OBJECT (plugin->button), "button-press-event",
   G_CALLBACK (applications_menu_plugin_menu), plugin);
 
-  plugin->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 1);
+  plugin->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2);
+  gtk_container_set_border_width (GTK_CONTAINER (plugin->box), 0);
   gtk_container_add (GTK_CONTAINER (plugin->button), plugin->box);
   gtk_widget_show (plugin->box);
 
-  plugin->icon = xfce_panel_image_new_from_source (DEFAULT_ICON_NAME);
+  plugin->icon = gtk_image_new ();
   gtk_box_pack_start (GTK_BOX (plugin->box), plugin->icon, FALSE, FALSE, 0);
   gtk_widget_show (plugin->icon);
 
@@ -360,8 +361,6 @@ applications_menu_plugin_set_property (GObject  *object,
 case PROP_BUTTON_ICON:
   g_free (plugin->button_icon);
   plugin->button_icon = g_value_dup_string (value);
-  xfce_panel_image_set_from_source (XFCE_PANEL_IMAGE (plugin->icon),
-  exo_str_is_empty (plugin->button_icon) ? DEFAULT_ICON_NAME : 
plugin->button_icon);
 
   force_a_resize = TRUE;
   break;
@@ -444,16 +443,17 @@ applications_menu_plugin_size_changed (XfcePanelPlugin 
*panel_plugin,
 {
   ApplicationsMenuPlugin *plugin = XFCE_APPLICATIONS_MENU_PLUGIN 
(panel_plugin);
   gintrow_size;
-  ginticon_size;
   GtkStyle   *style;
   XfcePanelPluginMode mode;
   GtkRequisition  label_size;
   GtkOrientation  orientation;
   gintborder_thickness;
-  gdouble icon_wh_ratio;
   GdkPixbuf  *icon;
-
-  row_size = size / xfce_panel_plugin_get_nrows (panel_plugin);
+  ginticon_width_max, icon_height_max;
+  ginticon_width = 0;
+  GdkScreen  *screen;
+  GtkIconTheme   *icon_theme = NULL;
+  gchar  *icon_name;
 
   gtk_box_set_child_packing (GTK_BOX (plugin->box), plugin->icon,
  !plugin->show_button_title,
@@ -467,50 +467,42 @@ applications_menu_plugin_size_changed (XfcePanelPlugin 
*panel_plugin,
   else
 orientation = GTK_ORIENTATION_VERTICAL;
 
-  if (!plugin->show_button_title)
+  row_size = size / xfce_panel_plugin_get_nrows (panel_plugin);
+  style = gtk_widget_get_style (plugin->button);
+  border_thickness = 2 * MAX (style->xthickness, style->ythickness) + 2;
+
+  /* arbitrary limit on non-square icon width in horizontal panel */
+  icon_width_max = (mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) ?
+6 * row_size - border_thickness :
+size - border_thickness;
+  icon_height_max = row_size - border_thickness;
+
+  screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
+  if (G_LIKELY (screen != NULL))
+icon_theme = gtk_icon_theme_get_for_screen (screen);
+
+  icon_name = exo_str_is_empty (plugin->button_icon) ?
+DEFAULT_ICON_NAME : plugin->button_icon;
+
+  icon = xfce_panel_pixbuf_from_source_at_size (icon_name,
+icon_theme,
+icon_width_max,
+icon_height_max);
+
+  if (G_LIKELY (icon != NULL))
 {
-  xfce_panel_image_set_size (XFCE_PANEL_IMAGE (plugin->icon), -1);
-
-/* get scale of the icon for non-squared custom files */
-if (mode != XFCE_PANEL_PLUGIN_MODE_DESKBAR
-&& plugin->button_icon != NULL
-&& g_path_is_absolute (plugin->button_icon))
-  {
-icon = gdk_pixbuf_new_from_file (plugin->button_icon, NULL);
-if (G_LIKELY (icon != NULL))
-  {
-icon_wh_ratio = (gdouble) gdk_pixbuf_get_width (icon) / 
(gdouble) gdk_pixbuf_get_height (icon);
-g_o

[Xfce4-commits] Some exo fixes to make config settings work

2013-04-07 Thread Andrzej
Updating branch refs/heads/andrzejr/gtk3
 to 84ab84c4f70b6c011b225a72e7cce9dd426155c3 (commit)
   from ed35886b41b7d1b7059822773ce423c3e3dbe962 (commit)

commit 84ab84c4f70b6c011b225a72e7cce9dd426155c3
Author: Andrzej 
Date:   Sun Apr 7 23:52:11 2013 +0100

Some exo fixes to make config settings work

 panel-plugin/Makefile.am|2 +-
 panel-plugin/indicator-config.c |   18 ++
 panel-plugin/indicator-dialog.c |9 +
 3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 7eb6ac0..4229737 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -85,7 +85,7 @@ DISTCLEANFILES += \
$(libindicator_built_sources)
 
 indicator-dialog_ui.h: indicator-dialog.glade
-   $(AM_V_GEN) exo-csource --static --strip-comments --strip-content 
--name=indicator_dialog_ui $< >$@
+   $(AM_V_GEN) xdt-csource --static --strip-comments --strip-content 
--name=indicator_dialog_ui $< >$@
 endif
 
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index a560da4..06fb0a9 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -157,24 +157,21 @@ indicator_config_class_init (IndicatorConfigClass *klass)
   128,
   DEFAULT_ICON_SIZE_MAX,
   G_PARAM_READWRITE |
-  G_PARAM_STATIC_STRINGS |
-  G_PARAM_CONSTRUCT_ONLY));
+  G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (gobject_class,
PROP_ALIGN_LEFT,
g_param_spec_boolean ("align-left", NULL, 
NULL,
  DEFAULT_ALIGN_LEFT,
  G_PARAM_READWRITE |
- 
G_PARAM_STATIC_STRINGS |
- 
G_PARAM_CONSTRUCT_ONLY));
+ 
G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (gobject_class,
PROP_MODE_WHITELIST,
g_param_spec_boolean ("mode-whitelist", 
NULL, NULL,
  
DEFAULT_MODE_WHITELIST,
  G_PARAM_READWRITE |
- 
G_PARAM_STATIC_STRINGS |
- 
G_PARAM_CONSTRUCT_ONLY));
+ 
G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (gobject_class,
PROP_BLACKLIST,
@@ -182,8 +179,7 @@ indicator_config_class_init (IndicatorConfigClass *klass)
NULL, NULL,

XFCE_TYPE_INDICATOR_CONFIG_VALUE_ARRAY,
G_PARAM_READWRITE |
-   G_PARAM_STATIC_STRINGS |
-   
G_PARAM_CONSTRUCT_ONLY));
+   
G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (gobject_class,
PROP_WHITELIST,
@@ -191,8 +187,7 @@ indicator_config_class_init (IndicatorConfigClass *klass)
NULL, NULL,

XFCE_TYPE_INDICATOR_CONFIG_VALUE_ARRAY,
G_PARAM_READWRITE |
-   G_PARAM_STATIC_STRINGS |
-   
G_PARAM_CONSTRUCT_ONLY));
+   
G_PARAM_STATIC_STRINGS));
 
 
   g_object_class_install_property (gobject_class,
@@ -201,8 +196,7 @@ indicator_config_class_init (IndicatorConfigClass *klass)
NULL, NULL,

XFCE_TYPE_INDICATOR_CONFIG_VALUE_ARRAY,
G_PARAM_READWRITE |
-   G_PARAM_STATIC_STRINGS |
-   
G_PARAM_CONSTRUCT_ONLY));
+  

[Xfce4-commits] Making the plugin display indicator icons.

2013-04-08 Thread Andrzej
Updating branch refs/heads/andrzejr/gtk3
 to 8fa31fbcabbbdc2d7dd685fdc0a733bcc3402888 (commit)
   from 84ab84c4f70b6c011b225a72e7cce9dd426155c3 (commit)

commit 8fa31fbcabbbdc2d7dd685fdc0a733bcc3402888
Author: Andrzej 
Date:   Mon Apr 8 23:38:19 2013 +0100

Making the plugin display indicator icons.

 configure.in.in  |4 ++--
 panel-plugin/indicator-box.c |2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 6ac22dd..0582c31 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -78,8 +78,8 @@ XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.9.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.9.0])
 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-2.0], [4.10.0])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
-dnl XDT_CHECK_PACKAGE([INDICATOR], [indicator3], [0.4.0], 
[indicator_pkgname=indicator], [XDT_CHECK_PACKAGE([INDICATOR], 
[indicator3-0.4], [0.3.90], [indicator_pkgname=indicator3-0.4], [])])
-XDT_CHECK_PACKAGE([INDICATOR], [indicator3-0.4], [0.4.0])
+XDT_CHECK_PACKAGE([INDICATOR], [indicator3], [0.4.0], 
[indicator_pkgname=indicator], [XDT_CHECK_PACKAGE([INDICATOR], 
[indicator3-0.4], [0.3.90], [indicator_pkgname=indicator3-0.4], [])])
+dnl XDT_CHECK_PACKAGE([INDICATOR], [indicator3-0.4], [0.4.0])
 
 dnl ***
 dnl *** Check for debugging support ***
diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 6e1332f..6651d3c 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -463,6 +463,8 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   x0 = allocation->x;
   y0 = allocation->y;
 
+  gtk_widget_set_allocation (widget, allocation);
+
   panel_size = indicator_config_get_panel_size (box->config);
   panel_orientation = indicator_config_get_panel_orientation (box->config);
   nrows = panel_size / xfce_indicator_box_get_row_size (box);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


  1   2   3   4   5   >