Commit 2d727738 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

fixed some braindamages, switch between, color, pixmap and standard

Thu Jun 04 00:32:50 1998  George Lebl  <jirka@5z.com>

        * panel_config.c: fixed some braindamages, switch between,
          color, pixmap and standard backgrounds, added a color selector

        * panel-widget.[ch]: added a background type variable and support
          the above changes, fix some some braindamages, scale the back
	  pixmap when needed (needs to be optimized but it works for now)

        * main.c,panel.[ch]: support for the above

        * gnome-panel.idl (and all corba files): added a sync corba call
          so that applets can force a save of the session

        * panel_config.c, panel_config_global.c: sync the configuration after
          apply

        * panel.c, main.c: add a timeout to sync every 10 seconds if something
          has changed

originally this was supposed to go in after the freeze, but since it fixes
so many braindamages with the way the backgrounds (they were kind of hacked in
before)

this adresses bugs #50 (kind of) and #166, plus a few others which
aren't on the bug tracker (but which I've had on my todo list:)
parent 784f8509
Thu Jun 04 00:32:50 1998 George Lebl <jirka@5z.com>
* panel_config.c: fixed some braindamages, switch between,
color, pixmap and standard backgrounds, added a color selector
* panel-widget.[ch]: added a background type variable and support
teh above changes, fix some some braindamages
* main.c,panel.[ch]: support for the above
* gnome-panel.idl (and all corba files): added a sync corba call
so that applets can force a save of the session
* panel_config.c, panel_config_global.c: sync the configuration after
apply
* panel.c, main.c: add a timeout to sync every 10 seconds if something
has changed
1998-06-03 Federico Mena Quintero <federico@nuclecu.unam.mx> 1998-06-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* panel-widget.c (panel_try_to_set_back_color): Destroy the pixmap * panel-widget.c (panel_try_to_set_back_color): Destroy the pixmap
......
Thu Jun 04 00:32:50 1998 George Lebl <jirka@5z.com>
* panel_config.c: fixed some braindamages, switch between,
color, pixmap and standard backgrounds, added a color selector
* panel-widget.[ch]: added a background type variable and support
teh above changes, fix some some braindamages
* main.c,panel.[ch]: support for the above
* gnome-panel.idl (and all corba files): added a sync corba call
so that applets can force a save of the session
* panel_config.c, panel_config_global.c: sync the configuration after
apply
* panel.c, main.c: add a timeout to sync every 10 seconds if something
has changed
1998-06-03 Federico Mena Quintero <federico@nuclecu.unam.mx> 1998-06-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* panel-widget.c (panel_try_to_set_back_color): Destroy the pixmap * panel-widget.c (panel_try_to_set_back_color): Destroy the pixmap
......
...@@ -550,6 +550,16 @@ gnome_panel_applet_cleanup(gint applet_id) ...@@ -550,6 +550,16 @@ gnome_panel_applet_cleanup(gint applet_id)
} }
char *
gnome_panel_sync_config (void)
{
char *result;
panel_client->sync_config (cookie);
return 0;
}
char * char *
gnome_panel_quit (void) gnome_panel_quit (void)
{ {
......
...@@ -25,6 +25,7 @@ char *gnome_panel_applet_remove_from_panel (gint applet_id); ...@@ -25,6 +25,7 @@ char *gnome_panel_applet_remove_from_panel (gint applet_id);
char *gnome_panel_applet_request_glob_cfg (char **globcfgpath); char *gnome_panel_applet_request_glob_cfg (char **globcfgpath);
gint gnome_panel_applet_get_panel_orient (gint applet_id); gint gnome_panel_applet_get_panel_orient (gint applet_id);
char *gnome_panel_quit (void); char *gnome_panel_quit (void);
char *gnome_panel_sync_config (void);
int gnome_panel_applet_init_corba (void); int gnome_panel_applet_init_corba (void);
int gnome_panel_applet_reinit_corba (void); int gnome_panel_applet_reinit_corba (void);
void gnome_panel_applet_register_callback (gint applet_id, void gnome_panel_applet_register_callback (gint applet_id,
......
...@@ -163,6 +163,12 @@ applet_widget_remove_from_panel(AppletWidget *applet) ...@@ -163,6 +163,12 @@ applet_widget_remove_from_panel(AppletWidget *applet)
gnome_panel_applet_remove_from_panel(applet->applet_id); gnome_panel_applet_remove_from_panel(applet->applet_id);
} }
void
applet_widget_sync_config(void)
{
gnome_panel_sync_config();
}
void void
applet_widget_register_callback(AppletWidget *applet, applet_widget_register_callback(AppletWidget *applet,
char *name, char *name,
......
...@@ -114,10 +114,13 @@ AppletWidget* applet_widget_get_by_id (gint applet_id); ...@@ -114,10 +114,13 @@ AppletWidget* applet_widget_get_by_id (gint applet_id);
/*get thenumber of applets*/ /*get thenumber of applets*/
gint applet_widget_get_applet_count (void); gint applet_widget_get_applet_count (void);
/*tell the panel to save the session here (just saves no shutdown)*/
void applet_widget_sync_config (void);
/* Get the oprientation the applet should use */ /* Get the oprientation the applet should use */
PanelOrientType applet_widget_get_panel_orient (AppletWidget *applet); PanelOrientType applet_widget_get_panel_orient (AppletWidget *applet);
/*use this instead of gnome init, if you want multi applet, you also /*use this instead of gnome init, if you want multi applet, you also
have to specify a "start new applet" function which will launch a new have to specify a "start new applet" function which will launch a new
applet*/ applet*/
......
...@@ -173,40 +173,40 @@ create_empty_drawer_applet(PanelOrientType orient) ...@@ -173,40 +173,40 @@ create_empty_drawer_applet(PanelOrientType orient)
PANEL_VERTICAL, PANEL_VERTICAL,
PANEL_DRAWER, PANEL_DRAWER,
PANEL_EXPLICIT_HIDE, PANEL_EXPLICIT_HIDE,
TRUE,
PANEL_SHOWN, PANEL_SHOWN,
0, 0, 0, 0,
DROP_ZONE_LEFT, NULL, NULL), DROP_ZONE_LEFT,
PANEL_BACK_NONE, NULL, TRUE, NULL),
orient); orient);
case ORIENT_DOWN: case ORIENT_DOWN:
return create_drawer_applet(panel_widget_new(0, return create_drawer_applet(panel_widget_new(0,
PANEL_VERTICAL, PANEL_VERTICAL,
PANEL_DRAWER, PANEL_DRAWER,
PANEL_EXPLICIT_HIDE, PANEL_EXPLICIT_HIDE,
TRUE,
PANEL_SHOWN, PANEL_SHOWN,
0, 0, 0, 0,
DROP_ZONE_RIGHT, NULL, NULL), DROP_ZONE_RIGHT,
PANEL_BACK_NONE, NULL, TRUE, NULL),
orient); orient);
case ORIENT_LEFT: case ORIENT_LEFT:
return create_drawer_applet(panel_widget_new(0, return create_drawer_applet(panel_widget_new(0,
PANEL_HORIZONTAL, PANEL_HORIZONTAL,
PANEL_DRAWER, PANEL_DRAWER,
PANEL_EXPLICIT_HIDE, PANEL_EXPLICIT_HIDE,
TRUE,
PANEL_SHOWN, PANEL_SHOWN,
0, 0, 0, 0,
DROP_ZONE_LEFT, NULL, NULL), DROP_ZONE_LEFT,
PANEL_BACK_NONE, NULL, TRUE, NULL),
orient); orient);
case ORIENT_RIGHT: case ORIENT_RIGHT:
return create_drawer_applet(panel_widget_new(0, return create_drawer_applet(panel_widget_new(0,
PANEL_HORIZONTAL, PANEL_HORIZONTAL,
PANEL_DRAWER, PANEL_DRAWER,
PANEL_EXPLICIT_HIDE, PANEL_EXPLICIT_HIDE,
TRUE,
PANEL_SHOWN, PANEL_SHOWN,
0, 0, 0, 0,
DROP_ZONE_RIGHT, NULL, NULL), DROP_ZONE_RIGHT,
PANEL_BACK_NONE, NULL, TRUE, NULL),
orient); orient);
} }
return NULL; return NULL;
...@@ -223,43 +223,39 @@ set_drawer_applet_orient(Drawer *drawer, PanelOrientType orient) ...@@ -223,43 +223,39 @@ set_drawer_applet_orient(Drawer *drawer, PanelOrientType orient)
drawer->orient = orient; drawer->orient = orient;
switch (drawer->orient) { switch (drawer->orient) {
case ORIENT_DOWN: case ORIENT_DOWN:
pixmap_name = gnome_unconditional_pixmap_file( pixmap_name = gnome_unconditional_pixmap_file("gnome-menu-down.png");
"gnome-menu-down.png"); panel_widget_change_orient(PANEL_WIDGET(drawer->drawer),
panel_widget_change_orient(PANEL_WIDGET(drawer->drawer), PANEL_VERTICAL);
PANEL_VERTICAL); panel_widget_change_drop_zone_pos(PANEL_WIDGET(drawer->
panel_widget_change_drop_zone_pos(PANEL_WIDGET(drawer-> drawer),
drawer), DROP_ZONE_RIGHT);
DROP_ZONE_RIGHT);
break;
break; case ORIENT_UP:
case ORIENT_UP: pixmap_name = gnome_unconditional_pixmap_file("gnome-menu-up.png");
pixmap_name = gnome_unconditional_pixmap_file( panel_widget_change_orient(PANEL_WIDGET(drawer->drawer),
"gnome-menu-up.png"); PANEL_VERTICAL);
panel_widget_change_orient(PANEL_WIDGET(drawer->drawer), panel_widget_change_drop_zone_pos(PANEL_WIDGET(drawer->
PANEL_VERTICAL); drawer),
panel_widget_change_drop_zone_pos(PANEL_WIDGET(drawer-> DROP_ZONE_LEFT);
drawer), break;
DROP_ZONE_LEFT); case ORIENT_RIGHT:
break; pixmap_name = gnome_unconditional_pixmap_file("gnome-menu-right.png");
case ORIENT_RIGHT: panel_widget_change_orient(PANEL_WIDGET(drawer->drawer),
pixmap_name = gnome_unconditional_pixmap_file( PANEL_HORIZONTAL);
"gnome-menu-right.png"); panel_widget_change_drop_zone_pos(PANEL_WIDGET(drawer->
panel_widget_change_orient(PANEL_WIDGET(drawer->drawer), drawer),
PANEL_HORIZONTAL); DROP_ZONE_RIGHT);
panel_widget_change_drop_zone_pos(PANEL_WIDGET(drawer-> break;
drawer), case ORIENT_LEFT:
DROP_ZONE_RIGHT); pixmap_name = gnome_unconditional_pixmap_file("gnome-menu-left.png");
break; panel_widget_change_orient(PANEL_WIDGET(drawer->drawer),
case ORIENT_LEFT: PANEL_HORIZONTAL);
pixmap_name = gnome_unconditional_pixmap_file( panel_widget_change_drop_zone_pos(PANEL_WIDGET(drawer->
"gnome-menu-left.png"); drawer),
panel_widget_change_orient(PANEL_WIDGET(drawer->drawer), DROP_ZONE_LEFT);
PANEL_HORIZONTAL); break;
panel_widget_change_drop_zone_pos(PANEL_WIDGET(drawer->
drawer),
DROP_ZONE_LEFT);
break;
} }
pixmap=GTK_BUTTON(drawer->button)->child; pixmap=GTK_BUTTON(drawer->button)->child;
......
...@@ -42,7 +42,8 @@ module GNOME { ...@@ -42,7 +42,8 @@ module GNOME {
void applet_remove_tooltip (in string cookie, void applet_remove_tooltip (in string cookie,
in short applet_id); in short applet_id);
short applet_in_drag (in string cookie); short applet_in_drag (in string cookie);
void quit(in string cookie); void sync_config (in string cookie);
void quit (in string cookie);
}; };
interface Applet { interface Applet {
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
yes I am too lazy to get the events to work*/ yes I am too lazy to get the events to work*/
static gint panel_dragged = 0; static gint panel_dragged = 0;
gint config_sync_timeout = 0;
gint config_changed = FALSE;
GArray *applets; GArray *applets;
gint applet_count; gint applet_count;
...@@ -120,15 +123,15 @@ static error_t parse_an_arg (int key, char *arg, struct argp_state *state); ...@@ -120,15 +123,15 @@ static error_t parse_an_arg (int key, char *arg, struct argp_state *state);
options for how our parsing function should be called. */ options for how our parsing function should be called. */
static struct argp parser = static struct argp parser =
{ {
arguments, /* Options. */ arguments, /* Options. */
parse_an_arg, /* The parser function. */ parse_an_arg, /* The parser function. */
NULL, /* Some docs. */ NULL, /* Some docs. */
NULL, /* Some more docs. */ NULL, /* Some more docs. */
NULL, /* Child arguments -- gnome_init fills NULL, /* Child arguments -- gnome_init fills
this in for us. */ this in for us. */
NULL, /* Help filter. */ NULL, /* Help filter. */
NULL /* Translation domain; for the app it NULL /* Translation domain; for the app it
can always be NULL. */ can always be NULL. */
}; };
...@@ -356,9 +359,11 @@ load_applet(gchar *id_str, gchar *path, gchar *params, ...@@ -356,9 +359,11 @@ load_applet(gchar *id_str, gchar *path, gchar *params,
param = params; param = params;
if(!cfgpath || !*cfgpath) if(!cfgpath || !*cfgpath)
/*FIXME: fix this minor leak*/
cfgpath = g_copy_strings(old_panel_cfg_path, cfgpath = g_copy_strings(old_panel_cfg_path,
"Applet_Dummy/",NULL); "Applet_Dummy/",NULL);
else
/*we will free this lateer*/
cfgpath = g_strdup(cfgpath);
/*VERY UGLY compatibility hack for the old launcher applet*/ /*VERY UGLY compatibility hack for the old launcher applet*/
if(strcmp(path,"#panel.application.launcher")==0) { if(strcmp(path,"#panel.application.launcher")==0) {
...@@ -368,6 +373,7 @@ load_applet(gchar *id_str, gchar *path, gchar *params, ...@@ -368,6 +373,7 @@ load_applet(gchar *id_str, gchar *path, gchar *params,
g_free(p); g_free(p);
load_applet(LAUNCHER_ID,NULL,fullpath,pos,panel, load_applet(LAUNCHER_ID,NULL,fullpath,pos,panel,
cfgpath); cfgpath);
g_free(cfgpath);
g_free(fullpath); g_free(fullpath);
return; return;
} }
...@@ -386,6 +392,7 @@ load_applet(gchar *id_str, gchar *path, gchar *params, ...@@ -386,6 +392,7 @@ load_applet(gchar *id_str, gchar *path, gchar *params,
g_warning("Whoops! for some reason we can't add " g_warning("Whoops! for some reason we can't add "
"to the panel"); "to the panel");
g_free(fullpath); g_free(fullpath);
g_free(cfgpath);
return; return;
} }
...@@ -394,6 +401,7 @@ load_applet(gchar *id_str, gchar *path, gchar *params, ...@@ -394,6 +401,7 @@ load_applet(gchar *id_str, gchar *path, gchar *params,
if(path[0]!='#') if(path[0]!='#')
exec_prog(applet_count-1,fullpath,param); exec_prog(applet_count-1,fullpath,param);
g_free(cfgpath);
g_free(fullpath); g_free(fullpath);
} else if(strcmp(id_str,MENU_ID) == 0) { } else if(strcmp(id_str,MENU_ID) == 0) {
Menu *menu; Menu *menu;
...@@ -628,6 +636,7 @@ panel_orient_change(GtkWidget *widget, ...@@ -628,6 +636,7 @@ panel_orient_change(GtkWidget *widget,
{ {
panel_widget_foreach(PANEL_WIDGET(widget),orient_change_foreach, panel_widget_foreach(PANEL_WIDGET(widget),orient_change_foreach,
(gpointer)widget); (gpointer)widget);
config_changed = TRUE;
return TRUE; return TRUE;
} }
...@@ -675,6 +684,8 @@ panel_state_change(GtkWidget *widget, ...@@ -675,6 +684,8 @@ panel_state_change(GtkWidget *widget,
panel_widget_foreach(PANEL_WIDGET(widget),state_hide_foreach, panel_widget_foreach(PANEL_WIDGET(widget),state_hide_foreach,
(gpointer)widget); (gpointer)widget);
config_changed = TRUE;
return TRUE; return TRUE;
} }
...@@ -687,6 +698,7 @@ panel_size_allocate(GtkWidget *widget, GtkAllocation *alloc, gpointer data) ...@@ -687,6 +698,7 @@ panel_size_allocate(GtkWidget *widget, GtkAllocation *alloc, gpointer data)
if(drawer) if(drawer)
if(panel->state == PANEL_SHOWN) if(panel->state == PANEL_SHOWN)
reposition_drawer(drawer); reposition_drawer(drawer);
config_changed = TRUE;
return FALSE; return FALSE;
} }
...@@ -703,6 +715,8 @@ panel_applet_added_idle(gpointer data) ...@@ -703,6 +715,8 @@ panel_applet_added_idle(gpointer data)
orientation_change(ai->applet_id,ai->panel); orientation_change(ai->applet_id,ai->panel);
g_free(ai); g_free(ai);
config_changed = TRUE;
return FALSE; return FALSE;
} }
...@@ -726,6 +740,7 @@ panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data) ...@@ -726,6 +740,7 @@ panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data)
static gint static gint
panel_applet_removed(GtkWidget *widget, gpointer data) panel_applet_removed(GtkWidget *widget, gpointer data)
{ {
config_changed = TRUE;
return TRUE; return TRUE;
} }
...@@ -818,10 +833,12 @@ panel_move(PanelWidget *panel, double x, double y) ...@@ -818,10 +833,12 @@ panel_move(PanelWidget *panel, double x, double y)
panel->orient, panel->orient,
newloc, newloc,
panel->mode, panel->mode,
panel->fit_pixmap_bg,
panel->state, panel->state,
panel->drawer_drop_zone_pos, panel->drawer_drop_zone_pos,
panel->back_pixmap ); panel->back_type,
panel->back_pixmap,
panel->fit_pixmap_bg,
&panel->back_color);
while(gtk_events_pending()) while(gtk_events_pending())
gtk_main_iteration(); gtk_main_iteration();
} }
...@@ -932,6 +949,7 @@ static void ...@@ -932,6 +949,7 @@ static void
panel_applet_move(GtkWidget *panel,GtkWidget *widget, gpointer data) panel_applet_move(GtkWidget *panel,GtkWidget *widget, gpointer data)
{ {
applet_move_foreach(widget,NULL); applet_move_foreach(widget,NULL);
config_changed = TRUE;
} }
...@@ -1010,8 +1028,9 @@ init_user_panels(void) ...@@ -1010,8 +1028,9 @@ init_user_panels(void)
GtkWidget *panel; GtkWidget *panel;
PanelState state; PanelState state;
DrawerDropZonePos drop_pos; DrawerDropZonePos drop_pos;
char *back_pixmap, *tmp; PanelBackType back_type;
GdkColor back_color; char *back_pixmap, *color;
GdkColor back_color = {0,0,0,1};
g_snprintf(buf,256,"%sConfig/panel_count=0",old_panel_cfg_path); g_snprintf(buf,256,"%sConfig/panel_count=0",old_panel_cfg_path);
count=gnome_config_get_int(buf); count=gnome_config_get_int(buf);
...@@ -1054,30 +1073,42 @@ init_user_panels(void) ...@@ -1054,30 +1073,42 @@ init_user_panels(void)
drop_pos=gnome_config_get_int(buf); drop_pos=gnome_config_get_int(buf);
back_pixmap = gnome_config_get_string ("backpixmap="); back_pixmap = gnome_config_get_string ("backpixmap=");
if (back_pixmap && *back_pixmap == 0) if (back_pixmap && *back_pixmap == '\0') {
g_free(back_pixmap);
back_pixmap = NULL; back_pixmap = NULL;
}
tmp = gnome_config_get_string("backcolor"); color = gnome_config_get_string("backcolor=#ffffff");
if(tmp && *tmp) { if(color && *color)
g_print("tmp for color = %s\n", tmp); gdk_color_parse(color, &back_color);
gdk_color_parse(tmp, &back_color);
back_color.pixel = 1; /*minor hack to keep older config file compatibility, if we get 999, we
} else try to guess this*/
back_color.pixel = 0; back_type=gnome_config_get_int("back_type=999");
g_free(tmp); if(back_type == 999) {
if(back_pixmap && *back_pixmap)
back_type = PANEL_BACK_PIXMAP;
else if(strcmp(color,"#ffffff")!=0)
back_type = PANEL_BACK_COLOR;
else
back_type = PANEL_BACK_NONE;
}
gnome_config_pop_prefix (); gnome_config_pop_prefix ();
panel = panel_widget_new(size, panel = panel_widget_new(size,
config.orient, config.orient,
config.snapped, config.snapped,
config.mode, config.mode,
config.fit_pixmap_bg,
state, state,
x, x,
y, y,
drop_pos, drop_pos,
back_type,
back_pixmap, back_pixmap,
back_color.pixel?&back_color:NULL); config.fit_pixmap_bg,
&back_color);
g_free(color);
g_free(back_pixmap);
panel_widget_disable_buttons(PANEL_WIDGET(panel)); panel_widget_disable_buttons(PANEL_WIDGET(panel));
...@@ -1096,30 +1127,29 @@ init_user_panels(void) ...@@ -1096,30 +1127,29 @@ init_user_panels(void)
void void
discard_session (gchar *id) discard_session (gchar *id)
{ {
gchar *sess; gchar *sess;
sess = g_copy_strings ("/panel-Session-", id, NULL); sess = g_copy_strings ("/panel-Session-", id, NULL);
gnome_config_clean_file (sess); gnome_config_clean_file (sess);
gnome_config_sync (); gnome_config_sync ();
g_free (sess); g_free (sess);
return; return;
} }
static error_t static error_t
parse_an_arg (int key, char *arg, struct argp_state *state) parse_an_arg (int key, char *arg, struct argp_state *state)
{ {
if (key == DISCARD_KEY) if (key == DISCARD_KEY) {
{ discard_session (arg);
discard_session (arg); just_exit = 1;
just_exit = 1; return 0;
return 0; }
}
/* We didn't recognize it. */
/* We didn't recognize it. */ return ARGP_ERR_UNKNOWN;
return ARGP_ERR_UNKNOWN;
} }
static void static void
...@@ -1170,6 +1200,15 @@ sigchld_handler(int type) ...@@ -1170,6 +1200,15 @@ sigchld_handler(int type)
} }
} }
static gint
try_config_sync(gpointer data)
{
if(config_changed)
panel_sync_config();
config_changed = FALSE;
return TRUE;
}
int int
main(int argc, char **argv) main(int argc, char **argv)
...@@ -1269,6 +1308,10 @@ main(int argc, char **argv) ...@@ -1269,6 +1308,10 @@ main(int argc, char **argv)
load_queued_applets(); load_queued_applets();
add_forbidden_to_panels(); add_forbidden_to_panels();
/*attempt to sync the config every 10 seconds, only if a change was
indicated though*/
config_sync_timeout = gtk_timeout_add(10*1000,try_config_sync,NULL);
/* I use the glue code to avoid making this a C++ file */ /* I use the glue code to avoid making this a C++ file */
panel_corba_gtk_main ("IDL:GNOME/Panel:1.0"); panel_corba_gtk_main ("IDL:GNOME/Panel:1.0");
......
...@@ -131,6 +131,10 @@ public: ...@@ -131,6 +131,10 @@ public:
CHECK_COOKIE_V (FALSE); CHECK_COOKIE_V (FALSE);
return panel_applet_in_drag; return panel_applet_in_drag;
} }
void sync_config(const char *ccookie) {
CHECK_COOKIE ();
::panel_sync_config();
}
void quit(const char *ccookie) { void quit(const char *ccookie) {
CHECK_COOKIE (); CHECK_COOKIE ();
::panel_quit(); ::panel_quit();
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
/* Used for all the packing and padding options */ /* Used for all the packing and padding options */
#define CONFIG_PADDING_SIZE 3 #define CONFIG_PADDING_SIZE 3
/* used to temporarily store config values until the 'Apply' /* used to temporarily store config values until the 'Apply'
* button is pressed. */ * button is pressed. */
PanelConfig panel_config_struct; PanelConfig panel_config_struct;
...@@ -30,8 +29,9 @@ config_delete (GtkWidget *widget, gpointer data) ...@@ -30,8 +29,9 @@ config_delete (GtkWidget *widget, gpointer data)
static void static void
config_destroy(GtkWidget *widget, gpointer data) config_destroy(GtkWidget *widget, gpointer data)
{ {
config_window = NULL; config_window = NULL;
panel_config_struct.config_box = 0; panel_config_struct.config_box = 0;
g_free(panel_config_struct.back_pixmap);
} }
static gint static gint
...@@ -78,23 +78,20 @@ static void ...@@ -78,23 +78,20 @@ static void
config_apply (GtkWidget *widget, int page, gpointer data) config_apply (GtkWidget *widget, int page, gpointer data)
{ {
PanelWidget *panel = data; PanelWidget *panel = data;
char *back_pixmap;
if(panel_config_struct.pixmap_enable)
back_pixmap = GTK_ENTRY (gnome_file_entry_gtk_entry (
GNOME_FILE_ENTRY (file_entry)))->text;
else
back_pixmap = "";
panel_widget_change_params(panel, panel_widget_change_params(panel,
panel_config_struct.orient, panel_config_struct.orient,
panel_config_struct.snapped, panel_config_struct.snapped,
panel_config_struct.mode, panel_config_struct.mode,
panel_config_struct.fit_pixmap_bg,
panel->state, panel->state,
panel->drawer_drop_zone_pos, panel->drawer_drop_zone_pos,
back_pixmap); panel_config_struct.back_type,
panel_config_struct.back_pixmap,
panel_config_struct.fit_pixmap_bg,
&panel_config_struct.back_color);
gtk_widget_queue_draw (GTK_WIDGET (panel)); gtk_widget_queue_draw (GTK_WIDGET (panel));
panel_sync_config();
} }
GtkWidget * GtkWidget *
...@@ -211,75 +208,124 @@ align (GtkWidget *w, float x) ...@@ -211,75 +208,124 @@ align (GtkWidget *w, float x)
} }
static gint static gint
value_changed () value_changed (GtkWidget *w, gpointer data)
{ {
g_free(panel_config_struct.back_pixmap);
panel_config_struct.back_pixmap =</