[Xfce4-commits] r24231 - in xfce4-panel/branches/4_5_nick: panel plugins/actions plugins/clock plugins/iconbox plugins/launcher plugins/pager plugins/separator plugins/systray plugins/tasklist plugins/windowlist
Nick Schermer
nick at xfce.org
Mon Jan 1 17:41:34 CET 2007
Author: nick
Date: 2007-01-01 16:41:33 +0000 (Mon, 01 Jan 2007)
New Revision: 24231
Modified:
xfce4-panel/branches/4_5_nick/panel/panel-dialogs.c
xfce4-panel/branches/4_5_nick/plugins/actions/actions.c
xfce4-panel/branches/4_5_nick/plugins/clock/clock.c
xfce4-panel/branches/4_5_nick/plugins/iconbox/iconbox.c
xfce4-panel/branches/4_5_nick/plugins/launcher/launcher-dialog.c
xfce4-panel/branches/4_5_nick/plugins/pager/pager.c
xfce4-panel/branches/4_5_nick/plugins/separator/separator.c
xfce4-panel/branches/4_5_nick/plugins/systray/systray.c
xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.c
xfce4-panel/branches/4_5_nick/plugins/windowlist/windowlist-dialog.c
Log:
* Backport fixes/changes from from trunk.
Modified: xfce4-panel/branches/4_5_nick/panel/panel-dialogs.c
===================================================================
--- xfce4-panel/branches/4_5_nick/panel/panel-dialogs.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/panel/panel-dialogs.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -1245,16 +1245,8 @@
if (mon == tb)
{
- XfceMonitor *xmon = panel_app_get_monitor(i);
gtk_toggle_button_set_active (mon, TRUE);
panel_set_monitor (pmd->panel, i);
- if (xmon->screen != gtk_widget_get_screen (pmd->dlg))
- {
- gtk_widget_hide (pmd->dlg);
- gtk_window_set_screen (GTK_WINDOW (pmd->dlg),
- xmon->screen);
- gtk_widget_show (pmd->dlg);
- }
}
else
{
Modified: xfce4-panel/branches/4_5_nick/plugins/actions/actions.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/actions/actions.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/plugins/actions/actions.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -5,7 +5,7 @@
* Copyright © 2005 Jasper Huijsmans <jasper at xfce.org>
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as published
+ * it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@@ -45,7 +45,7 @@
{
XfcePanelPlugin *plugin;
GtkTooltips *tips;
-
+
ActionType type;
GtkWidget *button1;
GtkWidget *image1;
@@ -73,13 +73,13 @@
/* Interface Implementation */
static void
-actions_orientation_changed (XfcePanelPlugin *plugin,
+actions_orientation_changed (XfcePanelPlugin *plugin,
GtkOrientation orientation,
Action *action)
{
if (action->type == ACTION_QUIT_LOCK)
{
- xfce_hvbox_set_orientation (XFCE_HVBOX (GTK_BIN (plugin)->child),
+ xfce_hvbox_set_orientation (XFCE_HVBOX (GTK_BIN (plugin)->child),
(orientation == GTK_ORIENTATION_HORIZONTAL) ?
GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL);
}
@@ -94,10 +94,10 @@
actions_load_icon (ActionType type, int size)
{
GdkPixbuf *pb = NULL;
-
+
/* first try name from icon nameing spec... */
pb = xfce_themed_icon_load (action_icon_names[type][1], size);
-
+
/* ...then try xfce name, if necessary */
if (!pb)
{
@@ -107,13 +107,13 @@
return pb;
}
-static gboolean
+static gboolean
actions_set_size (XfcePanelPlugin *plugin, int size, Action *action)
{
int width;
GdkPixbuf *pb = NULL;
int border;
-
+
if (xfce_panel_plugin_get_orientation (plugin) ==
GTK_ORIENTATION_HORIZONTAL)
{
@@ -123,7 +123,7 @@
{
border = 2 + 2 * GTK_WIDGET(plugin)->style->xthickness;
}
-
+
switch (action->type)
{
case ACTION_QUIT_LOCK:
@@ -131,11 +131,11 @@
pb = actions_load_icon (ACTION_LOCK, width);
gtk_image_set_from_pixbuf (GTK_IMAGE (action->image1), pb);
g_object_unref (G_OBJECT (pb));
-
+
pb = actions_load_icon (ACTION_QUIT, width);
gtk_image_set_from_pixbuf (GTK_IMAGE (action->image2), pb);
g_object_unref (G_OBJECT (pb));
-
+
break;
case ACTION_QUIT:
case ACTION_LOCK:
@@ -143,10 +143,10 @@
pb = actions_load_icon (action->type, width);
gtk_image_set_from_pixbuf (GTK_IMAGE (action->image1), pb);
g_object_unref (G_OBJECT (pb));
-
+
break;
}
-
+
return TRUE;
}
@@ -156,7 +156,7 @@
char *file;
XfceRc *rc;
int type = ACTION_QUIT;
-
+
if ((file = xfce_panel_plugin_lookup_rc_file (plugin)) != NULL)
{
rc = xfce_rc_simple_open (file, TRUE);
@@ -165,7 +165,7 @@
if (rc != NULL)
{
type = xfce_rc_read_int_entry (rc, "type", ACTION_QUIT);
-
+
xfce_rc_close (rc);
}
}
@@ -178,7 +178,7 @@
{
char *file;
XfceRc *rc;
-
+
if (!(file = xfce_panel_plugin_save_location (plugin, TRUE)))
return;
@@ -187,7 +187,7 @@
if (!rc)
return;
-
+
xfce_rc_write_int_entry (rc, "type", action->type);
xfce_rc_close (rc);
@@ -200,10 +200,10 @@
if (action->screen_id)
g_signal_handler_disconnect (plugin, action->screen_id);
-
+
if (action->style_id)
g_signal_handler_disconnect (plugin, action->style_id);
-
+
action->screen_id = action->style_id = 0;
dlg = g_object_get_data (G_OBJECT (plugin), "dialog");
@@ -234,15 +234,15 @@
{
GtkWidget *widget, *box, *button, *img;
GtkOrientation orientation;
-
+
widget = GTK_WIDGET (plugin);
switch (action->type)
{
case ACTION_QUIT_LOCK:
- orientation = (xfce_panel_plugin_get_orientation (plugin) ==
+ orientation = (xfce_panel_plugin_get_orientation (plugin) ==
GTK_ORIENTATION_HORIZONTAL) ?
- GTK_ORIENTATION_VERTICAL :
+ GTK_ORIENTATION_VERTICAL :
GTK_ORIENTATION_HORIZONTAL;
box = xfce_hvbox_new (orientation, TRUE, 0);
@@ -254,29 +254,29 @@
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
xfce_panel_plugin_add_action_widget (plugin, button);
-
- g_signal_connect (button, "clicked",
+
+ g_signal_connect (button, "clicked",
G_CALLBACK (actions_do_lock), plugin);
-
+
gtk_tooltips_set_tip (action->tips, action->button1, _("Lock screen"), NULL);
img = action->image1 = gtk_image_new ();
gtk_widget_show (img);
gtk_container_add (GTK_CONTAINER (button), img);
-
+
action->button2 = button = xfce_create_panel_button ();
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
xfce_panel_plugin_add_action_widget (plugin, button);
- g_signal_connect (button, "clicked",
+ g_signal_connect (button, "clicked",
G_CALLBACK (actions_do_quit), plugin);
-
+
img = action->image2 = gtk_image_new ();
gtk_widget_show (img);
gtk_container_add (GTK_CONTAINER (button), img);
-
+
gtk_tooltips_set_tip (action->tips, action->button2, _("Quit"), NULL);
break;
@@ -284,16 +284,16 @@
action->button1 = button = xfce_create_panel_button ();
gtk_widget_show (button);
gtk_container_add (GTK_CONTAINER (plugin), button);
-
+
xfce_panel_plugin_add_action_widget (plugin, button);
-
- g_signal_connect (button, "clicked",
+
+ g_signal_connect (button, "clicked",
G_CALLBACK (actions_do_lock), plugin);
-
+
img = action->image1 = gtk_image_new ();
gtk_widget_show (img);
gtk_container_add (GTK_CONTAINER (button), img);
-
+
gtk_tooltips_set_tip (action->tips, action->button1, _("Lock screen"), NULL);
break;
@@ -301,12 +301,12 @@
action->button1 = button = xfce_create_panel_button ();
gtk_widget_show (button);
gtk_container_add (GTK_CONTAINER (plugin), button);
-
+
xfce_panel_plugin_add_action_widget (plugin, button);
-
- g_signal_connect (button, "clicked",
+
+ g_signal_connect (button, "clicked",
G_CALLBACK (actions_do_quit), plugin);
-
+
img = action->image1 = gtk_image_new ();
gtk_widget_show (img);
gtk_container_add (GTK_CONTAINER (button), img);
@@ -322,7 +322,7 @@
actions_set_size (plugin, xfce_panel_plugin_get_size (plugin), action);
}
-static void
+static void
actions_construct (XfcePanelPlugin *plugin)
{
Action *action = panel_slice_new0 (Action);
@@ -330,33 +330,33 @@
action->plugin = plugin;
action->tips = gtk_tooltips_new();
-
- g_signal_connect (plugin, "orientation-changed",
+
+ g_signal_connect (plugin, "orientation-changed",
G_CALLBACK (actions_orientation_changed), action);
-
- g_signal_connect (plugin, "size-changed",
+
+ g_signal_connect (plugin, "size-changed",
G_CALLBACK (actions_set_size), action);
-
- g_signal_connect (plugin, "save",
+
+ g_signal_connect (plugin, "save",
G_CALLBACK (actions_write_rc_file), action);
-
- g_signal_connect (plugin, "free-data",
+
+ g_signal_connect (plugin, "free-data",
G_CALLBACK (actions_free_data), action);
-
+
xfce_panel_plugin_menu_show_configure (plugin);
- g_signal_connect (plugin, "configure-plugin",
+ g_signal_connect (plugin, "configure-plugin",
G_CALLBACK (actions_properties_dialog), action);
actions_read_rc_file (plugin, action);
actions_create_widgets (plugin, action);
-
+
action->style_id =
- g_signal_connect (plugin, "style-set",
+ g_signal_connect (plugin, "style-set",
G_CALLBACK (actions_icontheme_changed), action);
-
+
action->screen_id =
- g_signal_connect (plugin, "screen-changed",
+ g_signal_connect (plugin, "screen-changed",
G_CALLBACK (actions_icontheme_changed), action);
}
@@ -372,7 +372,7 @@
gtk_widget_destroy (GTK_BIN (action->plugin)->child);
actions_create_widgets (action->plugin, action);
- actions_set_size (action->plugin,
+ actions_set_size (action->plugin,
xfce_panel_plugin_get_size (action->plugin), action);
}
@@ -392,22 +392,25 @@
GtkWidget *dlg, *vbox, *hbox, *label, *box;
xfce_panel_plugin_block_menu (plugin);
-
+
dlg = xfce_titled_dialog_new_with_buttons (_("Panel Actions"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_screen (GTK_WINDOW (dlg),
+ gtk_widget_get_screen (GTK_WIDGET (plugin)));
+
g_object_set_data (G_OBJECT (plugin), "dialog", dlg);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings");
-
+
g_signal_connect (dlg, "response", G_CALLBACK (actions_dialog_response),
action);
gtk_container_set_border_width (GTK_CONTAINER (dlg), 2);
-
+
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_widget_show (vbox);
@@ -425,16 +428,16 @@
box = gtk_combo_box_new_text ();
gtk_widget_show (box);
gtk_box_pack_start (GTK_BOX (hbox), box, TRUE, TRUE, 0);
-
+
gtk_combo_box_append_text (GTK_COMBO_BOX (box), _("Quit"));
gtk_combo_box_append_text (GTK_COMBO_BOX (box), _("Lock screen"));
gtk_combo_box_append_text (GTK_COMBO_BOX (box), _("Quit + Lock screen"));
-
+
gtk_combo_box_set_active (GTK_COMBO_BOX (box), action->type);
-
- g_signal_connect (box, "changed", G_CALLBACK (action_type_changed),
+
+ g_signal_connect (box, "changed", G_CALLBACK (action_type_changed),
action);
-
+
gtk_widget_show (dlg);
}
Modified: xfce4-panel/branches/4_5_nick/plugins/clock/clock.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/clock/clock.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/plugins/clock/clock.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -5,7 +5,7 @@
* Copyright © 2005 The Xfce Development Team
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as published
+ * it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@@ -61,6 +61,7 @@
GtkTooltips *tips;
int timeout_id;
+ int screen_changed_id;
/* Settings */
int mode;
@@ -75,7 +76,7 @@
typedef struct
{
Clock *clock;
-
+
GtkWidget *cb_mode;
GtkWidget *cb_frame;
GtkWidget *cb_military;
@@ -84,7 +85,7 @@
}
ClockDialog;
-static void clock_properties_dialog (XfcePanelPlugin *plugin,
+static void clock_properties_dialog (XfcePanelPlugin *plugin,
Clock *clock);
static void clock_construct (XfcePanelPlugin *plugin);
@@ -94,7 +95,7 @@
* Clock *
* -------------------------------------------------------------------- */
-static gboolean
+static gboolean
clock_date_tooltip (Clock *clock)
{
time_t ticks;
@@ -123,23 +124,23 @@
/* Conversion to utf8
* Patch by Oliver M. Bolzer <oliver at fakeroot.net>
*/
- if (!g_utf8_validate(date_s, -1, NULL))
+ if (!g_utf8_validate(date_s, -1, NULL))
{
utf8date = g_locale_to_utf8(date_s, -1, NULL, NULL, NULL);
}
if (utf8date)
{
- gtk_tooltips_set_tip (clock->tips, GTK_WIDGET (clock->plugin),
+ gtk_tooltips_set_tip (clock->tips, GTK_WIDGET (clock->plugin),
utf8date, NULL);
g_free (utf8date);
}
else
{
- gtk_tooltips_set_tip (clock->tips, GTK_WIDGET (clock->plugin),
+ gtk_tooltips_set_tip (clock->tips, GTK_WIDGET (clock->plugin),
date_s, NULL);
}
- }
+ }
return TRUE;
}
@@ -163,28 +164,28 @@
gtk_container_set_border_width (GTK_CONTAINER (clock->frame), 0);
size -= 1;
}
-
- /* Replaced old 4-stage switch; Perhaps DIGIT_*_HEIGHT
+
+ /* Replaced old 4-stage switch; Perhaps DIGIT_*_HEIGHT
* should be moved from xfce_clock.c to xfce_clock.h so we
* can use them here (e.g. 10*2 => DIGIT_SMALL_HEIGHT*2)
* */
- if (xfce_panel_plugin_get_orientation (clock->plugin)
+ if (xfce_panel_plugin_get_orientation (clock->plugin)
== GTK_ORIENTATION_HORIZONTAL)
{
if (size <= 10*2)
{
xfce_clock_set_led_size (clk, DIGIT_SMALL);
}
- else if (size <= 14*2)
+ else if (size <= 14*2)
{
xfce_clock_set_led_size (clk, DIGIT_MEDIUM);
- }
- else if (size <= 20*2)
+ }
+ else if (size <= 20*2)
{
xfce_clock_set_led_size (clk, DIGIT_LARGE);
}
- else
+ else
{
xfce_clock_set_led_size (clk, DIGIT_HUGE);
}
@@ -220,7 +221,7 @@
/* Interface Implementation */
-static gboolean
+static gboolean
clock_set_size (XfcePanelPlugin *plugin, int size, Clock *clock)
{
clock_update_size(clock, size);
@@ -235,7 +236,9 @@
if (dlg)
gtk_widget_destroy (dlg);
-
+
+ g_signal_handler_disconnect (plugin, clock->screen_changed_id);
+
g_source_remove (clock->timeout_id);
g_object_unref (G_OBJECT (clock->tips));
panel_slice_free (Clock, clock);
@@ -254,7 +257,7 @@
ampm = FALSE;
secs = FALSE;
show_frame = FALSE;
-
+
if ((file = xfce_panel_plugin_lookup_rc_file (plugin)) != NULL)
{
rc = xfce_rc_simple_open (file, TRUE);
@@ -280,12 +283,12 @@
xfce_clock_show_military (XFCE_CLOCK (clock->clock), military);
xfce_clock_show_ampm (XFCE_CLOCK (clock->clock), ampm);
xfce_clock_show_secs (XFCE_CLOCK (clock->clock), secs);
-
+
clock->show_frame = show_frame;
- gtk_frame_set_shadow_type (GTK_FRAME (clock->frame),
+ gtk_frame_set_shadow_type (GTK_FRAME (clock->frame),
show_frame ? GTK_SHADOW_IN : GTK_SHADOW_NONE);
-
- clock_update_size (clock,
+
+ clock_update_size (clock,
xfce_panel_plugin_get_size (XFCE_PANEL_PLUGIN (plugin)));
}
@@ -294,7 +297,7 @@
{
char *file;
XfceRc *rc;
-
+
if (!(file = xfce_panel_plugin_save_location (plugin, TRUE)))
return;
@@ -309,31 +312,50 @@
xfce_rc_write_bool_entry (rc, "ampm", clock->ampm);
xfce_rc_write_bool_entry (rc, "secs", clock->secs);
xfce_rc_write_bool_entry (rc, "show_frame", clock->show_frame);
-
+
xfce_rc_close (rc);
}
+static void
+clock_screen_changed (GtkWidget *plugin, GdkScreen *screen,
+ Clock *clock)
+{
+ gtk_widget_destroy (clock->clock);
+
+ clock->clock = xfce_clock_new ();
+ gtk_widget_show (clock->clock);
+ gtk_container_add (GTK_CONTAINER (clock->frame), clock->clock);
+
+ xfce_clock_set_interval (XFCE_CLOCK (clock->clock), 1000);
+
+ clock_read_rc_file (clock->plugin, clock);
+}
+
/* Create widgets and connect to signals */
-static void
+static void
clock_construct (XfcePanelPlugin *plugin)
{
Clock *clock = panel_slice_new0 (Clock);
clock->plugin = plugin;
- g_signal_connect (plugin, "size-changed",
+ g_signal_connect (plugin, "size-changed",
G_CALLBACK (clock_set_size), clock);
-
- g_signal_connect (plugin, "free-data",
+
+ g_signal_connect (plugin, "free-data",
G_CALLBACK (clock_free_data), clock);
-
- g_signal_connect (plugin, "save",
+
+ g_signal_connect (plugin, "save",
G_CALLBACK (clock_write_rc_file), clock);
-
+
xfce_panel_plugin_menu_show_configure (plugin);
- g_signal_connect (plugin, "configure-plugin",
+ g_signal_connect (plugin, "configure-plugin",
G_CALLBACK (clock_properties_dialog), clock);
+
+ clock->screen_changed_id =
+ g_signal_connect (plugin, "screen-changed",
+ G_CALLBACK (clock_screen_changed), clock);
clock->frame = gtk_frame_new (NULL);
gtk_widget_show (clock->frame);
@@ -346,14 +368,14 @@
xfce_clock_set_interval (XFCE_CLOCK (clock->clock), 1000);
clock_read_rc_file (plugin, clock);
-
+
clock->tips = gtk_tooltips_new ();
g_object_ref (G_OBJECT (clock->tips));
gtk_object_sink (GTK_OBJECT (clock->tips));
-
+
clock_date_tooltip (clock);
- clock->timeout_id =
+ clock->timeout_id =
g_timeout_add (60000, (GSourceFunc) clock_date_tooltip, clock);
}
@@ -372,7 +394,7 @@
else
{
gtk_widget_set_sensitive (cd->cb_military, TRUE);
-
+
if (cd->clock->military)
gtk_widget_set_sensitive (cd->cb_ampm, FALSE);
else
@@ -384,7 +406,7 @@
clock_button_toggled (GtkWidget *cb, ClockDialog *cd)
{
gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cb));
-
+
if (cb == cd->cb_frame)
{
cd->clock->show_frame = active;
@@ -396,7 +418,7 @@
cd->clock->military = active;
xfce_clock_show_military (XFCE_CLOCK (cd->clock->clock),
active);
-
+
clock_set_sensative (cd);
}
else if (cb == cd->cb_ampm)
@@ -411,8 +433,8 @@
xfce_clock_show_secs (XFCE_CLOCK (cd->clock->clock),
active);
}
-
- clock_update_size (cd->clock,
+
+ clock_update_size (cd->clock,
xfce_panel_plugin_get_size (XFCE_PANEL_PLUGIN (cd->clock->plugin)));
}
@@ -421,15 +443,15 @@
{
cd->clock->mode = gtk_combo_box_get_active(cb);
xfce_clock_set_mode (XFCE_CLOCK (cd->clock->clock), cd->clock->mode);
-
+
clock_set_sensative (cd);
-
- clock_update_size (cd->clock,
+
+ clock_update_size (cd->clock,
xfce_panel_plugin_get_size (XFCE_PANEL_PLUGIN (cd->clock->plugin)));
}
static void
-clock_dialog_response (GtkWidget *dlg, int reponse,
+clock_dialog_response (GtkWidget *dlg, int reponse,
ClockDialog *cd)
{
g_object_set_data (G_OBJECT (cd->clock->plugin), "dialog", NULL);
@@ -437,7 +459,7 @@
gtk_widget_destroy (dlg);
xfce_panel_plugin_unblock_menu (cd->clock->plugin);
clock_write_rc_file (cd->clock->plugin, cd->clock);
-
+
g_free (cd);
}
@@ -448,27 +470,30 @@
ClockDialog *cd;
xfce_panel_plugin_block_menu (plugin);
-
+
cd = g_new0 (ClockDialog, 1);
cd->clock = clock;
-
+
dlg = xfce_titled_dialog_new_with_buttons (_("Clock"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_screen (GTK_WINDOW (dlg),
+ gtk_widget_get_screen (GTK_WIDGET (plugin)));
+
g_object_set_data (G_OBJECT (plugin), "dialog", dlg);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings");
-
+
gtk_container_set_border_width (GTK_CONTAINER (dlg), 2);
-
+
frame = xfce_create_framebox (_("Appearance"), &bin);
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame,
FALSE, FALSE, 0);
-
+
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_add (GTK_CONTAINER (bin), vbox);
@@ -480,7 +505,7 @@
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), _("Digital"));
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), _("LED"));
gtk_combo_box_set_active (GTK_COMBO_BOX (cb), clock->mode);
- g_signal_connect (cb, "changed",
+ g_signal_connect (cb, "changed",
G_CALLBACK (clock_mode_changed), cd);
cd->cb_frame = cb = gtk_check_button_new_with_mnemonic (_("Show _frame"));
@@ -489,12 +514,12 @@
clock->show_frame);
g_signal_connect (cb, "toggled",
G_CALLBACK (clock_button_toggled), cd);
-
+
frame = xfce_create_framebox (_("Clock Options"), &bin);
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame,
FALSE, FALSE, 0);
-
+
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_add (GTK_CONTAINER (bin), vbox);
@@ -504,7 +529,7 @@
clock->military);
g_signal_connect (cb, "toggled",
G_CALLBACK (clock_button_toggled), cd);
-
+
cd->cb_ampm = cb = gtk_check_button_new_with_mnemonic (_("Show AM/PM"));
gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb),
Modified: xfce4-panel/branches/4_5_nick/plugins/iconbox/iconbox.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/iconbox/iconbox.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/plugins/iconbox/iconbox.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -894,6 +894,9 @@
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_screen (GTK_WINDOW (dlg),
+ gtk_widget_get_screen (GTK_WIDGET (plugin)));
+
g_object_set_data (G_OBJECT (plugin), "dialog", dlg);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
Modified: xfce4-panel/branches/4_5_nick/plugins/launcher/launcher-dialog.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/launcher/launcher-dialog.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/plugins/launcher/launcher-dialog.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -1507,6 +1507,9 @@
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_screen (GTK_WINDOW (dialog),
+ gtk_widget_get_screen (GTK_WIDGET (launcher->plugin)));
+
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dialog), "xfce4-settings");
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
Modified: xfce4-panel/branches/4_5_nick/plugins/pager/pager.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/pager/pager.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/plugins/pager/pager.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -5,7 +5,7 @@
* Copyright © 2005 Jasper Huijsmans <jasper at xfce.org>
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as published
+ * it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@@ -37,7 +37,7 @@
GdkScreen *gdk_screen;
GtkWidget *pager;
-
+
int ws_created_id;
int ws_destroyed_id;
int screen_changed_id;
@@ -48,7 +48,7 @@
}
Pager;
-static void pager_properties_dialog (XfcePanelPlugin *plugin,
+static void pager_properties_dialog (XfcePanelPlugin *plugin,
Pager *pager);
static void pager_construct (XfcePanelPlugin *plugin);
@@ -65,25 +65,25 @@
/* Interface Implementation */
static void
-pager_orientation_changed (XfcePanelPlugin *plugin,
- GtkOrientation orientation,
+pager_orientation_changed (XfcePanelPlugin *plugin,
+ GtkOrientation orientation,
Pager *pager)
{
netk_pager_set_orientation (NETK_PAGER (pager->pager), orientation);
}
-static gboolean
+static gboolean
pager_set_size (XfcePanelPlugin *plugin, int size)
{
if (xfce_panel_plugin_get_orientation (plugin) ==
GTK_ORIENTATION_HORIZONTAL)
{
- gtk_widget_set_size_request (GTK_WIDGET (plugin),
+ gtk_widget_set_size_request (GTK_WIDGET (plugin),
-1, size);
}
else
{
- gtk_widget_set_size_request (GTK_WIDGET (plugin),
+ gtk_widget_set_size_request (GTK_WIDGET (plugin),
size, -1);
}
@@ -97,7 +97,7 @@
if (dlg)
gtk_widget_destroy (dlg);
-
+
g_signal_handler_disconnect (plugin, pager->screen_changed_id);
if (pager->ws_created_id)
@@ -105,7 +105,7 @@
g_signal_handler_disconnect (pager->screen, pager->ws_created_id);
pager->ws_created_id = 0;
}
-
+
if (pager->ws_destroyed_id)
{
g_signal_handler_disconnect (pager->screen, pager->ws_destroyed_id);
@@ -128,7 +128,7 @@
XfceRc *rc;
int rows = 1;
gboolean scrolling = TRUE;
-
+
if ((file = xfce_panel_plugin_lookup_rc_file (plugin)) != NULL)
{
rc = xfce_rc_simple_open (file, TRUE);
@@ -150,7 +150,7 @@
{
char *file;
XfceRc *rc;
-
+
if (!(file = xfce_panel_plugin_save_location (plugin, TRUE)))
return;
@@ -159,9 +159,9 @@
if (!rc)
return;
-
+
xfce_rc_write_int_entry (rc, "rows", pager->rows);
-
+
xfce_rc_write_bool_entry (rc, "scrolling", pager->scrolling);
xfce_rc_close (rc);
@@ -169,10 +169,10 @@
/* create widgets and connect to signals */
static void
-pager_n_workspaces_changed (NetkScreen * screen, NetkWorkspace * ws,
+pager_n_workspaces_changed (NetkScreen * screen, NetkWorkspace * ws,
Pager * pager)
{
- pager_set_size (pager->plugin,
+ pager_set_size (pager->plugin,
xfce_panel_plugin_get_size (pager->plugin));
}
@@ -189,7 +189,7 @@
g_signal_handler_disconnect (pager->screen, pager->ws_created_id);
pager->ws_created_id = 0;
}
-
+
if (pager->ws_destroyed_id)
{
g_signal_handler_disconnect (pager->screen, pager->ws_destroyed_id);
@@ -206,17 +206,17 @@
pager->screen = netk_screen_get (gdk_screen_get_number (screen));
netk_pager_set_screen (NETK_PAGER (pager->pager), pager->screen);
-
+
pager->ws_created_id =
g_signal_connect (pager->screen, "workspace-created",
G_CALLBACK (pager_n_workspaces_changed), pager);
-
+
pager->ws_destroyed_id =
g_signal_connect (pager->screen, "workspace-destroyed",
G_CALLBACK (pager_n_workspaces_changed), pager);
- pager->screen_size_changed_id =
- g_signal_connect (screen, "size-changed",
+ pager->screen_size_changed_id =
+ g_signal_connect (screen, "size-changed",
G_CALLBACK (pager_screen_size_changed), pager);
}
@@ -227,27 +227,27 @@
gtk_widget_queue_resize (GTK_WIDGET (pager->plugin));
}
-static void
+static void
pager_construct (XfcePanelPlugin *plugin)
{
GdkScreen *screen;
int screen_idx;
Pager *pager = panel_slice_new0 (Pager);
- g_signal_connect (plugin, "orientation-changed",
+ g_signal_connect (plugin, "orientation-changed",
G_CALLBACK (pager_orientation_changed), pager);
-
- g_signal_connect (plugin, "size-changed",
+
+ g_signal_connect (plugin, "size-changed",
G_CALLBACK (pager_set_size), NULL);
-
- g_signal_connect (plugin, "free-data",
+
+ g_signal_connect (plugin, "free-data",
G_CALLBACK (pager_free_data), pager);
-
- g_signal_connect (plugin, "save",
+
+ g_signal_connect (plugin, "save",
G_CALLBACK (pager_write_rc_file), pager);
xfce_panel_plugin_menu_show_configure (plugin);
- g_signal_connect (plugin, "configure-plugin",
+ g_signal_connect (plugin, "configure-plugin",
G_CALLBACK (pager_properties_dialog), pager);
pager->plugin = plugin;
@@ -255,33 +255,33 @@
pager->gdk_screen = screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
screen_idx = gdk_screen_get_number (screen);
pager->screen = netk_screen_get (screen_idx);
-
+
pager_read_rc_file (plugin, pager);
pager->pager = netk_pager_new (pager->screen);
- netk_pager_set_orientation (NETK_PAGER (pager->pager),
+ netk_pager_set_orientation (NETK_PAGER (pager->pager),
xfce_panel_plugin_get_orientation (plugin));
netk_pager_set_n_rows (NETK_PAGER (pager->pager), pager->rows);
netk_pager_set_workspace_scrolling (NETK_PAGER (pager->pager), pager->scrolling);
gtk_widget_show (pager->pager);
gtk_container_add (GTK_CONTAINER (plugin), pager->pager);
-
+
pager->ws_created_id =
g_signal_connect (pager->screen, "workspace-created",
G_CALLBACK (pager_n_workspaces_changed), pager);
-
+
pager->ws_destroyed_id =
g_signal_connect (pager->screen, "workspace-destroyed",
G_CALLBACK (pager_n_workspaces_changed), pager);
-
+
xfce_panel_plugin_add_action_widget (plugin, pager->pager);
-
- pager->screen_changed_id =
- g_signal_connect (plugin, "screen-changed",
+
+ pager->screen_changed_id =
+ g_signal_connect (plugin, "screen-changed",
G_CALLBACK (pager_screen_changed), pager);
- pager->screen_size_changed_id =
- g_signal_connect (screen, "size-changed",
+ pager->screen_size_changed_id =
+ g_signal_connect (screen, "size-changed",
G_CALLBACK (pager_screen_size_changed), pager);
}
@@ -306,11 +306,11 @@
workspace_scrolling_toggled (GtkWidget *button, Pager *pager)
{
gboolean scrolling = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
-
+
if (pager->scrolling != scrolling)
{
pager->scrolling = scrolling;
-
+
netk_pager_set_workspace_scrolling (NETK_PAGER (pager->pager), scrolling);
}
}
@@ -332,22 +332,25 @@
int max;
xfce_panel_plugin_block_menu (plugin);
-
+
dlg = xfce_titled_dialog_new_with_buttons (_("Pager"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_screen (GTK_WINDOW (dlg),
+ gtk_widget_get_screen (GTK_WIDGET (plugin)));
+
g_object_set_data (G_OBJECT (plugin), "dialog", dlg);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings");
-
+
g_signal_connect (dlg, "response", G_CALLBACK (pager_dialog_response),
pager);
gtk_container_set_border_width (GTK_CONTAINER (dlg), 2);
-
+
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_widget_show (vbox);
@@ -358,7 +361,7 @@
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- if (xfce_panel_plugin_get_orientation (plugin) ==
+ if (xfce_panel_plugin_get_orientation (plugin) ==
GTK_ORIENTATION_HORIZONTAL)
{
label = gtk_label_new (_("Number of rows:"));
@@ -366,7 +369,7 @@
else
{
label = gtk_label_new (_("Number of columns:"));
- }
+ }
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -390,15 +393,15 @@
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
}
-
+
scrolling = gtk_check_button_new_with_mnemonic (_("Switch workspaces using the mouse wheel"));
gtk_widget_show (scrolling);
gtk_box_pack_start (GTK_BOX (vbox), scrolling, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scrolling), pager->scrolling);
-
+
g_signal_connect (scrolling, "toggled",
G_CALLBACK (workspace_scrolling_toggled), pager);
-
+
gtk_widget_show (dlg);
}
Modified: xfce4-panel/branches/4_5_nick/plugins/separator/separator.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/separator/separator.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/plugins/separator/separator.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -5,7 +5,7 @@
* Copyright © 2005 Jasper Huijsmans <jasper at xfce.org>
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as published
+ * it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@@ -50,7 +50,7 @@
/* Interface Implementation */
static gboolean
-separator_expose (GtkWidget *widget, GdkEventExpose *event,
+separator_expose (GtkWidget *widget, GdkEventExpose *event,
XfcePanelPlugin *plugin)
{
if (GTK_WIDGET_DRAWABLE (widget))
@@ -64,7 +64,7 @@
start = allocation->y + SEP_START * allocation->height;
end = allocation->y + SEP_END * allocation->height;
position = allocation->x + allocation->width / 2;
-
+
gtk_paint_vline (widget->style, widget->window,
GTK_STATE_NORMAL,
&(event->area), widget, "separator",
@@ -75,8 +75,8 @@
start = allocation->x + SEP_START * allocation->width;
end = allocation->x + SEP_END * allocation->width;
position = allocation->y + allocation->height / 2;
-
- gtk_paint_hline (widget->style, widget->window,
+
+ gtk_paint_hline (widget->style, widget->window,
GTK_STATE_NORMAL,
&(event->area), widget, "separator",
start, end, position);
@@ -92,35 +92,35 @@
separator_add_widget (XfcePanelPlugin *plugin)
{
GtkWidget *widget;
-
+
widget = gtk_drawing_area_new ();
gtk_widget_show (widget);
gtk_container_add (GTK_CONTAINER (plugin), widget);
-
- g_signal_connect (widget, "expose-event",
+
+ g_signal_connect (widget, "expose-event",
G_CALLBACK (separator_expose), plugin);
}
static void
-separator_orientation_changed (XfcePanelPlugin *plugin,
+separator_orientation_changed (XfcePanelPlugin *plugin,
GtkOrientation orientation)
{
if (GTK_BIN (plugin)->child)
gtk_widget_queue_draw (GTK_BIN (plugin)->child);
}
-static gboolean
+static gboolean
separator_set_size (XfcePanelPlugin *plugin, int size)
{
if (xfce_panel_plugin_get_orientation (plugin) ==
GTK_ORIENTATION_HORIZONTAL)
{
- gtk_widget_set_size_request (GTK_WIDGET (plugin),
+ gtk_widget_set_size_request (GTK_WIDGET (plugin),
SEPARATOR_WIDTH, size);
}
else
{
- gtk_widget_set_size_request (GTK_WIDGET (plugin),
+ gtk_widget_set_size_request (GTK_WIDGET (plugin),
size, SEPARATOR_WIDTH);
}
@@ -133,10 +133,10 @@
char *file;
XfceRc *rc;
int line, expand;
-
+
line = 1;
expand = 0;
-
+
if ((file = xfce_panel_plugin_lookup_rc_file (plugin)) != NULL)
{
rc = xfce_rc_simple_open (file, TRUE);
@@ -145,16 +145,16 @@
if (rc != NULL)
{
line = xfce_rc_read_int_entry (rc, "draw-separator", 1);
-
+
expand = xfce_rc_read_int_entry (rc, "expand", 0);
-
+
xfce_rc_close (rc);
}
}
if (line)
separator_add_widget (plugin);
-
+
if (expand)
xfce_panel_plugin_set_expand (plugin, TRUE);
}
@@ -164,7 +164,7 @@
{
char *file;
XfceRc *rc;
-
+
if (!(file = xfce_panel_plugin_save_location (plugin, TRUE)))
return;
@@ -173,13 +173,13 @@
if (!rc)
return;
-
- xfce_rc_write_int_entry (rc, "draw-separator",
+
+ xfce_rc_write_int_entry (rc, "draw-separator",
GTK_BIN (plugin)->child ? 1 : 0);
- xfce_rc_write_int_entry (rc, "expand",
- xfce_panel_plugin_get_expand (plugin) ? 1 : 0);
-
+ xfce_rc_write_int_entry (rc, "expand",
+ xfce_panel_plugin_get_expand (plugin) ? 1 : 0);
+
xfce_rc_close (rc);
}
@@ -193,23 +193,23 @@
}
/* create widgets and connect to signals */
-static void
+static void
separator_construct (XfcePanelPlugin *plugin)
{
- g_signal_connect (plugin, "orientation-changed",
+ g_signal_connect (plugin, "orientation-changed",
G_CALLBACK (separator_orientation_changed), NULL);
-
- g_signal_connect (plugin, "size-changed",
+
+ g_signal_connect (plugin, "size-changed",
G_CALLBACK (separator_set_size), NULL);
-
- g_signal_connect (plugin, "save",
+
+ g_signal_connect (plugin, "save",
G_CALLBACK (separator_write_rc_file), NULL);
-
- g_signal_connect (plugin, "free-data",
+
+ g_signal_connect (plugin, "free-data",
G_CALLBACK (separator_free_data), NULL);
-
+
xfce_panel_plugin_menu_show_configure (plugin);
- g_signal_connect (plugin, "configure-plugin",
+ g_signal_connect (plugin, "configure-plugin",
G_CALLBACK (separator_properties_dialog), NULL);
separator_read_rc_file (plugin);
@@ -235,7 +235,7 @@
}
static void
-separator_dialog_response (GtkWidget *dlg, int reponse,
+separator_dialog_response (GtkWidget *dlg, int reponse,
XfcePanelPlugin *plugin)
{
g_object_set_data (G_OBJECT (plugin), "dialog", NULL);
@@ -251,22 +251,25 @@
GtkWidget *dlg, *vbox, *tb;
xfce_panel_plugin_block_menu (plugin);
-
+
dlg = xfce_titled_dialog_new_with_buttons (_("Separator or Spacing"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_screen (GTK_WINDOW (dlg),
+ gtk_widget_get_screen (GTK_WIDGET (plugin)));
+
g_object_set_data (G_OBJECT (plugin), "dialog", dlg);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings");
-
+
g_signal_connect (dlg, "response", G_CALLBACK (separator_dialog_response),
plugin);
gtk_container_set_border_width (GTK_CONTAINER (dlg), 2);
-
+
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_widget_show (vbox);
@@ -281,7 +284,7 @@
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tb), TRUE);
g_signal_connect (tb, "toggled", G_CALLBACK (separator_toggled), plugin);
-
+
tb = gtk_check_button_new_with_mnemonic (_("_Expand"));
gtk_widget_show (tb);
gtk_box_pack_start (GTK_BOX (vbox), tb, FALSE, FALSE, 0);
@@ -290,7 +293,7 @@
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tb), TRUE);
g_signal_connect (tb, "toggled", G_CALLBACK (expand_toggled), plugin);
-
+
gtk_widget_show (dlg);
}
Modified: xfce4-panel/branches/4_5_nick/plugins/systray/systray.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/systray/systray.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/plugins/systray/systray.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -380,6 +380,9 @@
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_screen (GTK_WINDOW (dlg),
+ gtk_widget_get_screen (GTK_WIDGET (plugin)));
+
g_object_set_data (G_OBJECT (plugin), "dialog", dlg);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
Modified: xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/plugins/tasklist/tasklist.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -57,9 +57,9 @@
/* register with the panel */
XFCE_PANEL_PLUGIN_REGISTER_INTERNAL (tasklist_construct);
-
-
+
+
/**
* Interface Implementation
**/
@@ -72,33 +72,33 @@
gtk_widget_queue_draw (tasklist->handle);
}
-
-
+
+
static gboolean
tasklist_set_size (Tasklist *tasklist,
gint size)
-{
- GtkOrientation orientation;
-
- orientation = xfce_panel_plugin_get_orientation (tasklist->plugin);
-
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
+{
+ GtkOrientation orientation;
+
+ orientation = xfce_panel_plugin_get_orientation (tasklist->plugin);
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
gtk_widget_set_size_request (GTK_WIDGET (tasklist->plugin),
- tasklist->width, size);
+ tasklist->width, size);
}
- else
+ else
{
gtk_widget_set_size_request (GTK_WIDGET (tasklist->plugin),
- size, tasklist->width);
+ size, tasklist->width);
}
return TRUE;
}
-
-
+
+
static void
tasklist_free_data (Tasklist *tasklist)
{
@@ -110,9 +110,9 @@
g_signal_handler_disconnect (G_OBJECT (tasklist->plugin), tasklist->screen_changed_id);
panel_slice_free (Tasklist, tasklist);
}
-
-
+
+
static void
tasklist_read_rc_file (Tasklist *tasklist)
{
@@ -150,9 +150,9 @@
}
}
}
-
-
+
+
static void
tasklist_write_rc_file (Tasklist *tasklist)
{
@@ -181,9 +181,9 @@
xfce_rc_close (rc);
}
}
-
-
+
+
/* create widgets and connect to signals */
static gboolean
handle_expose (GtkWidget *widget,
@@ -191,43 +191,43 @@
Tasklist *tasklist)
{
GtkAllocation *allocation = &(widget->allocation);
- gint x, y, w, h;
+ gint x, y, w, h;
GtkOrientation orientation;
if (GTK_WIDGET_DRAWABLE (widget))
{
orientation = xfce_panel_plugin_get_orientation (tasklist->plugin);
- x = allocation->x;
- y = allocation->y;
- w = allocation->width;
- h = allocation->height;
-
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- y += widget->style->ythickness;
- h -= 2 * widget->style->ythickness;
- }
- else
- {
- x += widget->style->xthickness;
- w -= 2 * widget->style->xthickness;
- }
-
- gtk_paint_handle (widget->style, widget->window,
- GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE,
- &(ev->area), widget, "handlebox",
- x, y, w, h,
- orientation);
+ x = allocation->x;
+ y = allocation->y;
+ w = allocation->width;
+ h = allocation->height;
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ y += widget->style->ythickness;
+ h -= 2 * widget->style->ythickness;
+ }
+ else
+ {
+ x += widget->style->xthickness;
+ w -= 2 * widget->style->xthickness;
+ }
+
+ gtk_paint_handle (widget->style, widget->window,
+ GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE,
+ &(ev->area), widget, "handlebox",
+ x, y, w, h,
+ orientation);
+
return TRUE;
}
return FALSE;
}
-
-
+
+
static void
tasklist_screen_changed (Tasklist *tasklist,
GdkScreen *screen)
@@ -238,9 +238,9 @@
netk_tasklist_set_screen (NETK_TASKLIST (tasklist->list),
netk_screen_get (gdk_screen_get_number (screen)));
}
-
-
+
+
static void
tasklist_construct (XfcePanelPlugin *plugin)
{
@@ -312,9 +312,9 @@
g_signal_connect_swapped (G_OBJECT (plugin), "screen-changed",
G_CALLBACK (tasklist_screen_changed), tasklist);
}
-
-
+
+
/**
* Configuration Dialog
**/
@@ -327,9 +327,9 @@
netk_tasklist_set_include_all_workspaces (NETK_TASKLIST (tasklist->list),
tasklist->all_workspaces);
}
-
-
+
+
static void
grouping_changed (GtkComboBox *cb,
Tasklist *tasklist)
@@ -339,9 +339,9 @@
netk_tasklist_set_grouping (NETK_TASKLIST (tasklist->list),
tasklist->grouping);
}
-
-
+
+
static void
show_label_toggled (GtkToggleButton *tb,
Tasklist *tasklist)
@@ -351,9 +351,9 @@
netk_tasklist_set_show_label (NETK_TASKLIST (tasklist->list),
tasklist->show_label);
}
-
-
+
+
static void
expand_toggled (GtkToggleButton *tb,
Tasklist *tasklist)
@@ -362,9 +362,9 @@
xfce_panel_plugin_set_expand (tasklist->plugin, tasklist->expand);
}
-
-
+
+
static void
flat_buttons_toggled (GtkToggleButton *tb,
Tasklist *tasklist)
@@ -375,9 +375,9 @@
tasklist->flat_buttons ?
GTK_RELIEF_NONE : GTK_RELIEF_NORMAL);
}
-
-
+
+
static void
show_handles_toggled (GtkToggleButton *tb,
Tasklist *tasklist)
@@ -389,9 +389,9 @@
else
gtk_widget_hide (tasklist->handle);
}
-
-
+
+
static void
width_changed (GtkSpinButton *sb,
Tasklist *tasklist)
@@ -400,9 +400,9 @@
tasklist_set_size (tasklist, xfce_panel_plugin_get_size (tasklist->plugin));
}
-
-
+
+
static void
tasklist_dialog_response (GtkWidget *dlg,
gint reponse,
@@ -414,9 +414,9 @@
xfce_panel_plugin_unblock_menu (tasklist->plugin);
tasklist_write_rc_file (tasklist);
}
-
-
+
+
static void
tasklist_properties_dialog (Tasklist *tasklist)
{
@@ -430,6 +430,9 @@
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_screen (GTK_WINDOW (dlg),
+ gtk_widget_get_screen (GTK_WIDGET (tasklist->plugin)));
+
g_object_set_data (G_OBJECT (tasklist->plugin), "dialog", dlg);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
@@ -519,9 +522,9 @@
gtk_widget_show_all (dlg);
}
-
-
+
+
static gboolean
using_xinerama (XfcePanelPlugin *plugin)
{
Modified: xfce4-panel/branches/4_5_nick/plugins/windowlist/windowlist-dialog.c
===================================================================
--- xfce4-panel/branches/4_5_nick/plugins/windowlist/windowlist-dialog.c 2007-01-01 09:05:59 UTC (rev 24230)
+++ xfce4-panel/branches/4_5_nick/plugins/windowlist/windowlist-dialog.c 2007-01-01 16:41:33 UTC (rev 24231)
@@ -4,12 +4,12 @@
*
* Copyright (c) 2003 Andre Lerche <a.lerche at gmx.net>
* Copyright (c) 2003 Benedikt Meurer <benedikt.meurer at unix-ag.uni-siegen.de>
- * Copyright (c) 2006 Jani Monoses <jani at ubuntu.com>
+ * Copyright (c) 2006 Jani Monoses <jani at ubuntu.com>
* Copyright (c) 2006 Jasper Huijsmans <jasper at xfce.org>
* Copyright (c) 2006 Nick Schermer <nick at xfce.org>
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as published
+ * it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -33,13 +33,13 @@
typedef struct
{
Windowlist *wl;
-
+
GtkWidget *button_layout;
-
+
GtkWidget *show_all_workspaces;
GtkWidget *show_window_icons;
GtkWidget *show_workspace_actions;
-
+
GtkWidget *notify_disabled;
GtkWidget *notify_other;
GtkWidget *notify_all;
@@ -52,16 +52,16 @@
{
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
return;
-
+
if (button == wd->notify_disabled)
wd->wl->notify = DISABLED;
-
+
else if (button == wd->notify_other)
wd->wl->notify = OTHER_WORKSPACES;
-
+
else if (button == wd->notify_all)
wd->wl->notify = ALL_WORKSPACES;
-
+
windowlist_start_blink (wd->wl);
}
@@ -75,31 +75,31 @@
wd->wl->layout = ARROW_BUTTON;
else
wd->wl->layout = ICON_BUTTON;
-
+
windowlist_create_button (wd->wl);
}
else if (button == wd->show_all_workspaces)
- wd->wl->show_all_workspaces =
+ wd->wl->show_all_workspaces =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
-
+
else if (button == wd->show_window_icons)
- wd->wl->show_window_icons =
+ wd->wl->show_window_icons =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
-
+
else if (button == wd->show_workspace_actions)
- wd->wl->show_workspace_actions =
+ wd->wl->show_workspace_actions =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
}
static void
-windowlist_properties_response (GtkWidget *dlg,
+windowlist_properties_response (GtkWidget *dlg,
int response,
WindowlistDialog *wd)
{
gtk_widget_destroy (dlg);
-
+
xfce_panel_plugin_unblock_menu (wd->wl->plugin);
-
+
panel_slice_free (WindowlistDialog, wd);
}
@@ -108,26 +108,29 @@
Windowlist * wl)
{
WindowlistDialog *wd;
-
+
GtkWidget *dlg, *vbox, *vbox2, *frame, *hbox,
*alignment, *label, *button, *image;
-
+
wd = panel_slice_new0 (WindowlistDialog);
-
+
wd->wl = wl;
-
+
xfce_panel_plugin_block_menu (wd->wl->plugin);
-
+
dlg = xfce_titled_dialog_new_with_buttons (_("Window List"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_screen (GTK_WINDOW (dlg),
+ gtk_widget_get_screen (GTK_WIDGET (plugin)));
+
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings");
-
+
gtk_container_set_border_width (GTK_CONTAINER (dlg), 2);
-
+
vbox = gtk_vbox_new (FALSE, BORDER);
gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER - 2);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox,
@@ -137,7 +140,7 @@
hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
- image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO,
+ image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO,
GTK_ICON_SIZE_DND);
gtk_misc_set_alignment (GTK_MISC (image), 0, 0);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
@@ -156,55 +159,55 @@
vbox2 = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (alignment), vbox2);
-
- button = wd->notify_disabled =
+
+ button = wd->notify_disabled =
gtk_radio_button_new_with_mnemonic (NULL, _("_Disabled"));
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
(wd->wl->notify == DISABLED));
g_signal_connect (button, "toggled",
G_CALLBACK (windowlist_notify_toggled), wd);
- button = wd->notify_other =
+ button = wd->notify_other =
gtk_radio_button_new_with_mnemonic_from_widget (
GTK_RADIO_BUTTON (button), _("For _other workspaces"));
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
(wd->wl->notify == OTHER_WORKSPACES));
g_signal_connect (button, "toggled",
G_CALLBACK (windowlist_notify_toggled), wd);
-
- button = wd->notify_all =
+
+ button = wd->notify_all =
gtk_radio_button_new_with_mnemonic_from_widget (
GTK_RADIO_BUTTON (button), _("For _all workspaces"));
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
(wd->wl->notify == ALL_WORKSPACES));
g_signal_connect (button, "toggled",
G_CALLBACK (windowlist_notify_toggled), wd);
-
+
/* Button Layout */
frame = xfce_create_framebox (_("Appearance"), &alignment);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
vbox2 = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (alignment), vbox2);
-
+
button = gtk_radio_button_new_with_mnemonic (NULL, _("_Icon button"));
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
(wd->wl->layout == ICON_BUTTON));
button = wd->button_layout =
gtk_radio_button_new_with_mnemonic_from_widget (
GTK_RADIO_BUTTON (button), _("A_rrow button"));
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
(wd->wl->layout == ARROW_BUTTON));
g_signal_connect (button, "toggled",
G_CALLBACK (windowlist_button_toggled), wd);
-
+
/* Windowlist Settings */
frame = xfce_create_framebox (_("Window List"), &alignment);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
@@ -217,8 +220,8 @@
gtk_check_button_new_with_mnemonic (
_("Show _windows from all workspaces"));
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
wd->wl->show_all_workspaces);
g_signal_connect (button, "toggled",
G_CALLBACK (windowlist_button_toggled), wd);
@@ -226,8 +229,8 @@
button = wd->show_window_icons =
gtk_check_button_new_with_mnemonic (_("Show a_pplication icons"));
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
wd->wl->show_window_icons);
g_signal_connect (button, "toggled",
G_CALLBACK (windowlist_button_toggled), wd);
@@ -235,15 +238,15 @@
button = wd->show_workspace_actions =
gtk_check_button_new_with_mnemonic (_("Show wor_kspace actions"));
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
wd->wl->show_workspace_actions);
g_signal_connect (button, "toggled",
G_CALLBACK (windowlist_button_toggled), wd);
/* Show Dialog */
- g_signal_connect (dlg, "response",
+ g_signal_connect (dlg, "response",
G_CALLBACK (windowlist_properties_response), wd);
-
+
gtk_widget_show_all (dlg);
}
More information about the Xfce4-commits
mailing list