Author: nick
Date: 2007-09-03 06:44:15 +0000 (Mon, 03 Sep 2007)
New Revision: 26038
Modified:
xfce4-panel/trunk/plugins/systray/xfce-tray-dialogs.c
xfce4-panel/trunk/plugins/systray/xfce-tray-widget.c
Log:
* Increase the size and space of the properties dialog.
* Allow right-click on the arrow button to open the panel menu.
Modified: xfce4-panel/trunk/plugins/systray/xfce-tray-dialogs.c
===================================================================
--- xfce4-panel/trunk/plugins/systray/xfce-tray-dialogs.c 2007-09-02
11:47:54 UTC (rev 26037)
+++ xfce4-panel/trunk/plugins/systray/xfce-tray-dialogs.c 2007-09-03
06:44:15 UTC (rev 26038)
@@ -229,6 +229,7 @@
gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen
(GTK_WIDGET (plugin->panel_plugin)));
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dialog), "xfce4-settings");
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 250, 300);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK
(xfce_tray_dialogs_configure_response), plugin);
@@ -237,7 +238,7 @@
/* appearance */
frame = xfce_create_framebox (_("Appearance"), &bin);
gtk_box_pack_start (GTK_BOX (dialog_vbox), frame, FALSE, TRUE, 0);
- //gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
+ gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
gtk_widget_show (frame);
/* show frame */
@@ -250,7 +251,7 @@
/* applications */
frame = xfce_create_framebox (_("Hidden Applications"), &bin);
gtk_box_pack_start (GTK_BOX (dialog_vbox), frame, TRUE, TRUE, 0);
- //gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
+ gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
gtk_widget_show (frame);
/* scrolled window */
Modified: xfce4-panel/trunk/plugins/systray/xfce-tray-widget.c
===================================================================
--- xfce4-panel/trunk/plugins/systray/xfce-tray-widget.c 2007-09-02
11:47:54 UTC (rev 26037)
+++ xfce4-panel/trunk/plugins/systray/xfce-tray-widget.c 2007-09-03
06:44:15 UTC (rev 26038)
@@ -43,29 +43,32 @@
/* prototypes */
-static void xfce_tray_widget_class_init (XfceTrayWidgetClass *klass);
-static void xfce_tray_widget_init (XfceTrayWidget *tray);
-static void xfce_tray_widget_finalize (GObject *object);
-static void xfce_tray_widget_size_request (GtkWidget *widget,
- GtkRequisition
*requisition);
-static void xfce_tray_widget_size_allocate (GtkWidget *widget,
- GtkAllocation
*allocation);
-static void xfce_tray_widget_style_set (GtkWidget *widget,
- GtkStyle
*previous_style);
-static void xfce_tray_widget_map (GtkWidget *widget);
-static gint xfce_tray_widget_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-static void xfce_tray_widget_button_set_arrow (XfceTrayWidget *tray);
-static void xfce_tray_widget_button_clicked (GtkToggleButton *button,
- XfceTrayWidget *tray);
-static gint xfce_tray_widget_compare_function (gconstpointer a,
- gconstpointer b);
-static void xfce_tray_widget_icon_added (XfceTrayManager *manager,
- GtkWidget *icon,
- XfceTrayWidget *tray);
-static void xfce_tray_widget_icon_removed (XfceTrayManager *manager,
- GtkWidget *icon,
- XfceTrayWidget *tray);
+static void xfce_tray_widget_class_init (XfceTrayWidgetClass
*klass);
+static void xfce_tray_widget_init (XfceTrayWidget
*tray);
+static void xfce_tray_widget_finalize (GObject
*object);
+static void xfce_tray_widget_size_request (GtkWidget
*widget,
+ GtkRequisition
*requisition);
+static void xfce_tray_widget_size_allocate (GtkWidget
*widget,
+ GtkAllocation
*allocation);
+static void xfce_tray_widget_style_set (GtkWidget
*widget,
+ GtkStyle
*previous_style);
+static void xfce_tray_widget_map (GtkWidget
*widget);
+static gint xfce_tray_widget_expose_event (GtkWidget
*widget,
+ GdkEventExpose
*event);
+static void xfce_tray_widget_button_set_arrow (XfceTrayWidget
*tray);
+static void xfce_tray_widget_button_clicked (GtkToggleButton
*button,
+ XfceTrayWidget
*tray);
+static gboolean xfce_tray_widget_button_press_event (GtkWidget
*widget,
+ GdkEventButton
*event,
+ GtkWidget
*tray);
+static gint xfce_tray_widget_compare_function (gconstpointer a,
+ gconstpointer b);
+static void xfce_tray_widget_icon_added (XfceTrayManager
*manager,
+ GtkWidget *icon,
+ XfceTrayWidget
*tray);
+static void xfce_tray_widget_icon_removed (XfceTrayManager
*manager,
+ GtkWidget
*icon,
+ XfceTrayWidget
*tray);
@@ -92,7 +95,7 @@
guint n_hidden_childeren;
/* whether hidden icons are visible */
- guint all_visible : 1;
+ guint all_visible : 1;
/* reqested icon size */
guint req_child_size;
@@ -390,6 +393,7 @@
GTK_WIDGET_UNSET_FLAGS (tray->button, GTK_CAN_DEFAULT | GTK_CAN_FOCUS);
gtk_button_set_focus_on_click (GTK_BUTTON (tray->button), FALSE);
g_signal_connect (G_OBJECT (tray->button), "clicked", G_CALLBACK
(xfce_tray_widget_button_clicked), tray);
+ g_signal_connect (G_OBJECT (tray->button), "button-press-event",
G_CALLBACK (xfce_tray_widget_button_press_event), tray);
gtk_widget_set_parent (tray->button, widget);
gtk_widget_show (tray->button);
}
@@ -421,11 +425,11 @@
static void
xfce_tray_widget_button_clicked (GtkToggleButton *button,
- XfceTrayWidget *tray)
+ XfceTrayWidget *tray)
{
/* set the new visible state */
tray->all_visible = gtk_toggle_button_get_active (button);
-
+
/* set the button arrow */
xfce_tray_widget_button_set_arrow (tray);
@@ -435,6 +439,19 @@
+static gboolean
+xfce_tray_widget_button_press_event (GtkWidget *widget,
+ GdkEventButton *event,
+ GtkWidget *tray)
+{
+ /* send the event to the tray for poping up the menu */
+ gtk_widget_event (tray, (GdkEvent *)event);
+
+ return FALSE;
+}
+
+
+
static gint
xfce_tray_widget_compare_function (gconstpointer a,
gconstpointer b)
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits