2005-10-13 [colin] 1.9.15cvs43
authorColin Leroy <colin@colino.net>
Thu, 13 Oct 2005 19:36:30 +0000 (19:36 +0000)
committerColin Leroy <colin@colino.net>
Thu, 13 Oct 2005 19:36:30 +0000 (19:36 +0000)
* src/noticeview.c
* src/noticeview.h
Add hand cursor for hovering over icon

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/noticeview.c
src/noticeview.h

index fa76dfb809184f2bf3bdd070f17e72af4b89ed06..f0fe040ae728a35414cbc80745dd472ee39e0c23 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-13 [colin]     1.9.15cvs43
+
+       * src/noticeview.c
+       * src/noticeview.h
+               Add hand cursor for hovering over icon
+
 2005-10-13 [colin]     1.9.15cvs42
 
        * src/summaryview.c
index a460fcf3da2b7f96337d07b6746d0232e58385bc..12ee84f159d33dfa2359e597a1dd27c6e30adbee 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.179.2.78 -r 1.179.2.79 src/imap.c;  ) > 1.9.15cvs40.patchset
 ( cvs diff -u -r 1.382.2.183 -r 1.382.2.184 src/compose.c;  ) > 1.9.15cvs41.patchset
 ( cvs diff -u -r 1.395.2.136 -r 1.395.2.137 src/summaryview.c;  ) > 1.9.15cvs42.patchset
+( cvs diff -u -r 1.5.2.9 -r 1.5.2.10 src/noticeview.c;  cvs diff -u -r 1.3.8.4 -r 1.3.8.5 src/noticeview.h;  ) > 1.9.15cvs43.patchset
index 67c585eab9176a4ea1d04b43f6c66ed1b7b46299..5413182becaa61146bf4edeb32acf12317d0d999 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=15
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=42
+EXTRA_VERSION=43
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 502494fd2b80f85f2e5cd087ffa9e877950c0bed..21b3d9aab39bc94f5546bb83fdbb258849014ada 100644 (file)
@@ -49,6 +49,20 @@ static void noticeview_button_pressed        (GtkButton *button, NoticeView *noticeview
 static void noticeview_2ndbutton_pressed(GtkButton *button, NoticeView *noticeview);
 static gboolean noticeview_icon_pressed        (GtkWidget *widget, GdkEventButton *evt,
                                         NoticeView *noticeview);
+static gboolean noticeview_visi_notify(GtkWidget *widget,
+                                      GdkEventVisibility *event,
+                                      NoticeView *noticeview);
+static gboolean noticeview_motion_notify(GtkWidget *widget,
+                                      GdkEventMotion *event,
+                                      NoticeView *noticeview);
+static gboolean noticeview_leave_notify(GtkWidget *widget,
+                                     GdkEventCrossing *event,
+                                     NoticeView *textview);
+static gboolean noticeview_enter_notify(GtkWidget *widget,
+                                     GdkEventCrossing *event,
+                                     NoticeView *textview);
+
+static GdkCursor *hand_cursor = NULL;
 
 NoticeView *noticeview_create(MainWindow *mainwin)
 {
@@ -65,6 +79,9 @@ NoticeView *noticeview_create(MainWindow *mainwin)
        debug_print("Creating notice view...\n");
        noticeview = g_new0(NoticeView, 1);
 
+       if (!hand_cursor)
+               hand_cursor = gdk_cursor_new(GDK_HAND2);
+
        noticeview->window = mainwin->window;
        
        vbox = gtk_vbox_new(FALSE, 4);
@@ -86,6 +103,14 @@ NoticeView *noticeview_create(MainWindow *mainwin)
        g_signal_connect(G_OBJECT(evtbox), "button-press-event", 
                         G_CALLBACK(noticeview_icon_pressed),
                         (gpointer) noticeview);
+       g_signal_connect(G_OBJECT(evtbox), "visibility-notify-event",
+                        G_CALLBACK(noticeview_visi_notify), noticeview);
+       g_signal_connect(G_OBJECT(evtbox), "motion-notify-event",
+                        G_CALLBACK(noticeview_visi_notify), noticeview);
+       g_signal_connect(G_OBJECT(evtbox), "leave-notify-event",
+                        G_CALLBACK(noticeview_leave_notify), noticeview);
+       g_signal_connect(G_OBJECT(evtbox), "enter-notify-event",
+                        G_CALLBACK(noticeview_enter_notify), noticeview);
        
        gtk_container_add(GTK_CONTAINER(evtbox), icon);
        gtk_box_pack_start(GTK_BOX(hbox), evtbox, FALSE, TRUE, 0);
@@ -114,9 +139,9 @@ NoticeView *noticeview_create(MainWindow *mainwin)
        noticeview->icon   = icon;
        noticeview->text   = text;
        noticeview->button = widget;
-       noticeview->button2 = widget2;
-
-       noticeview->visible = TRUE;
+       noticeview->button2= widget2;
+       noticeview->evtbox = evtbox;
+       noticeview->visible= TRUE;
 
        return noticeview;
 }
@@ -195,6 +220,41 @@ static gboolean noticeview_icon_pressed(GtkWidget *widget, GdkEventButton *evt,
        return FALSE;
 }
 
+static gboolean noticeview_visi_notify(GtkWidget *widget,
+                                      GdkEventVisibility *event,
+                                      NoticeView *noticeview)
+{
+       if (noticeview->icon_clickable)
+               gdk_window_set_cursor(noticeview->evtbox->window, hand_cursor);
+       return FALSE;
+}
+
+static gboolean noticeview_motion_notify(GtkWidget *widget,
+                                      GdkEventMotion *event,
+                                      NoticeView *noticeview)
+{
+       if (noticeview->icon_clickable)
+               gdk_window_set_cursor(noticeview->evtbox->window, hand_cursor);
+       return FALSE;
+}
+
+static gboolean noticeview_leave_notify(GtkWidget *widget,
+                                     GdkEventCrossing *event,
+                                     NoticeView *noticeview)
+{
+       gdk_window_set_cursor(noticeview->evtbox->window, NULL);
+       return FALSE;
+}
+
+static gboolean noticeview_enter_notify(GtkWidget *widget,
+                                     GdkEventCrossing *event,
+                                     NoticeView *noticeview)
+{
+       if (noticeview->icon_clickable)
+               gdk_window_set_cursor(noticeview->evtbox->window, hand_cursor);
+       return FALSE;
+}
+
 void noticeview_set_2ndbutton_text(NoticeView *noticeview, const char *text)
 {
        g_return_if_fail(noticeview);
index 5c21e04b1a5b87ee3257d1c9310c528f2fe054a1..2535a39342f4e7dbe18e4b12b3eba48acd9a8cf9 100644 (file)
@@ -40,6 +40,7 @@ struct _NoticeView
        void            (*press) (NoticeView *, gpointer user_data);
        void            (*press2) (NoticeView *, gpointer user_data);
        gboolean         icon_clickable;
+       GtkWidget       *evtbox;
 };
 
 NoticeView     *noticeview_create      (MainWindow     *mainwin);