Commit cd056ea4 authored by jtl's avatar jtl

Added configurable hidebuttons for drawers much like for snapped panels

parent 4f935ea1
1998-10-25 Jens Lautenbacher <jens@tellux.de>
* drawer-widget.[hc], drawer.[ch], panel.c, panel_config.[ch],
session.c: Added configurable hidebuttons for drawers much like
those for snapped panels.
Wed Oct 21 11:41:44 1998 Owen Taylor <otaylor@redhat.com>
* panel.c menu.c: Added the ability to drag launchers applets
......
1998-10-25 Jens Lautenbacher <jens@tellux.de>
* drawer-widget.[hc], drawer.[ch], panel.c, panel_config.[ch],
session.c: Added configurable hidebuttons for drawers much like
those for snapped panels.
Wed Oct 21 11:41:44 1998 Owen Taylor <otaylor@redhat.com>
* panel.c menu.c: Added the ability to drag launchers applets
......
......@@ -11,11 +11,14 @@
#include "drawer-widget.h"
#include "panel-util.h"
#include "gdkextra.h"
#include "panel-include.h"
/*there can universally be only one applet being dragged since we assume
we only have one mouse :) */
extern int panel_applet_in_drag;
extern void drawer_click(GtkWidget *w, Drawer *drawer);
static void drawer_widget_class_init (DrawerWidgetClass *klass);
static void drawer_widget_init (DrawerWidget *drawer);
static void drawer_widget_size_request (GtkWidget *widget,
......@@ -191,18 +194,18 @@ drawer_widget_get_pos(DrawerWidget *drawer, gint16 *x, gint16 *y,
switch(drawer->orient) {
case ORIENT_UP:
*x = bx+(bw-width)/2;
*y = py - height;
*y = py - height - 2;
break;
case ORIENT_DOWN:
*x = bx+(bw-width)/2;
*y = py + ph;
*y = py + ph + 2;
break;
case ORIENT_LEFT:
*x = px - width;
*x = px - width - 2;
*y = by+(bh-height)/2;
break;
case ORIENT_RIGHT:
*x = px + pw;
*x = px + pw + 2;
*y = by+(bh-height)/2;
break;
}
......@@ -511,9 +514,9 @@ drawer_widget_close_drawer(DrawerWidget *drawer)
static int
drawer_enter_notify(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
{
if (!gnome_win_hints_wm_exists())
gdk_window_raise(widget->window);
return FALSE;
if (!gnome_win_hints_wm_exists())
gdk_window_raise(widget->window);
return FALSE;
}
......@@ -521,37 +524,97 @@ static GtkWidget *
make_handle(char *pixmaphandle, int wi, int he)
{
GtkWidget *w;
GtkWidget *box;
GtkWidget *pixmap;
char *pixmap_name;
GtkWidget *frame = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
gtk_widget_show(frame);
pixmap_name=gnome_unconditional_pixmap_file(pixmaphandle);
pixmap = gnome_pixmap_new_from_file(pixmap_name);
gtk_widget_show(pixmap);
g_free(pixmap_name);
gtk_container_add(GTK_CONTAINER(frame),pixmap);
w = gtk_event_box_new();
w = gtk_button_new();
GTK_WIDGET_UNSET_FLAGS(w,GTK_CAN_DEFAULT|GTK_CAN_FOCUS);
gtk_widget_show(w);
gtk_container_add(GTK_CONTAINER(w),frame);
gtk_widget_set_usize(w,wi,he);
return w;
box = gtk_hbox_new(1,1);
gtk_widget_show(box);
gtk_container_add(GTK_CONTAINER(w), pixmap);
gtk_container_add(GTK_CONTAINER(box), w);
gtk_widget_set_usize(box,wi,he);
gtk_object_set_data(GTK_OBJECT(box), "button", w);
gtk_object_set_data(GTK_OBJECT(box), "pixmap", pixmap);
return box;
}
static void
show_handle_pixmap(GtkWidget *handle, int show_pixmap, int show_button)
{
GtkWidget *pixmap, *button;
button = gtk_object_get_data(GTK_OBJECT(handle), "button");
pixmap = gtk_object_get_data(GTK_OBJECT(handle), "pixmap");
if (!button) return;
if (show_button)
gtk_widget_show(button);
else
gtk_widget_hide(button);
if (!pixmap) return;
if (show_pixmap)
gtk_widget_show(pixmap);
else
gtk_widget_hide(pixmap);
}
static void
drawer_hidebutton_set(DrawerWidget *drawer)
{
int pixmap_enabled = drawer->hidebutton_pixmap_enabled;
int button_enabled = drawer->hidebutton_enabled;
show_handle_pixmap(drawer->handle_n, pixmap_enabled,
button_enabled);
show_handle_pixmap(drawer->handle_s, pixmap_enabled,
button_enabled);
show_handle_pixmap(drawer->handle_w, pixmap_enabled,
button_enabled);
show_handle_pixmap(drawer->handle_e, pixmap_enabled,
button_enabled);
}
static void
drawer_handle_click(GtkWidget *widget, gpointer data)
{
Drawer *drawer = gtk_object_get_data(GTK_OBJECT(data),
DRAWER_PANEL_KEY);
DrawerWidget *drawerw = DRAWER_WIDGET(drawer->drawer);
PanelWidget *parent = PANEL_WIDGET(drawer->button->parent);
GtkWidget *panelw = gtk_object_get_data(GTK_OBJECT(parent),
PANEL_PARENT);
drawer_widget_close_drawer(data);
if(IS_SNAPPED_WIDGET(panelw))
SNAPPED_WIDGET(panelw)->drawers_open--;
}
static void
drawer_widget_init (DrawerWidget *drawer)
{
gnome_win_hints_init();
if (gnome_win_hints_wm_exists())
GTK_WINDOW(drawer)->type = GTK_WINDOW_TOPLEVEL;
else
GTK_WINDOW(drawer)->type = GTK_WINDOW_POPUP;
gnome_win_hints_init();
if (gnome_win_hints_wm_exists())
GTK_WINDOW(drawer)->type = GTK_WINDOW_TOPLEVEL;
else
GTK_WINDOW(drawer)->type = GTK_WINDOW_POPUP;
GTK_WINDOW(drawer)->allow_shrink = TRUE;
GTK_WINDOW(drawer)->allow_grow = TRUE;
GTK_WINDOW(drawer)->auto_shrink = TRUE;
/*this makes the popup "pop down" once the button is released*/
gtk_widget_set_events(GTK_WIDGET(drawer),
gtk_widget_get_events(GTK_WIDGET(drawer)) |
......@@ -563,37 +626,53 @@ drawer_widget_init (DrawerWidget *drawer)
/*we add all the handles to the table here*/
/*EAST*/
drawer->handle_e = make_handle("panel-knob.png",0,40);
drawer->handle_e = make_handle("panel-arrow-right.png",0,40);
gtk_table_attach(GTK_TABLE(drawer->table),drawer->handle_e,
0,1,1,2,GTK_FILL,GTK_FILL,0,0);
gtk_signal_connect(gtk_object_get_data(GTK_OBJECT(drawer->handle_e),
"button"), "clicked",
GTK_SIGNAL_FUNC(drawer_handle_click), drawer);
/*NORTH*/
drawer->handle_n = make_handle("panel-knob.png",40,0);
drawer->handle_n = make_handle("panel-arrow-down.png",40,0);
gtk_table_attach(GTK_TABLE(drawer->table),drawer->handle_n,
1,2,0,1,GTK_FILL,GTK_FILL,0,0);
gtk_signal_connect(gtk_object_get_data(GTK_OBJECT(drawer->handle_n),
"button"), "clicked",
GTK_SIGNAL_FUNC(drawer_handle_click), drawer);
/*WEST*/
drawer->handle_w = make_handle( "panel-knob.png",0,40);
drawer->handle_w = make_handle( "panel-arrow-left.png",0,40);
gtk_table_attach(GTK_TABLE(drawer->table),drawer->handle_w,
2,3,1,2,GTK_FILL,GTK_FILL,0,0);
gtk_signal_connect(gtk_object_get_data(GTK_OBJECT(drawer->handle_w),
"button"), "clicked",
GTK_SIGNAL_FUNC(drawer_handle_click), drawer);
/*SOUTH*/
drawer->handle_s = make_handle("panel-knob.png",40,0);
drawer->handle_s = make_handle("panel-arrow-up.png",40,0);
gtk_table_attach(GTK_TABLE(drawer->table),drawer->handle_s,
1,2,2,3,GTK_FILL,GTK_FILL,0,0);
gtk_signal_connect(gtk_object_get_data(GTK_OBJECT(drawer->handle_s),
"button"), "clicked",
GTK_SIGNAL_FUNC(drawer_handle_click), drawer);
gtk_signal_connect(GTK_OBJECT(drawer), "enter_notify_event",
GTK_SIGNAL_FUNC(drawer_enter_notify),
NULL);
drawer->hidebutton_enabled = TRUE;
drawer->hidebutton_pixmap_enabled = TRUE;
drawer->state = DRAWER_SHOWN;
}
GtkWidget*
drawer_widget_new (PanelOrientType orient,
DrawerState state,
PanelBackType back_type,
char *back_pixmap,
int fit_pixmap_bg,
GdkColor *back_color)
GdkColor *back_color,
int hidebutton_pixmap_enabled,
int hidebutton_enabled)
{
DrawerWidget *drawer;
GtkWidget *frame;
......@@ -633,7 +712,9 @@ drawer_widget_new (PanelOrientType orient,
0,0);
drawer->state = state;
drawer->hidebutton_enabled = hidebutton_enabled;
drawer->hidebutton_pixmap_enabled = hidebutton_enabled;
drawer_hidebutton_set(drawer);
gtk_widget_set_uposition(GTK_WIDGET(drawer),-100,-100);
drawer_widget_set_drop_zone(drawer);
......@@ -647,7 +728,9 @@ drawer_widget_change_params(DrawerWidget *drawer,
PanelBackType back_type,
char *pixmap,
int fit_pixmap_bg,
GdkColor *back_color)
GdkColor *back_color,
int hidebutton_pixmap_enabled,
int hidebutton_enabled)
{
DrawerState oldstate;
PanelOrientation porient;
......@@ -686,6 +769,10 @@ drawer_widget_change_params(DrawerWidget *drawer,
gtk_signal_emit(GTK_OBJECT(drawer),
drawer_widget_signals[STATE_CHANGE_SIGNAL],
drawer->state);
drawer->hidebutton_enabled = hidebutton_enabled;
drawer->hidebutton_pixmap_enabled = hidebutton_pixmap_enabled;
drawer_hidebutton_set(drawer);
}
void
......@@ -699,7 +786,9 @@ drawer_widget_change_orient(DrawerWidget *drawer,
panel->back_type,
panel->back_pixmap,
panel->fit_pixmap_bg,
&panel->back_color);
&panel->back_color,
drawer->hidebutton_pixmap_enabled,
drawer->hidebutton_enabled);
}
void
......
......@@ -39,6 +39,8 @@ struct _DrawerWidget
DrawerState state;
PanelOrientType orient;
int hidebutton_enabled;
int hidebutton_pixmap_enabled;
};
struct _DrawerWidgetClass
......@@ -55,7 +57,9 @@ GtkWidget* drawer_widget_new (PanelOrientType orient,
PanelBackType back_type,
char *back_pixmap,
int fit_pixmap_bg,
GdkColor *back_color);
GdkColor *back_color,
int hidebutton_pixmap_enabled,
int hidebutton_enabled);
/*open and close drawers*/
void drawer_widget_open_drawer (DrawerWidget *panel);
......@@ -68,7 +72,9 @@ void drawer_widget_change_params (DrawerWidget *drawer,
PanelBackType back_type,
char *pixmap_name,
int fit_pixmap_bg,
GdkColor *back_color);
GdkColor *back_color,
int hidebutton_pixmap_enabled,
int hidebutton_enabled);
/* changing parameters (orient only) */
void drawer_widget_change_orient (DrawerWidget *drawer,
......
......@@ -84,14 +84,16 @@ properties_close_callback(GtkWidget *widget, gpointer data)
}
void
add_drawer_properties_page(GtkWidget *dialog, Drawer *drawer)
add_drawer_properties_page(PerPanelConfig *ppc, Drawer *drawer)
{
GtkWidget *table;
GtkWidget *dialog = ppc->config_window;
GtkWidget *table;
GtkWidget *f;
GtkWidget *box;
GtkWidget *box, *box_in;
GtkWidget *nbook;
GtkWidget *w;
GtkWidget *button;
table = gtk_table_new(2, 2, FALSE);
gtk_container_border_width(GTK_CONTAINER(table), 5);
gtk_table_set_col_spacings(GTK_TABLE(table), 6);
......@@ -112,6 +114,29 @@ add_drawer_properties_page(GtkWidget *dialog, Drawer *drawer)
gtk_container_border_width(GTK_CONTAINER(box), 5);
gtk_box_pack_start(GTK_BOX(box),f,FALSE,FALSE,0);
f = gtk_frame_new(_("Drawer handle"));
box_in = gtk_vbox_new(FALSE,5);
button = gtk_check_button_new_with_label (_("Disable hidebutton"));
gtk_object_set_user_data(GTK_OBJECT(button),ppc);
if (!ppc->drawer_hidebutton)
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
GTK_SIGNAL_FUNC (drawer_set_hidebutton), NULL);
gtk_box_pack_start (GTK_BOX (box_in), button, TRUE, FALSE,
1);
button = gtk_check_button_new_with_label (_("Disable hidebutton arrow"));
gtk_object_set_user_data(GTK_OBJECT(button),ppc);
if (!ppc->drawer_hidebutton_pixmap)
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
GTK_SIGNAL_FUNC (drawer_set_hidebutton_pixmap), NULL);
gtk_box_pack_start (GTK_BOX (box_in), button, TRUE, TRUE,
1);
gtk_container_add(GTK_CONTAINER(f),box_in);
gtk_box_pack_start (GTK_BOX (box),f,FALSE,FALSE,0);
nbook = GNOME_PROPERTY_BOX (dialog)->notebook;
gtk_notebook_append_page (GTK_NOTEBOOK(nbook),
box, gtk_label_new (_("Drawer")));
......@@ -232,7 +257,7 @@ create_empty_drawer_applet(char *tooltip, char *pixmap,
return create_drawer_applet(drawer_widget_new(orient,
DRAWER_SHOWN,
PANEL_BACK_NONE, NULL,
TRUE, NULL),
TRUE, NULL, TRUE, TRUE),
tooltip,pixmap,orient);
}
......
......@@ -19,7 +19,7 @@ void load_drawer_applet(char *params, char *pixmap, char *tooltip,
void set_drawer_applet_orient(Drawer *drawer, PanelOrientType orient);
void add_drawer_properties_page(GtkWidget *dialog, Drawer *drawer);
void add_drawer_properties_page(PerPanelConfig *ppc, Drawer *drawer);
END_GNOME_DECLS
......
......@@ -13,46 +13,6 @@ extern int applet_count;
extern GlobalConfig global_config;
/* used to temporarily store config values until the 'Apply'
button is pressed. */
typedef struct _PerPanelConfig PerPanelConfig;
struct _PerPanelConfig {
GtkWidget *panel;
/*drawer types*/
/*nothing!*/
/*snapped types*/
SnappedPos snapped_pos;
SnappedMode snapped_mode;
int snapped_hidebuttons;
int snapped_hidebutton_pixmaps;
/*corner types*/
CornerPos corner_pos;
PanelOrientation corner_orient;
int fit_pixmap_bg;
PanelBackType back_type;
char *back_pixmap;
GdkColor back_color;
int register_changes; /*used for startup*/
GtkWidget *config_window;
GtkWidget *pix_entry;
int pix_ch_signal;
/*snapped buttons*/
GtkWidget *r_button; /*se*/
GtkWidget *l_button; /*nw*/
GtkWidget *t_button; /*ne*/
GtkWidget *b_button; /*sw*/
GtkWidget *non;
GtkWidget *pix;
GtkWidget *col;
GtkWidget *backsel;
};
static GList *ppconfigs=NULL;
static PerPanelConfig *
......@@ -198,14 +158,16 @@ config_apply (GtkWidget *widget, int page, gpointer data)
ppc->fit_pixmap_bg,
&ppc->back_color);
else if(IS_DRAWER_WIDGET(ppc->panel)) {
PanelWidget *pw =
PANEL_WIDGET(DRAWER_WIDGET(ppc->panel)->panel);
panel_widget_change_params(pw,
pw->orient,
DrawerWidget *dw = DRAWER_WIDGET(ppc->panel);
drawer_widget_change_params(dw,
dw->orient,
dw->state,
ppc->back_type,
ppc->back_pixmap,
ppc->fit_pixmap_bg,
&ppc->back_color);
&ppc->back_color,
ppc->drawer_hidebutton_pixmap,
ppc->drawer_hidebutton);
}
gtk_widget_queue_draw (ppc->panel);
}
......@@ -286,6 +248,26 @@ snapped_set_hidebutton_pixmaps (GtkWidget *widget, gpointer data)
gnome_property_box_changed (GNOME_PROPERTY_BOX (ppc->config_window));
}
void
drawer_set_hidebutton (GtkWidget *widget, gpointer data)
{
PerPanelConfig *ppc = gtk_object_get_user_data(GTK_OBJECT(widget));
ppc->drawer_hidebutton = !(GTK_TOGGLE_BUTTON(widget)->active);
if (ppc->register_changes)
gnome_property_box_changed (GNOME_PROPERTY_BOX (ppc->config_window));
}
void
drawer_set_hidebutton_pixmap (GtkWidget *widget, gpointer data)
{
PerPanelConfig *ppc = gtk_object_get_user_data(GTK_OBJECT(widget));
ppc->drawer_hidebutton_pixmap = !(GTK_TOGGLE_BUTTON(widget)->active);
if (ppc->register_changes)
gnome_property_box_changed (GNOME_PROPERTY_BOX (ppc->config_window));
}
static void
snapped_set_mode (GtkWidget *widget, gpointer data)
{
......@@ -844,11 +826,14 @@ panel_config(GtkWidget *panel)
ppc->back_color = pw->back_color;
ppc->back_type = pw->back_type;
} else if(IS_DRAWER_WIDGET(panel)) {
PanelWidget *pw = PANEL_WIDGET(DRAWER_WIDGET(panel)->panel);
DrawerWidget *drawer = DRAWER_WIDGET(panel);
PanelWidget *pw = PANEL_WIDGET(DRAWER_WIDGET(panel)->panel);
ppc->fit_pixmap_bg = pw->fit_pixmap_bg;
ppc->back_pixmap = g_strdup(pw->back_pixmap);
ppc->back_color = pw->back_color;
ppc->back_type = pw->back_type;
ppc->drawer_hidebutton = drawer->hidebutton_enabled;
ppc->drawer_hidebutton_pixmap = drawer->hidebutton_pixmap_enabled;
}
ppc->panel = panel;
......@@ -889,8 +874,7 @@ panel_config(GtkWidget *panel)
GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(applet),
"applet_id"));
AppletInfo *info = get_applet_info(applet_id);
add_drawer_properties_page(ppc->config_window,
info->data);
add_drawer_properties_page(ppc, info->data);
}
......
......@@ -3,9 +3,51 @@
#include "panel-widget.h"
/* used to temporarily store config values until the 'Apply'
button is pressed. */
typedef struct _PerPanelConfig PerPanelConfig;
struct _PerPanelConfig {
GtkWidget *panel;
/*drawer types*/
int drawer_hidebutton;
int drawer_hidebutton_pixmap;
/*snapped types*/
SnappedPos snapped_pos;
SnappedMode snapped_mode;
int snapped_hidebuttons;
int snapped_hidebutton_pixmaps;
/*corner types*/
CornerPos corner_pos;
PanelOrientation corner_orient;
int fit_pixmap_bg;
PanelBackType back_type;
char *back_pixmap;
GdkColor back_color;
int register_changes; /*used for startup*/
GtkWidget *config_window;
GtkWidget *pix_entry;
int pix_ch_signal;
/*snapped buttons*/
GtkWidget *r_button; /*se*/
GtkWidget *l_button; /*nw*/
GtkWidget *t_button; /*ne*/
GtkWidget *b_button; /*sw*/
GtkWidget *non;
GtkWidget *pix;
GtkWidget *col;
GtkWidget *backsel;
};
void panel_config(GtkWidget *panel);
void update_config_orient(GtkWidget *panel);
void update_config_back(PanelWidget *panel);
void kill_config_dialog(GtkWidget *panel);
void drawer_set_hidebutton (GtkWidget *widget, gpointer data);
void drawer_set_hidebutton_pixmap (GtkWidget *widget, gpointer data);
#endif /* PANEL_CONFIG_H */
......@@ -721,7 +721,6 @@ static int
panel_event(GtkWidget *widget, GdkEvent *event, gpointer data)
{
GdkEventButton *bevent;
switch (event->type) {
case GDK_BUTTON_PRESS:
bevent = (GdkEventButton *) event;
......@@ -836,7 +835,7 @@ panel_sub_event_handler(GtkWidget *widget, GdkEvent *event, gpointer data)
switch (event->type) {
/*pass these to the parent!*/
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
case GDK_BUTTON_RELEASE:
bevent = (GdkEventButton *) event;
/*if the widget is a button we want to keep the
button 1 events*/
......@@ -853,18 +852,18 @@ panel_sub_event_handler(GtkWidget *widget, GdkEvent *event, gpointer data)
}
static void
bind_panel_events(GtkWidget *widget, gpointer data)
{
if (!GTK_WIDGET_NO_WINDOW(widget))
gtk_signal_connect(GTK_OBJECT(widget), "event",
(GtkSignalFunc) panel_sub_event_handler,
NULL);
/* static void
bind_panel_events(GtkWidget *widget, gpointer data)
{
if (!GTK_WIDGET_NO_WINDOW(widget))
gtk_signal_connect(GTK_OBJECT(widget), "event",
(GtkSignalFunc) panel_sub_event_handler,
NULL);
if (GTK_IS_CONTAINER(widget))
gtk_container_foreach (GTK_CONTAINER (widget),
bind_panel_events, NULL);
}
if (GTK_IS_CONTAINER(widget))
gtk_container_foreach (GTK_CONTAINER (widget),
bind_panel_events, NULL);
} */
static void
panel_widget_dnd_drop_internal (GtkWidget *widget,
......@@ -1002,6 +1001,7 @@ panel_setup(GtkWidget *panelw)
if(IS_DRAWER_WIDGET(panelw)) {
PanelWidget *panel = PANEL_WIDGET(DRAWER_WIDGET(panelw)->panel);
DrawerWidget *drawer = DRAWER_WIDGET(panelw);
GtkObject *button;
panel_widget_setup(panel);
gtk_signal_connect(GTK_OBJECT(panel),
"orient_change",
......@@ -1014,15 +1014,31 @@ panel_setup(GtkWidget *panelw)
gtk_signal_connect(GTK_OBJECT(drawer->handle_e), "event",
(GtkSignalFunc) panel_sub_event_handler,
panelw);
button = gtk_object_get_data(GTK_OBJECT(drawer->handle_e),"button");
if (button) gtk_signal_connect(button, "event",
(GtkSignalFunc) panel_sub_event_handler,
panelw);
gtk_signal_connect(GTK_OBJECT(drawer->handle_w), "event",
(GtkSignalFunc) panel_sub_event_handler,
panelw);
button = gtk_object_get_data(GTK_OBJECT(drawer->handle_w),"button");
if (button) gtk_signal_connect(button, "event",
(GtkSignalFunc) panel_sub_event_handler,
panelw);
gtk_signal_connect(GTK_OBJECT(drawer->handle_n), "event",
(GtkSignalFunc) panel_sub_event_handler,
panelw);
button = gtk_object_get_data(GTK_OBJECT(drawer->handle_n),"button");
if (button) gtk_signal_connect(button, "event",
(GtkSignalFunc) panel_sub_event_handler,
panelw);
gtk_signal_connect(GTK_OBJECT(drawer->handle_s), "event",
(GtkSignalFunc) panel_sub_event_handler,
panelw);
button = gtk_object_get_data(GTK_OBJECT(drawer->handle_s),"button");
if (button) gtk_signal_connect(button, "event",
(GtkSignalFunc) panel_sub_event_handler,
panelw);
} else if(IS_SNAPPED_WIDGET(panelw)) {
PanelWidget *panel =
PANEL_WIDGET(SNAPPED_WIDGET(panelw)->panel);
......
......@@ -13,46 +13,6 @@ extern int applet_count;
extern GlobalConfig global_config;
/* used to temporarily store config values until the 'Apply'
button is pressed. */
typedef struct _PerPanelConfig PerPanelConfig;
struct _PerPanelConfig {
GtkWidget *panel;
/*drawer types*/
/*nothing!*/
/*snapped types*/
SnappedPos snapped_pos;
SnappedMode snapped_mode;
int snapped_hidebuttons;
int snapped_hidebutton_pixmaps;
/*corner types*/
CornerPos corner_pos;
PanelOrientation corner_orient;
int fit_pixmap_bg;
PanelBackType back_type;
char *back_pixmap;
GdkColor back_color;
int register_changes; /*used for startup*/
GtkWidget *config_window;
GtkWidget *pix_entry;
int pix_ch_signal;
/*snapped buttons*/
GtkWidget *r_button; /*se*/
GtkWidget *l_button; /*nw*/
GtkWidget *t_button; /*ne*/
GtkWidget *b_button; /*sw*/
GtkWidget *non;
GtkWidget *pix;
GtkWidget *col;
GtkWidget *backsel;
};
static GList *ppconfigs=NULL;
static PerPanelConfig *
......@@ -198,14 +158,16 @@ config_apply (GtkWidget *widget, int page, gpointer data)
ppc->fit_pixmap_bg,
&ppc->back_color);
else if(IS_DRAWER_WIDGET(ppc->panel)) {
PanelWidget *pw =
PANEL_WIDGET(DRAWER_WIDGET(ppc->panel)->panel);
panel_widget_change_params(pw,
pw->orient,
DrawerWidget *dw = DRAWER_WIDGET(ppc->panel);
drawer_widget_change_params(dw,
dw->orient,
dw->state,
ppc->back_type,
ppc->back_pixmap,
ppc->fit_pixmap_bg,
&ppc->back_color);
&ppc->back_color,
ppc->drawer_hidebutton_pixmap,
ppc->drawer_hidebutton);
}
gtk_widget_queue_draw (ppc->panel);
}
......@@ -286,6 +248,26 @@ snapped_set_hidebutton_pixmaps (GtkWidget *widget, gpointer data)
gnome_property_box_changed (GNOME_PROPERTY_BOX (ppc->config_window));
}
void
drawer_set_hidebutton (GtkWidget *widget, gpointer data)
{
PerPanelConfig *ppc = gtk_object_get_user_data(GTK_OBJECT(widget));
ppc->drawer_hidebutton = !(GTK_TOGGLE_BUTTON(widget)->active);
if (ppc->register_changes)
gnome_property_box_changed (GNOME_PROPERTY_BOX (ppc->config_window));
}
void
drawer_set_hidebutton_pixmap (GtkWidget *widget, gpointer data)
{
PerPanelConfig *ppc = gtk_object_get_user_data(GTK_OBJECT(widget));
ppc->drawer_hidebutton_pixmap = !(GTK_TOGGLE_BUTTON(widget)->active);
if (ppc->register_changes)
gnome_property_box_changed (GNOME_PROPERTY_BOX (ppc->config_window));
}
static void