[Goodies-commits] r1934 - in xfce4-notes-plugin/trunk: . panel-plugin

Mike Massonnet mmassonnet at xfce.org
Wed Aug 30 08:02:46 CEST 2006


Author: mmassonnet
Date: 2006-08-30 06:02:44 +0000 (Wed, 30 Aug 2006)
New Revision: 1934

Modified:
   xfce4-notes-plugin/trunk/ChangeLog
   xfce4-notes-plugin/trunk/panel-plugin/notes-window.c
   xfce4-notes-plugin/trunk/panel-plugin/notes.c
   xfce4-notes-plugin/trunk/panel-plugin/notes.h
Log:
	  Use a simple signal clicked instead of button-press-event for the panel
	  button.

Modified: xfce4-notes-plugin/trunk/ChangeLog
===================================================================
--- xfce4-notes-plugin/trunk/ChangeLog	2006-08-30 02:57:10 UTC (rev 1933)
+++ xfce4-notes-plugin/trunk/ChangeLog	2006-08-30 06:02:44 UTC (rev 1934)
@@ -10,6 +10,8 @@
 	  save_on_timeout_execute().
 	* panel-plugin/notes.{c,h}, panel-plugin/notes-window.c: Changed the
 	  panel toggled button against a classic panel button.
+	  Use a simple signal clicked instead of button-press-event for the panel
+	  button.
 
 2006-08-14  Mike Massonnet <mmassonnet at gmail.com>
 

Modified: xfce4-notes-plugin/trunk/panel-plugin/notes-window.c
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/notes-window.c	2006-08-30 02:57:10 UTC (rev 1933)
+++ xfce4-notes-plugin/trunk/panel-plugin/notes-window.c	2006-08-30 06:02:44 UTC (rev 1934)
@@ -34,6 +34,7 @@
 
 
 static void     note_page_load_data (XfcePanelPlugin *, NotePage *);
+static void     on_notes_close (GtkWidget *, NotesPlugin *);
 static gboolean on_note_delete ();
 static gboolean on_title_press (GtkWidget *, GdkEventButton *, GtkWindow *);
 static gboolean on_title_scroll (GtkWidget *, GdkEventScroll *, Note *);
@@ -177,8 +178,8 @@
 
     gtk_container_add (GTK_CONTAINER (note->close), image_close);
 
-    g_signal_connect (note->close, "button-press-event",
-                      G_CALLBACK (notes_button_pressed), notes);
+    g_signal_connect (note->close, "clicked",
+                      G_CALLBACK (on_notes_close), notes);
 
 
     /* Notebook */
@@ -297,6 +298,12 @@
       }
 }
 
+static void
+on_notes_close (GtkWidget *widget, NotesPlugin* notes)
+{
+    gtk_button_clicked (GTK_BUTTON (notes->button));
+}
+
 static gboolean
 on_note_delete ()
 {
@@ -348,7 +355,7 @@
     if (event->type == GDK_KEY_PRESS)
       {
         if (event->keyval == GDK_Escape)
-            notes_button_pressed (notes->plugin, NULL, notes);
+            gtk_button_clicked (GTK_BUTTON (notes->button));
         else if (event->state & GDK_CONTROL_MASK)
           {
             if (event->keyval == GDK_Page_Down)

Modified: xfce4-notes-plugin/trunk/panel-plugin/notes.c
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/notes.c	2006-08-30 02:57:10 UTC (rev 1933)
+++ xfce4-notes-plugin/trunk/panel-plugin/notes.c	2006-08-30 06:02:44 UTC (rev 1934)
@@ -43,6 +43,7 @@
 static void     notes_configure (XfcePanelPlugin *, NotesPlugin *);
 static gboolean notes_set_size (XfcePanelPlugin *, int size, NotesPlugin *);
 static void     notes_load_data (XfcePanelPlugin *, NotesPlugin *);
+static gboolean notes_button_clicked (XfcePanelPlugin *, NotesPlugin *);
 static void     on_options_response (GtkWidget *, int response, NotesPlugin *);
 
 
@@ -228,8 +229,8 @@
     g_signal_connect (plugin, "free-data",
                       G_CALLBACK (notes_free_data), notes);
 
-    g_signal_connect (notes->button, "button-press-event",
-                      G_CALLBACK (notes_button_pressed), notes);
+    g_signal_connect (notes->button, "clicked",
+                      G_CALLBACK (notes_button_clicked), notes);
 
     g_signal_connect (plugin, "save",
                       G_CALLBACK (notes_save), notes);
@@ -242,7 +243,7 @@
                       G_CALLBACK (notes_configure), notes);
 
     if (notes->options.show)
-        notes_button_pressed (notes->plugin, NULL, notes);
+        gtk_button_clicked (GTK_BUTTON (notes->button));
 }
 
 NotesPlugin *
@@ -321,11 +322,10 @@
       }
 }
 
-gboolean
-notes_button_pressed (XfcePanelPlugin *plugin, GdkEventButton *event,
-                      NotesPlugin *notes)
+static gboolean
+notes_button_clicked (XfcePanelPlugin *plugin, NotesPlugin *notes)
 {
-    DBG ("Notes Button Pressed");
+    DBG ("Notes Button Clicked");
 
     /* Show/hide the note */
     if (!GTK_WIDGET_VISIBLE (notes->note->window))

Modified: xfce4-notes-plugin/trunk/panel-plugin/notes.h
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/notes.h	2006-08-30 02:57:10 UTC (rev 1933)
+++ xfce4-notes-plugin/trunk/panel-plugin/notes.h	2006-08-30 06:02:44 UTC (rev 1934)
@@ -51,8 +51,6 @@
 NotesPlugin *   notes_new (XfcePanelPlugin *);
 Note *          note_new (NotesPlugin *);
 void            note_page_new (XfcePanelPlugin *, NotesPlugin *);
-gboolean        notes_button_pressed (XfcePanelPlugin *, GdkEventButton *,
-                                      NotesPlugin *);
 void            save_on_timeout (NotesPlugin *);
 
 #endif




More information about the Goodies-commits mailing list