[Goodies-commits] r3336 - xfce4-notes-plugin/trunk/panel-plugin
Mike Massonnet
mmassonnet at xfce.org
Wed Oct 10 23:59:16 CEST 2007
Author: mmassonnet
Date: 2007-10-10 21:59:16 +0000 (Wed, 10 Oct 2007)
New Revision: 3336
Modified:
xfce4-notes-plugin/trunk/panel-plugin/notes.c
xfce4-notes-plugin/trunk/panel-plugin/panel-plugin.c
Log:
* We don't need to look the state of the toggle button to popup the menu.
Modified: xfce4-notes-plugin/trunk/panel-plugin/notes.c
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/notes.c 2007-10-10 21:59:03 UTC (rev 3335)
+++ xfce4-notes-plugin/trunk/panel-plugin/notes.c 2007-10-10 21:59:16 UTC (rev 3336)
@@ -205,9 +205,7 @@
gtk_widget_show (notes_window->title);
/* Menu button */
- notes_window->btn_menu = xfce_create_panel_toggle_button ();//gtk_toggle_button_new ();
- //gtk_button_set_relief (GTK_BUTTON (notes_window->btn_menu), GTK_RELIEF_NONE);
- //GTK_WIDGET_UNSET_FLAGS (notes_window->btn_menu, GTK_CAN_FOCUS);
+ notes_window->btn_menu = xfce_create_panel_toggle_button ();
gtk_widget_set_size_request (notes_window->btn_menu, 22, 22);
arrow_menu = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
gtk_container_add (GTK_CONTAINER (notes_window->btn_menu),
@@ -599,9 +597,7 @@
notes_window_menu_popup (NotesWindow *notes_window,
GdkEvent *event)
{
- gboolean state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (notes_window->btn_menu));
-
- if (state == FALSE && event->type == GDK_BUTTON_PRESS && event->button.button == 1)
+ if (event->type == GDK_BUTTON_PRESS && event->button.button == 1)
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (notes_window->btn_menu), TRUE);
notes_window_menu_new (notes_window);
@@ -613,7 +609,6 @@
event->button.button,
event->button.time);
}
-
return FALSE;
}
Modified: xfce4-notes-plugin/trunk/panel-plugin/panel-plugin.c
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/panel-plugin.c 2007-10-10 21:59:03 UTC (rev 3335)
+++ xfce4-notes-plugin/trunk/panel-plugin/panel-plugin.c 2007-10-10 21:59:16 UTC (rev 3336)
@@ -235,14 +235,12 @@
notes_plugin_menu_popup (NotesPlugin *notes_plugin,
GdkEvent *event)
{
- gboolean state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (notes_plugin->btn_panel));
-
/**
* If GDK_CONTROL_MASK is set the panel displays its context menu
- * therefore *we* don't show anything.
+ * therefore we prefer to *not* popup our menu.
*/
- if (state == FALSE && event->type == GDK_BUTTON_PRESS
- && event->button.button == 1 && !(event->button.state & GDK_CONTROL_MASK))
+ if (event->type == GDK_BUTTON_PRESS &&
+ event->button.button == 1 && !(event->button.state & GDK_CONTROL_MASK))
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (notes_plugin->btn_panel), TRUE);
notes_plugin_menu_new (notes_plugin);
More information about the Goodies-commits
mailing list