Commit 1d487646 authored by Arturo Espinosa's avatar Arturo Espinosa

1. Added backing pixmap support to the panel. 2. Simplify configuration



1. Added backing pixmap support to the panel.
2. Simplify configuration load/save based on gnome_config by using
   gnome_config_push_prefix.
3. The property configurators are now GnomePropertyBox widgets.

Miguel.
parent 75faaf55
1998-04-22 Miguel de Icaza <miguel@nuclecu.unam.mx>
* Added support for a background pixmap.
* main.c (init_user_panels): Simplified the use of gnome_config by
using the gnome_config_push_prefix.
* panel.c (save_panel_configuration): Simplified the use of
gnome_config by using gnome_config_push_prefix.
(panel_session_save): Likewise.
* panel_config_global.c (panel_config_global): Made it use
GnomePropertyBox as well.
* panel_config.c (panel_config): Made it use GnomePropertyBox
instead of hand-done property configurator.
Wed Apr 22 02:25:39 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch]: added change_drop_zone_pos function
......
1998-04-22 Miguel de Icaza <miguel@nuclecu.unam.mx>
* Added support for a background pixmap.
* main.c (init_user_panels): Simplified the use of gnome_config by
using the gnome_config_push_prefix.
* panel.c (save_panel_configuration): Simplified the use of
gnome_config by using gnome_config_push_prefix.
(panel_session_save): Likewise.
* panel_config_global.c (panel_config_global): Made it use
GnomePropertyBox as well.
* panel_config.c (panel_config): Made it use GnomePropertyBox
instead of hand-done property configurator.
Wed Apr 22 02:25:39 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch]: added change_drop_zone_pos function
......
......@@ -157,7 +157,7 @@ create_empty_drawer_applet(DrawerOrient orient)
PANEL_EXPLICIT_HIDE,
PANEL_SHOWN,
0, 0,
DROP_ZONE_LEFT),
DROP_ZONE_LEFT, NULL),
orient);
case DRAWER_DOWN:
return create_drawer_applet(panel_widget_new(0,
......@@ -166,7 +166,7 @@ create_empty_drawer_applet(DrawerOrient orient)
PANEL_EXPLICIT_HIDE,
PANEL_SHOWN,
0, 0,
DROP_ZONE_RIGHT),
DROP_ZONE_RIGHT, NULL),
orient);
case DRAWER_LEFT:
return create_drawer_applet(panel_widget_new(0,
......@@ -175,7 +175,7 @@ create_empty_drawer_applet(DrawerOrient orient)
PANEL_EXPLICIT_HIDE,
PANEL_SHOWN,
0, 0,
DROP_ZONE_LEFT),
DROP_ZONE_LEFT, NULL),
orient);
case DRAWER_RIGHT:
return create_drawer_applet(panel_widget_new(0,
......@@ -184,7 +184,7 @@ create_empty_drawer_applet(DrawerOrient orient)
PANEL_EXPLICIT_HIDE,
PANEL_SHOWN,
0, 0,
DROP_ZONE_RIGHT),
DROP_ZONE_RIGHT, NULL),
orient);
}
return NULL;
......
......@@ -700,6 +700,7 @@ init_user_panels(void)
GtkWidget *panel;
PanelState state;
DrawerDropZonePos drop_pos;
char *back_pixmap;
g_snprintf(buf,256,"%sConfig/panel_count=0",old_panel_cfg_path);
count=gnome_config_get_int(buf);
......@@ -712,43 +713,35 @@ init_user_panels(void)
DEFAULT_MINIMIZE_DELAY);
for(num=1;num<=count;num++) {
g_snprintf(buf,256,"%sPanel_%d/", old_panel_cfg_path, num);
gnome_config_push_prefix (buf);
/*these are only for free floating non-drawer like panels */
g_snprintf(buf,256,"%sPanel_%d/size=%d",old_panel_cfg_path,
num, 50);
size=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sPanel_%d/position_x=0",
old_panel_cfg_path,num);
x=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sPanel_%d/position_y=0",
old_panel_cfg_path,num);
y=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sPanel_%d/snapped=%d",
old_panel_cfg_path,num,
PANEL_BOTTOM);
size = gnome_config_get_int("size=50");
x = gnome_config_get_int("position_x=0");
y = gnome_config_get_int("position_y=0");
g_snprintf(buf,256,"snapped=%d", PANEL_BOTTOM);
config.snapped=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sPanel_%d/orient=%d",
old_panel_cfg_path,num,
PANEL_HORIZONTAL);
g_snprintf(buf,256,"orient=%d", PANEL_HORIZONTAL);
config.orient=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sPanel_%d/mode=%d",
old_panel_cfg_path,num,
PANEL_EXPLICIT_HIDE);
g_snprintf(buf,256,"mode=%d", PANEL_EXPLICIT_HIDE);
config.mode=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sPanel_%d/state=%d",
old_panel_cfg_path,num,
PANEL_SHOWN);
g_snprintf(buf,256,"state=%d", PANEL_SHOWN);
state=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sPanel_%d/drawer_drop_zone_pos=%d",
old_panel_cfg_path,num,
DRAWER_LEFT);
g_snprintf(buf,256,"drawer_drop_zone_pos=%d", DRAWER_LEFT);
drop_pos=gnome_config_get_int(buf);
back_pixmap = gnome_config_get_string ("backpixmap=");
if (back_pixmap && *back_pixmap == 0)
back_pixmap = 0;
gnome_config_pop_prefix ();
panel = panel_widget_new(size,
config.orient,
config.snapped,
......@@ -756,7 +749,9 @@ init_user_panels(void)
state,
x,
y,
drop_pos);
drop_pos,
back_pixmap
);
panel_setup(PANEL_WIDGET(panel));
......
......@@ -39,6 +39,8 @@ set_snapped (GtkWidget *widget, gpointer data)
PanelSnapped snapped = (PanelSnapped) data;
panel_config_struct.snapped = snapped;
if (panel_config_struct.config_box)
gnome_property_box_changed (GNOME_PROPERTY_BOX (panel_config_struct.config_box));
}
static void
......@@ -47,6 +49,8 @@ set_mode (GtkWidget *widget, gpointer data)
PanelMode mode = (PanelMode) data;
panel_config_struct.mode = mode;
if (panel_config_struct.config_box)
gnome_property_box_changed (GNOME_PROPERTY_BOX (panel_config_struct.config_box));
}
static void
......@@ -56,10 +60,12 @@ set_toggle_button_value (GtkWidget *widget, gpointer data)
*(int *)data=TRUE;
else
*(int *)data=FALSE;
if (panel_config_struct.config_box)
gnome_property_box_changed (GNOME_PROPERTY_BOX (panel_config_struct.config_box));
}
static void
config_apply (GtkWidget *widget, gpointer data)
config_apply (GtkWidget *widget, int page, gpointer data)
{
PanelWidget *panel = data;
if(panel_config_struct.mode == PANEL_AUTO_HIDE) {
......@@ -79,17 +85,15 @@ config_apply (GtkWidget *widget, gpointer data)
}
}
/* FIXME: I think these should probly go in a notebook.. I have to
* give some thought as to the best way to present all these config
* options. Also, delay, and movement step size should be configurable. */
GtkWidget *
position_notebook_page(void)
position_notebook_page(GtkWidget *propertybox)
{
GtkWidget *frame;
GtkWidget *button;
GtkWidget *box;
GtkWidget *vbox;
panel_config_struct.config_box = 0;
/* main vbox */
vbox = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
......@@ -193,7 +197,9 @@ position_notebook_page(void)
}
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (button);
panel_config_struct.config_box = propertybox;
return (vbox);
}
......@@ -218,59 +224,25 @@ panel_config(PanelWidget *panel)
/* main window */
config_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect(GTK_OBJECT(config_window), "delete_event",
GTK_SIGNAL_FUNC (config_delete), NULL);
config_window = gnome_property_box_new ();
gtk_signal_connect(GTK_OBJECT(config_window), "destroy",
GTK_SIGNAL_FUNC (config_destroy), NULL);
gtk_window_set_title (GTK_WINDOW(config_window),
_("Panel Configuration"));
gtk_container_border_width (GTK_CONTAINER(config_window), CONFIG_PADDING_SIZE);
/* main vbox */
box1 = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_add(GTK_CONTAINER (config_window), box1);
gtk_widget_show(box1);
/* notebook */
notebook = gtk_notebook_new();
gtk_box_pack_start(GTK_BOX (box1), notebook, FALSE, FALSE, CONFIG_PADDING_SIZE);
gtk_widget_show(notebook);
/* label for Position notebook page */
label = gtk_label_new (_("Orientation"));
gtk_widget_show (label);
/* Position notebook page */
page = position_notebook_page ();
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
/* hbox for close and apply buttons */
box2 = gtk_hbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_box_pack_start(GTK_BOX (box1), box2, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (box2);
/* close button */
button = gtk_button_new_with_label(_("Close"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
(gpointer)config_window);
gtk_box_pack_start(GTK_BOX (box2), button, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (button);
/* apply button */
button = gtk_button_new_with_label(_("Apply"));
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (config_apply),
panel);
gtk_box_pack_start(GTK_BOX (box2), button, TRUE, TRUE,
CONFIG_PADDING_SIZE);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);
page = position_notebook_page (GNOME_PROPERTY_BOX (config_window));
gnome_property_box_append_page (GNOME_PROPERTY_BOX (config_window),
page, gtk_label_new (_("Orientation")));
gtk_signal_connect (GTK_OBJECT (config_window), "apply",
GTK_SIGNAL_FUNC (config_apply), panel);
gtk_widget_set_usize (config_window, 300, -1);
/* show main window */
gtk_widget_show (config_window);
}
......
......@@ -1361,7 +1361,8 @@ panel_widget_new (gint size,
PanelState state,
gint pos_x,
gint pos_y,
DrawerDropZonePos drop_zone_pos)
DrawerDropZonePos drop_zone_pos,
char *back_pixmap)
{
PanelWidget *panel;
gint i;
......@@ -1390,13 +1391,36 @@ panel_widget_new (gint size,
gtk_container_add(GTK_CONTAINER(panel),panel->table);
gtk_widget_show(panel->table);
gtk_widget_push_visual (gdk_imlib_get_visual ());
gtk_widget_push_colormap (gdk_imlib_get_colormap ());
panel->fixed = gtk_fixed_new();
gtk_widget_pop_colormap ();
gtk_widget_pop_visual ();
gtk_table_attach(GTK_TABLE(panel->table),panel->fixed,1,2,1,2,
GTK_FILL|GTK_EXPAND|GTK_SHRINK,
GTK_FILL|GTK_EXPAND|GTK_SHRINK,
0,0);
gtk_widget_show(panel->fixed);
gtk_widget_realize (panel->fixed);
if (g_file_exists (back_pixmap)){
GdkImlibImage *im;
GdkPixmap *p;
im = gdk_imlib_load_image (back_pixmap);
if (im){
gdk_imlib_render (im, im->rgb_width, im->rgb_height);
p = gdk_imlib_move_image (im);
gdk_window_set_back_pixmap (panel->fixed->window, p, 0);
gdk_imlib_free_pixmap (p);
gdk_imlib_destroy_image (im);
} else {
back_pixmap = 0;
}
}
panel->back_pixmap = back_pixmap;
/*we add all the hide buttons to the table here*/
/*EAST*/
panel->hidebutton_e=gtk_button_new();
......
......@@ -112,6 +112,7 @@ struct _PanelWidget
to block the autohide, until
it is 0 .. it's set by the
app not the widget*/
char *back_pixmap;
};
struct _PanelWidgetClass
......@@ -138,8 +139,9 @@ GtkWidget* panel_widget_new (gint size,
PanelState state,
gint pos_x,
gint pos_y,
DrawerDropZonePos
drop_zone_pos);
DrawerDropZonePos drop_zone_pos,
char *back_pixmap);
/*add an applet to the panel, preferably at position pos*/
gint panel_widget_add (PanelWidget *panel,
GtkWidget *applet,
......
/* Gnome panel: panel functionality
* (C) 1997 the Free Software Foundation
*
* Authors: Federico Mena
* Miguel de Icaza
* George Lebl
* Authors: George Lebl
* Federico Mena
* Miguel de Icaza
*/
#include <config.h>
......@@ -169,40 +169,26 @@ save_panel_configuration(gpointer data, gpointer user_data)
g_snprintf(path,256, "%sPanel_%d/", panel_cfg_path, (*num)++);
fullpath = g_copy_strings(path,"orient",NULL);
gnome_config_set_int(fullpath,panel->orient);
g_free(fullpath);
fullpath = g_copy_strings(path,"snapped",NULL);
gnome_config_set_int(fullpath,panel->snapped);
g_free(fullpath);
fullpath = g_copy_strings(path,"mode",NULL);
gnome_config_set_int(fullpath,panel->mode);
g_free(fullpath);
fullpath = g_copy_strings(path,"state",NULL);
gnome_config_set_int(fullpath,panel->state);
g_free(fullpath);
gnome_config_push_prefix (path);
gnome_config_set_int("orient",panel->orient);
gnome_config_set_int("snapped", panel->snapped);
gnome_config_set_int("mode", panel->mode);
gnome_config_set_int("state", panel->state);
gnome_config_set_int("size", panel->size);
fullpath = g_copy_strings(path,"size",NULL);
gnome_config_set_int(fullpath,panel->size);
g_free(fullpath);
if (panel->back_pixmap)
gnome_config_set_string("backpixmap", panel->back_pixmap ? panel->back_pixmap : "");
/*FIXME: this should be allocation.[xy] but those don't work!!!
probably a gtk bug*/
gdk_window_get_origin(GTK_WIDGET(panel)->window,&x,&y);
fullpath = g_copy_strings(path,"position_x",NULL);
gnome_config_set_int(fullpath,x);
g_free(fullpath);
fullpath = g_copy_strings(path,"position_y",NULL);
gnome_config_set_int(fullpath,y);
g_free(fullpath);
fullpath = g_copy_strings(path,"drawer_drop_zone_pos",NULL);
gnome_config_set_int(fullpath,panel->drawer_drop_zone_pos);
g_free(fullpath);
gnome_config_set_int("position_x",x);
gnome_config_set_int("position_y",y);
gnome_config_set_int("drawer_drop_zone_pos",panel->drawer_drop_zone_pos);
gnome_config_pop_prefix ();
}
static void
......@@ -243,27 +229,24 @@ panel_session_save (GnomeClient *client,
for(num=1,i=0;i<applet_count;i++)
save_applet_configuration(&g_array_index(applets,AppletInfo,i),
&num);
g_snprintf(buf,256,"%sConfig/applet_count",panel_cfg_path);
gnome_config_set_int(buf,num-1);
g_snprintf(buf, 256, "%sConfig", panel_cfg_path);
gnome_config_push_prefix (buf);
gnome_config_set_int ("/applet_count", num-1);
num = 1;
g_list_foreach(panels,save_panel_configuration,&num);
g_snprintf(buf,256,"%sConfig/panel_count",panel_cfg_path);
gnome_config_set_int(buf,num-1);
g_list_foreach(panels, save_panel_configuration,&num);
gnome_config_set_int("panel_count",num-1);
/*global options*/
g_snprintf(buf,256,"%sConfig/auto_hide_step_size",panel_cfg_path);
gnome_config_set_int(buf, global_config.auto_hide_step_size);
g_snprintf(buf,256,"%sConfig/explicit_hide_step_size",panel_cfg_path);
gnome_config_set_int(buf, global_config.explicit_hide_step_size);
g_snprintf(buf,256,"%sConfig/minimized_size",panel_cfg_path);
gnome_config_set_int(buf, global_config.minimized_size);
g_snprintf(buf,256,"%sConfig/minimize_delay",panel_cfg_path);
gnome_config_set_int(buf, global_config.minimize_delay);
g_snprintf(buf,256,"%sConfig/tooltips_enabled",panel_cfg_path);
gnome_config_set_bool(buf, global_config.tooltips_enabled);
g_snprintf(buf,256,"%sConfig/show_small_icons",panel_cfg_path);
gnome_config_set_bool(buf, global_config.show_small_icons);
gnome_config_set_int("auto_hide_step_size", global_config.auto_hide_step_size);
gnome_config_set_int("explicit_hide_step_size", global_config.explicit_hide_step_size);
gnome_config_set_int("minimized_size", global_config.minimized_size);
gnome_config_set_int("minimize_delay", global_config.minimize_delay);
gnome_config_set_bool("tooltips_enabled", global_config.tooltips_enabled);
gnome_config_set_bool("show_small_icons", global_config.show_small_icons);
gnome_config_pop_prefix ();
gnome_config_sync();
if(is_shutdown) {
......
......@@ -28,12 +28,12 @@ BEGIN_GNOME_DECLS
#define PANEL_UNKNOWN_STEP_SIZE -1
typedef struct _PanelConfig PanelConfig;
struct _PanelConfig {
typedef struct {
PanelOrientation orient;
PanelSnapped snapped;
PanelMode mode;
};
PanelSnapped snapped;
PanelMode mode;
GtkWidget *config_box;
} PanelConfig;
typedef enum {
APPLET_EXTERN,
......
......@@ -39,6 +39,8 @@ set_snapped (GtkWidget *widget, gpointer data)
PanelSnapped snapped = (PanelSnapped) data;
panel_config_struct.snapped = snapped;
if (panel_config_struct.config_box)
gnome_property_box_changed (GNOME_PROPERTY_BOX (panel_config_struct.config_box));
}
static void
......@@ -47,6 +49,8 @@ set_mode (GtkWidget *widget, gpointer data)
PanelMode mode = (PanelMode) data;
panel_config_struct.mode = mode;
if (panel_config_struct.config_box)
gnome_property_box_changed (GNOME_PROPERTY_BOX (panel_config_struct.config_box));
}
static void
......@@ -56,10 +60,12 @@ set_toggle_button_value (GtkWidget *widget, gpointer data)
*(int *)data=TRUE;
else
*(int *)data=FALSE;
if (panel_config_struct.config_box)
gnome_property_box_changed (GNOME_PROPERTY_BOX (panel_config_struct.config_box));
}
static void
config_apply (GtkWidget *widget, gpointer data)
config_apply (GtkWidget *widget, int page, gpointer data)
{
PanelWidget *panel = data;
if(panel_config_struct.mode == PANEL_AUTO_HIDE) {
......@@ -79,17 +85,15 @@ config_apply (GtkWidget *widget, gpointer data)
}
}
/* FIXME: I think these should probly go in a notebook.. I have to
* give some thought as to the best way to present all these config
* options. Also, delay, and movement step size should be configurable. */
GtkWidget *
position_notebook_page(void)
position_notebook_page(GtkWidget *propertybox)
{
GtkWidget *frame;
GtkWidget *button;
GtkWidget *box;
GtkWidget *vbox;
panel_config_struct.config_box = 0;
/* main vbox */
vbox = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
......@@ -193,7 +197,9 @@ position_notebook_page(void)
}
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (button);
panel_config_struct.config_box = propertybox;
return (vbox);
}
......@@ -218,59 +224,25 @@ panel_config(PanelWidget *panel)
/* main window */
config_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect(GTK_OBJECT(config_window), "delete_event",
GTK_SIGNAL_FUNC (config_delete), NULL);
config_window = gnome_property_box_new ();
gtk_signal_connect(GTK_OBJECT(config_window), "destroy",
GTK_SIGNAL_FUNC (config_destroy), NULL);
gtk_window_set_title (GTK_WINDOW(config_window),
_("Panel Configuration"));
gtk_container_border_width (GTK_CONTAINER(config_window), CONFIG_PADDING_SIZE);
/* main vbox */
box1 = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_add(GTK_CONTAINER (config_window), box1);
gtk_widget_show(box1);
/* notebook */
notebook = gtk_notebook_new();
gtk_box_pack_start(GTK_BOX (box1), notebook, FALSE, FALSE, CONFIG_PADDING_SIZE);
gtk_widget_show(notebook);
/* label for Position notebook page */
label = gtk_label_new (_("Orientation"));
gtk_widget_show (label);
/* Position notebook page */
page = position_notebook_page ();
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
/* hbox for close and apply buttons */
box2 = gtk_hbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_box_pack_start(GTK_BOX (box1), box2, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (box2);
/* close button */
button = gtk_button_new_with_label(_("Close"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
(gpointer)config_window);
gtk_box_pack_start(GTK_BOX (box2), button, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (button);
/* apply button */
button = gtk_button_new_with_label(_("Apply"));
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (config_apply),
panel);
gtk_box_pack_start(GTK_BOX (box2), button, TRUE, TRUE,
CONFIG_PADDING_SIZE);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);
page = position_notebook_page (GNOME_PROPERTY_BOX (config_window));
gnome_property_box_append_page (GNOME_PROPERTY_BOX (config_window),
page, gtk_label_new (_("Orientation")));
gtk_signal_connect (GTK_OBJECT (config_window), "apply",
GTK_SIGNAL_FUNC (config_apply), panel);
gtk_widget_set_usize (config_window, 300, -1);
/* show main window */
gtk_widget_show (config_window);
}
......
......@@ -22,17 +22,11 @@ extern GList *panels;
static GtkWidget *config_window;
static gint
config_delete (GtkWidget *widget, gpointer data)
{
/* allow window destroy */
return TRUE;
}
static void
static int
config_destroy(GtkWidget *widget, gpointer data)
{
config_window = NULL;
config_window = NULL;
return FALSE;
}
static void
......@@ -42,11 +36,12 @@ set_toggle_button_value (GtkWidget *widget, gpointer data)
*(int *)data=TRUE;
else
*(int *)data=FALSE;
gnome_property_box_changed (GNOME_PROPERTY_BOX (config_window));
}
static void
config_apply (GtkWidget *widget, gpointer data)
config_apply (GtkWidget *widget, int page, gpointer data)
{
global_config.minimize_delay = temp_config.minimize_delay;
global_config.minimized_size = temp_config.minimized_size;
......@@ -65,6 +60,7 @@ gint_scale_update (GtkAdjustment *adjustment, gpointer data)
gint *val = data;
double scale_val = adjustment->value;
*val = (gint) scale_val;
gnome_property_box_changed (GNOME_PROPERTY_BOX (config_window));
}
GtkWidget *
......@@ -239,67 +235,28 @@ panel_config_global(void)
temp_config.show_small_icons = global_config.show_small_icons;
/* main window */
config_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect(GTK_OBJECT(config_window), "delete_event",
GTK_SIGNAL_FUNC (config_delete), NULL);
config_window = gnome_property_box_new ();
gtk_signal_connect(GTK_OBJECT(config_window), "destroy",
GTK_SIGNAL_FUNC (config_destroy), NULL);
gtk_signal_connect (GTK_OBJECT (config_window), "delete_event",
GTK_SIGNAL_FUNC (config_destroy), NULL);
gtk_window_set_title (GTK_WINDOW(config_window),
_("Global Panel Configuration"));
gtk_container_border_width (GTK_CONTAINER(config_window), CONFIG_PADDING_SIZE);
/* main vbox */
box1 = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_add(GTK_CONTAINER (config_window), box1);
gtk_widget_show(box1);
/* notebook */
notebook = gtk_notebook_new();
gtk_box_pack_start(GTK_BOX (box1), notebook, FALSE, FALSE, CONFIG_PADDING_SIZE);
gtk_widget_show(notebook);
/* label for Animation notebook page */
label = gtk_label_new (_("Animation settings"));
gtk_widget_show (label);
/* Animation notebook page */
page = animation_notebook_page ();
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
gnome_property_box_append_page (GNOME_PROPERTY_BOX (config_window),
page, gtk_label_new (_("Animation settings")));
/* label for Miscellaneous notebook page */
label = gtk_label_new (_("Miscellaneous"));
gtk_widget_show (label);
/* Miscellaneous notebook page */
page = misc_notebook_page ();
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
gnome_property_box_append_page (GNOME_PROPERTY_BOX (config_window),
page, gtk_label_new (_("Miscellaneous")));
/* hbox for close and apply buttons */
box2 = gtk_hbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_box_pack_start(GTK_BOX (box1), box2, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (box2);
/* close button */
button = gtk_button_new_with_label(_("Close"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
(gpointer)config_window);
gtk_box_pack_start(GTK_BOX (box2), button, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (button);
gtk_signal_connect (GTK_OBJECT (config_window), "apply",
GTK_SIGNAL_FUNC (config_apply), NULL);
/* apply button */
button = gtk_button_new_with_label(_("Apply"));
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (config_apply),
NULL);
gtk_box_pack_start(GTK_BOX (box2), button, TRUE, TRUE,
CONFIG_PADDING_SIZE);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);
gtk_widget_set_usize (config_window, 300, -1);
/* show main window */
gtk_widget_show (config_window);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment