Commit 0dcdb1ad authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

split up configuration, integrated menu more closely with panel

Sat Feb 14 15:54:45 1998  George Lebl  <jirka@5z.com>

        * panel.c, menu.c, panel_config.[ch], panel_config_global.[ch]:
          split up configuration, integrated menu more closely with
          panel
parent 818e3629
Sat Feb 14 15:54:45 1998 George Lebl <jirka@5z.com>
* panel.c, menu.c, panel_config.[ch], panel_config_global.[ch]:
split up configuration, integrated menu more closely with
panel
1998-02-14 Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de>
* panel.c (panel_quit): Changed to use new SM support.
......
Sat Feb 14 15:54:45 1998 George Lebl <jirka@5z.com>
* panel.c, menu.c, panel_config.[ch], panel_config_global.[ch]:
split up configuration, integrated menu more closely with
panel
1998-02-14 Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de>
* panel.c (panel_quit): Changed to use new SM support.
......
......@@ -16,6 +16,8 @@ panel_SOURCES = \
menu.h \
panel-widget.c \
panel-widget.h \
panel_config_global.c \
panel_config_global.h \
panel_config.c \
panel_config.h
......
......@@ -10,18 +10,29 @@
#include "gnome.h"
#include "panel-widget.h"
#include "panel.h"
#include "panel_config_global.h"
#include "menu.h"
GList *panels = NULL;
GList *drawers = NULL;
GList *applets = NULL;
GtkTooltips *panel_tooltips = NULL;
extern GtkWidget * root_menu;
gint tooltips_enabled = TRUE;
GtkTooltips *panel_tooltips = NULL;
GnomeClient *client = NULL;
GlobalConfig global_config = {
DEFAULT_AUTO_HIDE_STEP_SIZE,
DEFAULT_EXPLICIT_HIDE_STEP_SIZE,
DEFAULT_MINIMIZED_SIZE,
DEFAULT_MINIMIZE_DELAY,
TRUE, /*tooltips*/
TRUE /*show small icons*/
};
static void
load_applet(char *id, char *params, int pos, int panel)
{
......@@ -198,25 +209,21 @@ init_user_panels(void)
PANEL_SHOWN);
config.state=gnome_config_get_int(buf);
sprintf(buf,"/panel/Panel_%d/step_size=%d",num,
DEFAULT_STEP_SIZE);
config.step_size=gnome_config_get_int(buf);
sprintf(buf,"/panel/Panel_%d/minimize_delay=%d",num,
DEFAULT_MINIMIZE_DELAY);
config.minimize_delay=gnome_config_get_int(buf);
sprintf(buf,"/panel/Panel_%d/minimized_size=%d",num,
DEFAULT_MINIMIZED_SIZE);
config.minimized_size=gnome_config_get_int(buf);
panel = panel_widget_new(length,
config.orient,
config.snapped,
config.mode,
config.state,
config.step_size,
config.minimized_size,
config.minimize_delay);
DEFAULT_EXPLICIT_HIDE_STEP_SIZE,
DEFAULT_MINIMIZED_SIZE,
DEFAULT_MINIMIZE_DELAY);
/*the last three will get changed
anyway, they are globals*/
/*FIXME: this should be made cleaner I guess*/
if(!root_menu) init_main_menu(panel);
panel_menu = create_panel_root_menu(PANEL_WIDGET(panel));
gtk_signal_connect(GTK_OBJECT(panel),
......@@ -254,6 +261,7 @@ int
main(int argc, char **argv)
{
GtkWidget *base_panel;
char buf[256];
gnome_init(&argc, &argv);
textdomain(PACKAGE);
......@@ -262,19 +270,30 @@ main(int argc, char **argv)
create_applet_menu();
/*set up the tooltips*/
tooltips_enabled =
gnome_config_get_int("/panel/Config/tooltips_enabled=TRUE");
panel_tooltips=gtk_tooltips_new();
if(tooltips_enabled)
gtk_tooltips_enable(panel_tooltips);
else
gtk_tooltips_disable(panel_tooltips);
/*set up global options*/
global_config.tooltips_enabled =
gnome_config_get_bool("/panel/Config/tooltips_enabled=TRUE");
global_config.show_small_icons =
gnome_config_get_bool("/panel/Config/show_small_icons=TRUE");
sprintf(buf,"/panel/Config/auto_hide_step_size=%d",
DEFAULT_AUTO_HIDE_STEP_SIZE);
global_config.auto_hide_step_size=gnome_config_get_int(buf);
sprintf(buf,"/panel/Config/explicit_hide_step_size=%d",
DEFAULT_EXPLICIT_HIDE_STEP_SIZE);
global_config.explicit_hide_step_size=gnome_config_get_int(buf);
sprintf(buf,"/panel/Config/minimize_delay=%d",
DEFAULT_MINIMIZE_DELAY);
global_config.minimize_delay=gnome_config_get_int(buf);
sprintf(buf,"/panel/Config/minimized_size=%d",
DEFAULT_MINIMIZED_SIZE);
global_config.minimized_size=gnome_config_get_int(buf);
init_user_panels();
init_user_drawers();
init_user_applets();
apply_global_config();
gtk_main();
return 0;
}
......@@ -16,6 +16,7 @@
#include "gnome.h"
#include "panel-widget.h"
#include "panel.h"
#include "panel_config_global.h"
#include "menu.h"
......@@ -28,6 +29,8 @@ GtkWidget *root_menu = NULL;
GList *small_icons = NULL;
int show_small_icons = TRUE;
extern GlobalConfig global_config;
static PanelCmdFunc panel_cmd_func;
typedef struct {
......@@ -313,6 +316,16 @@ menu_position (GtkMenu *menu, gint *x, gint *y, gpointer data)
if(*y < 0) *y =0;
}
void
destroy_menu (GtkWidget *widget, gpointer data)
{
Menu *menu = data;
if(menu->menu != root_menu)
gtk_widget_unref(menu->menu);
g_free(menu);
}
void
activate_menu (GtkWidget *widget, gpointer data)
{
......@@ -325,17 +338,9 @@ activate_menu (GtkWidget *widget, gpointer data)
void
panel_configure (GtkWidget *widget, void *data)
{
/*FIXME: configure the panel*/
panel_config_global();
}
/* FIXME: panel is dynamicly configured! so we shouldn't need this*/
/*
void
panel_reload (GtkWidget *widget, void *data)
{
fprintf(stderr, "Panel reload not yet implemented\n");
}*/
static AppletItem *
applet_item_new(char *translated, char *original_id)
{
......@@ -484,19 +489,11 @@ create_panel_submenu (GtkWidget *app_menu)
add_menu_separator(menu);
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Configure"));
setup_menuitem (menuitem, 0, _("Global Properties"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
(GtkSignalFunc) panel_configure, 0);
/*FIXME: this is not needed, or is it?, so take it out unless we
do need it!
*/
/*menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Reload configuration"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate", (GtkSignalFunc) panel_reload, 0);*/
return menu;
}
......@@ -509,7 +506,7 @@ panel_lock (GtkWidget *widget, void *data)
static void
panel_logout (GtkWidget *widget, void *data)
{
/*FIXME: do logout*/
panel_quit();
}
static void
......@@ -589,21 +586,36 @@ create_panel_menu (GtkWidget *window, char *menudir, int main_menu,
gtk_widget_show (menu->button);
if (main_menu) {
if(!root_menu)
/*this should not happen init root menu should have
been called (unless there are no panels*/
if(!root_menu) {
root_menu = create_menu_at(window,menudir,0);
app_menu = create_menu_at (window, menudir, 1);
add_special_entries (root_menu, app_menu);
}
menu->menu = root_menu;
app_menu = create_menu_at (window, menudir, 1);
add_special_entries (menu->menu, app_menu);
} else {
menu->menu = create_menu_at (window, menudir, 0);
}
gtk_signal_connect (GTK_OBJECT (menu->button), "clicked",
GTK_SIGNAL_FUNC (activate_menu), menu);
gtk_signal_connect (GTK_OBJECT (menu->button), "destroy",
GTK_SIGNAL_FUNC (destroy_menu), menu);
g_free (pixmap_name);
return menu;
}
GtkWidget *
init_main_menu(GtkWidget *window)
{
GtkWidget *app_menu;
root_menu = create_menu_at(window,".",0);
app_menu = create_menu_at (window, ".", 1);
add_special_entries (root_menu, app_menu);
}
Menu *
create_menu_applet(GtkWidget *window, char *arguments, MenuOrient orient)
{
......@@ -642,7 +654,7 @@ create_menu_applet(GtkWidget *window, char *arguments, MenuOrient orient)
return menu;
}
static void
void
set_show_small_icons(gpointer data, gpointer user_data)
{
GtkWidget *w = data;
......@@ -650,7 +662,7 @@ set_show_small_icons(gpointer data, gpointer user_data)
g_warning("Internal error in set_show_small_icons (!w)");
return;
}
if (*(int *)user_data)
if (global_config.show_small_icons)
gtk_widget_show(w);
else
gtk_widget_hide(w);
......
......@@ -17,9 +17,13 @@ typedef struct {
MenuOrient orient;
} Menu;
GtkWidget * init_main_menu(GtkWidget *window);
Menu * create_menu_applet(GtkWidget *window ,char *arguments,
MenuOrient orient);
/*used in foreach to set unset visibility of small_icons*/
void set_show_small_icons(gpointer data, gpointer user_data);
END_GNOME_DECLS
......
#ifndef PANEL_CONFIG_GLOBAL_H
#define PANEL_CONFIG_GLOBAL_H
typedef struct _GlobalConfig GlobalConfig;
struct _GlobalConfig {
gint auto_hide_step_size;
gint explicit_hide_step_size;
gint minimized_size;
gint minimize_delay;
gint tooltips_enabled;
gint show_small_icons;
};
void panel_config_global(void);
#endif /* PANEL_CONFIG_H */
......@@ -9,6 +9,8 @@
#include "gnome.h"
#include "panel.h"
#include "panel-widget.h"
#include "panel_config.h"
#include "panel_config_global.h"
#include "config.h"
/* Used for all the packing and padding options */
......@@ -19,6 +21,8 @@
* button is pressed. */
PanelConfig panel_config_struct;
extern GlobalConfig global_config;
GtkWidget *config_window;
......@@ -64,14 +68,25 @@ static void
config_apply (GtkWidget *widget, gpointer data)
{
PanelWidget *panel = data;
panel_widget_change_params(panel,
panel_config_struct.orient,
panel_config_struct.snapped,
panel_config_struct.mode,
panel_config_struct.state,
panel_config_struct.step_size,
panel_config_struct.minimized_size,
panel_config_struct.minimize_delay);
if(panel_config_struct.mode == PANEL_AUTO_HIDE) {
panel_widget_change_params(panel,
panel_config_struct.orient,
panel_config_struct.snapped,
panel_config_struct.mode,
panel_config_struct.state,
global_config.auto_hide_step_size,
global_config.minimized_size,
global_config.minimize_delay);
} else {
panel_widget_change_params(panel,
panel_config_struct.orient,
panel_config_struct.snapped,
panel_config_struct.mode,
panel_config_struct.state,
global_config.explicit_hide_step_size,
global_config.minimized_size,
global_config.minimize_delay);
}
}
/* FIXME: I think these should probly go in a notebook.. I have to
......@@ -192,168 +207,6 @@ position_notebook_page(void)
return (vbox);
}
static void
step_size_scale_update (GtkAdjustment *adjustment, gpointer data)
{
double scale_val = adjustment->value;
panel_config_struct.step_size = (gint) scale_val;
}
static void
delay_scale_update (GtkAdjustment *adjustment, gpointer data)
{
double scale_val = adjustment->value;
panel_config_struct.minimize_delay = (gint) scale_val;
}
static void
minimized_size_scale_update (GtkAdjustment *adjustment, gpointer data)
{
double scale_val = adjustment->value;
panel_config_struct.minimized_size = (gint) scale_val;
}
GtkWidget *
animation_notebook_page(void)
{
GtkWidget *frame;
GtkWidget *box;
GtkWidget *vbox;
GtkWidget *scale;
GtkObject *step_size_scale_data;
GtkObject *delay_scale_data;
GtkObject *minimized_size_scale_data;
/* main vbox */
vbox = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_border_width(GTK_CONTAINER (vbox), CONFIG_PADDING_SIZE);
gtk_widget_show (vbox);
/* Animation step_size scale frame */
frame = gtk_frame_new (_("Animation Speed"));
gtk_container_border_width(GTK_CONTAINER (frame), CONFIG_PADDING_SIZE);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (frame);
/* vbox for frame */
box = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_container_border_width(GTK_CONTAINER (box), CONFIG_PADDING_SIZE);
gtk_widget_show (box);
/* Animation step_size scale */
step_size_scale_data = gtk_adjustment_new ((double) panel_config_struct.step_size,
3.0, 100.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (step_size_scale_data));
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_box_pack_start (GTK_BOX (box), scale, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_signal_connect(GTK_OBJECT (step_size_scale_data),
"value_changed",
GTK_SIGNAL_FUNC (step_size_scale_update), NULL);
gtk_widget_show (scale);
/* Minimized Delay scale frame */
frame = gtk_frame_new (_("Minimize Delay (ms)"));
gtk_container_border_width(GTK_CONTAINER (frame), CONFIG_PADDING_SIZE);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (frame);
/* vbox for frame */
box = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_border_width(GTK_CONTAINER (box), CONFIG_PADDING_SIZE);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_widget_show (box);
/* minimize_delay scale */
delay_scale_data = gtk_adjustment_new ((double) panel_config_struct.minimize_delay,
30.0, 1000.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (delay_scale_data));
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_box_pack_start (GTK_BOX (box), scale, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_signal_connect(GTK_OBJECT (delay_scale_data),
"value_changed",
GTK_SIGNAL_FUNC (delay_scale_update), NULL);
gtk_widget_show (scale);
/* Minimized size scale frame */
frame = gtk_frame_new (_("Minimized Size (pixels)"));
gtk_container_border_width(GTK_CONTAINER (frame), CONFIG_PADDING_SIZE);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_widget_show (frame);
/* vbox for frame */
box = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_border_width(GTK_CONTAINER (box), CONFIG_PADDING_SIZE);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_widget_show (box);
/* minimized_size scale */
minimized_size_scale_data = gtk_adjustment_new ((double) panel_config_struct.minimized_size,
1.0, 10.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (minimized_size_scale_data));
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_box_pack_start (GTK_BOX (box), scale, TRUE, TRUE, CONFIG_PADDING_SIZE);
gtk_signal_connect(GTK_OBJECT (minimized_size_scale_data),
"value_changed",
GTK_SIGNAL_FUNC (minimized_size_scale_update), NULL);
gtk_widget_show (scale);
return (vbox);
}
GtkWidget *
misc_notebook_page(void)
{
GtkWidget *frame;
GtkWidget *button;
GtkWidget *box;
GtkWidget *vbox;
/* main vbox */
vbox = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_border_width(GTK_CONTAINER (vbox), CONFIG_PADDING_SIZE);
gtk_widget_show (vbox);
/* Tooltips frame */
frame = gtk_frame_new (_("Tooltips"));
gtk_container_border_width(GTK_CONTAINER (frame), CONFIG_PADDING_SIZE);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, CONFIG_PADDING_SIZE);
gtk_widget_show (frame);
/* vbox for frame */
box = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_border_width(GTK_CONTAINER (box), CONFIG_PADDING_SIZE);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_widget_show (box);
/* Tooltips enable */
button = gtk_check_button_new_with_label (_("Tooltips enabled"));
/*FIXME: tooltips!*/
/*gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (set_toggle_button_value),
&(panel_config_struct.tooltips_enabled));
if (panel_config_struct.tooltips_enabled) {
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), TRUE);
}*/
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, CONFIG_PADDING_SIZE);
gtk_widget_show (button);
return (vbox);
}
void
panel_config(PanelWidget *panel)
{
......@@ -367,8 +220,6 @@ panel_config(PanelWidget *panel)
/* return if the window is already up. */
if (config_window)
return;
/*FIXME: I should be able to get windows up for other panels I
guess*/
/* so far, these are the only ones that can be set */
panel_config_struct.orient = panel->orient;
......@@ -376,13 +227,6 @@ panel_config(PanelWidget *panel)
panel_config_struct.mode = panel->mode;
panel_config_struct.state = panel->state;
panel_config_struct.step_size = panel->step_size;
panel_config_struct.minimize_delay = panel->minimize_delay;
panel_config_struct.minimized_size = panel->minimized_size;
/*panel_config_struct.tooltips_enabled = panel->tooltips_enabled;
FIXME: TOOLTIPS*/
/* main window */
config_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
......@@ -412,22 +256,6 @@ panel_config(PanelWidget *panel)
page = position_notebook_page ();
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
/* label for Animation notebook page */
label = gtk_label_new (_("Animation"));
gtk_widget_show (label);
/* Animation notebook page */
page = animation_notebook_page ();
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
/* 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);
/* 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);
......
......@@ -15,6 +15,7 @@
#include "panel.h"
#include "menu.h"
#include "panel_config.h"
#include "panel_config_global.h"
#include <gdk/gdkx.h>
......@@ -41,17 +42,10 @@ extern gint tooltips_enabled;
extern GnomeClient *client;
/*FIXME: integrate with menu.[ch]*/
extern GtkWidget *root_menu;
extern GList *small_icons;
static void
properties(PanelWidget *panel)
{
panel_config(panel);
}
extern GlobalConfig global_config;
static void
get_applet_geometry(GtkWidget *applet, int *x, int *y, int *width, int *height)
......@@ -69,6 +63,31 @@ get_applet_geometry(GtkWidget *applet, int *x, int *y, int *width, int *height)
*height = applet->allocation.height;
}
static void
apply_global_config_to_panel(gpointer data, gpointer user_data)
{
PanelWidget *panel = data;
if(panel->mode == PANEL_AUTO_HIDE)
panel->step_size = global_config.auto_hide_step_size;
else
panel->step_size = global_config.explicit_hide_step_size;
panel->minimize_delay = global_config.minimize_delay;
panel->minimized_size = global_config.minimized_size;
}
void
apply_global_config(void)
{
g_list_foreach(panels,apply_global_config_to_panel,NULL);
if(global_config.tooltips_enabled)
gtk_tooltips_enable(panel_tooltips);
else
gtk_tooltips_disable(panel_tooltips);
g_list_foreach(small_icons,set_show_small_icons,NULL);
}
/*FIXME this should be somehow done through signals and panel-widget*/
static void
applet_orientation_notify(GtkWidget *widget, gpointer data)
......@@ -147,9 +166,9 @@ save_panel_configuration(gpointer data, gpointer user_data)
gnome_config_set_int(fullpath,panel->state);
g_free(fullpath);
fullpath = g_copy_strings(path,"step_size",NULL);
/*fullpath = g_copy_strings(path,"step_size",NULL);
gnome_config_set_int(fullpath,panel->step_size);
g_free(fullpath);
g_free(fullpath);*/
fullpath = g_copy_strings(path,"minimized_size",NULL);
gnome_config_set_int(fullpath,panel->minimized_size);
......@@ -249,8 +268,14 @@ panel_session_save (GnomeClient *client,
gnome_config_set_int("/panel/Config/panel_count",num-1);
/*global options*/
gnome_config_set_int("/panel/Config/auto_hide_step_size",
global_config.auto_hide_step_size);
gnome_config_set_int("/panel/Config/explicit_hide_step_size",
global_config.explicit_hide_step_size);
gnome_config_set_bool("/panel/Config/tooltips_enabled",
tooltips_enabled);
global_config.tooltips_enabled);
gnome_config_set_bool("/panel/Config/show_small_icons",
global_config.show_small_icons);
gnome_config_sync();
......@@ -262,11 +287,9 @@ panel_session_save (GnomeClient *client,
gtk_widget_unref(applet_menu);
gtk_widget_unref(panel_tooltips);
/*FIXME: integrate with menu.[ch]*/
small_icons = NULL; /*prevent searches through the g_list to speed
up this thing*/
/*FIXME: integrate with menu.[ch]*/
gtk_widget_unref(root_menu);
/*FIXME: unref all menus here */
......@@ -276,7 +299,7 @@ panel_session_save (GnomeClient *client,
return TRUE;
}
static void
void
panel_quit(void)
{
if (! GNOME_CLIENT_CONNECTED (client)) {
......@@ -444,7 +467,13 @@ applet_button_press(GtkWidget *widget,GdkEventButton *event, gpointer data)
static void
panel_properties_callback(GtkWidget *widget, gpointer data)
{
properties(PANEL_WIDGET(data));
panel_config(PANEL_WIDGET(data));
}
static void
panel_global_properties_callback(GtkWidget *widget, gpointer data)
{
panel_config_global();
}
static void
......@@ -493,27 +522,32 @@ create_panel_root_menu(PanelWidget *panel)
panel_menu = gtk_menu_new();
menuitem = gtk_menu_item_new_with_label(_("Panel properties..."));
menuitem = gtk_menu_item_new_with_label(_("This panel properties..."));
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) panel_properties_callback,
panel);
gtk_menu_append(GTK_MENU(panel_menu), menuitem);
gtk_widget_show(menuitem);
menuitem = gtk_menu_item_new_with_label(_("Add reparent"));
menuitem = gtk_menu_item_new_with_label(_("Global panel properties..."));
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_reparent,
(GtkSignalFunc) panel_global_properties_callback,
panel);
gtk_menu_append(GTK_MENU(panel_menu), menuitem);
gtk_widget_show(menuitem);
menuitem = gtk_menu_item_new_with_label(_("Add main menu applet"));
menuitem = gtk_menu_item_new_with_label(_("Add reparent (testing)"));
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_main_menu,
(GtkSignalFunc) add_reparent,
panel);
gtk_menu_append(GTK_MENU(panel_menu), menuitem);
gtk_widget_show(menuitem);
menuitem = gtk_menu_item_new_with_label(_("Main menu"));
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), root_menu);
gtk_menu_append(GTK_MENU(panel_menu), menuitem);
gtk_widget_show(menuitem);
menuitem = gtk_menu_item_new();
gtk_menu_append(GTK_MENU(panel_menu), menuitem);
gtk_widget_show(menuitem);
......
......@@ -12,7 +12,8 @@ BEGIN_GNOME_DECLS
/*FIXME: maintain two global step sizes, one for autohide, one for
drawers, and explicit (side) hide panels*/
#define DEFAULT_STEP_SIZE 40
#define DEFAULT_AUTO_HIDE_STEP_SIZE 10
#define DEFAULT_EXPLICIT_HIDE_STEP_SIZE 50
/* amount of time in ms. to wait before lowering panel */
#define DEFAULT_MINIMIZE_DELAY 300
......@@ -29,9 +30,6 @@ struct _PanelConfig {
PanelSnapped snapped;
PanelMode mode;
PanelState state;
gint step_size;
gint minimized_size;
gint minimize_delay;
};