[Xfce4-commits] <xfce4-weather-plugin:master> Scrollbox: Add function to switch to previous label.

Harald Judt noreply at xfce.org
Sat Dec 15 21:22:03 CET 2012


Updating branch refs/heads/master
         to 1cfa828ac72a587a3f4c0cb178f21438d6328c9f (commit)
       from 3803464536b63852b28dd581424e1c0c3167c108 (commit)

commit 1cfa828ac72a587a3f4c0cb178f21438d6328c9f
Author: Harald Judt <h.judt at gmx.at>
Date:   Fri Dec 14 19:46:16 2012 +0100

    Scrollbox: Add function to switch to previous label.
    
    This is the counterpart to gtk_scrollbox_next_label().

 panel-plugin/weather-scrollbox.c |   15 +++++++++++++++
 panel-plugin/weather-scrollbox.h |    2 ++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/weather-scrollbox.c b/panel-plugin/weather-scrollbox.c
index ba125a1..471dbf7 100644
--- a/panel-plugin/weather-scrollbox.c
+++ b/panel-plugin/weather-scrollbox.c
@@ -350,6 +350,21 @@ gtk_scrollbox_set_animate(GtkScrollbox *self,
 
 
 void
+gtk_scrollbox_prev_label(GtkScrollbox *self)
+{
+    g_return_if_fail(GTK_IS_SCROLLBOX(self));
+
+    if (g_list_length(self->labels) > 1) {
+        if (self->active->prev != NULL)
+            self->active = self->active->prev;
+        else
+            self->active = g_list_last(self->labels);
+        gtk_widget_queue_resize(GTK_WIDGET(self));
+    }
+}
+
+
+void
 gtk_scrollbox_next_label(GtkScrollbox *self)
 {
     g_return_if_fail(GTK_IS_SCROLLBOX(self));
diff --git a/panel-plugin/weather-scrollbox.h b/panel-plugin/weather-scrollbox.h
index fab9ba7..33791ff 100644
--- a/panel-plugin/weather-scrollbox.h
+++ b/panel-plugin/weather-scrollbox.h
@@ -72,6 +72,8 @@ void gtk_scrollbox_clear(GtkScrollbox *self);
 void gtk_scrollbox_set_animate(GtkScrollbox *self,
                                gboolean animate);
 
+void gtk_scrollbox_prev_label(GtkScrollbox *self);
+
 void gtk_scrollbox_next_label(GtkScrollbox *self);
 
 void gtk_scrollbox_set_fontname(GtkScrollbox *self,


More information about the Xfce4-commits mailing list