Commit c4a153fd authored by Mark McLoughlin's avatar Mark McLoughlin Committed by Mark McLoughlin

impl.

2001-11-19  Mark McLoughlin  <mark@skynet.ie>

        * panel-applet-frame.[ch]:
        (panel_applet_frame_change_size): impl.

        * panel-applet-shell.c:
        (impl_GNOME_PanelAppletShell_changeSize): impl.
        (panel_applet_shell_class_init): upd.

        * panel-applet.[ch], panel-applet-private.h:
        (panel_applet_change_size): impl.
        (panel_applet_class_init), (panel_applet_instance_init): upd.

        * panel-marshal.list: add VOID:INT.

        * test-bonobo-applet.c:
        (test_applet_handle_size_change): impl - set text size when
        panel size changes.

        * panel-types.h: change from SIZE_RIDICULOUS to
        PANEL_SIZE_XX_LARGE etc.

        * drawer.c: (create_empty_drawer_applet): upd.

        * extern.c: (s_panelspot_get_parent_size): upd.

        * foobar-widget.c: (foobar_widget_instance_init): upd.

        * menu.c:
        (create_new_panel), (update_size_menu): upd.
        (make_properties_submenu): change menuitem labels.

        * panel.c: (size_change): upd.

        * panel_config.c:
        (update_config_size), (make_size_widget): upd.

        * session.c: (init_user_panels): upd.
parent cfd099b4
2001-11-19 Mark McLoughlin <mark@skynet.ie>
* panel-applet-frame.[ch]:
(panel_applet_frame_change_size): impl.
* panel-applet-shell.c:
(impl_GNOME_PanelAppletShell_changeSize): impl.
(panel_applet_shell_class_init): upd.
* panel-applet.[ch], panel-applet-private.h:
(panel_applet_change_size): impl.
(panel_applet_class_init), (panel_applet_instance_init): upd.
* panel-marshal.list: add VOID:INT.
* test-bonobo-applet.c:
(test_applet_handle_size_change): impl - set text size when
panel size changes.
* panel-types.h: change from SIZE_RIDICULOUS to
PANEL_SIZE_XX_LARGE etc.
* drawer.c: (create_empty_drawer_applet): upd.
* extern.c: (s_panelspot_get_parent_size): upd.
* foobar-widget.c: (foobar_widget_instance_init): upd.
* menu.c:
(create_new_panel), (update_size_menu): upd.
(make_properties_submenu): change menuitem labels.
* panel.c: (size_change): upd.
* panel_config.c:
(update_config_size), (make_size_widget): upd.
* session.c: (init_user_panels): upd.
2001-11-19 Glynn Foster <glynn.foster@sun.com>
aligned-widget.c, aligned-widget.h, basep-widget.c,
......
......@@ -383,7 +383,7 @@ create_empty_drawer_applet(const char *tooltip, const char *pixmap,
BASEP_SHOWN,
BASEP_LEVEL_DEFAULT,
FALSE,
SIZE_STANDARD,
PANEL_SIZE_MEDIUM,
TRUE, TRUE,
PANEL_BACK_NONE, NULL,
TRUE, FALSE, TRUE, NULL);
......
......@@ -1807,7 +1807,7 @@ s_panelspot_get_parent_size(PortableServer_Servant servant,
if(!panel) {
g_warning("%s:%d ??? Applet with no panel ???",
__FILE__, __LINE__);
return SIZE_STANDARD;
return PANEL_SIZE_MEDIUM;
}
return panel->sz;
......
......@@ -1181,7 +1181,7 @@ foobar_widget_instance_init (FoobarWidget *foo)
/* panel widget */
foo->panel = panel_widget_new (FALSE, PANEL_HORIZONTAL,
SIZE_TINY, PANEL_BACK_NONE,
PANEL_SIZE_X_SMALL, PANEL_BACK_NONE,
NULL, FALSE, FALSE, FALSE, NULL);
PANEL_WIDGET (foo->panel)->panel_parent = GTK_WIDGET (foo);
PANEL_WIDGET (foo->panel)->drop_widget = GTK_WIDGET (foo);
......
......@@ -3543,7 +3543,7 @@ create_new_panel (GtkWidget *w, gpointer data)
BASEP_SHOWN,
BASEP_LEVEL_DEFAULT,
TRUE,
SIZE_STANDARD,
PANEL_SIZE_MEDIUM,
TRUE,
TRUE,
PANEL_BACK_NONE,
......@@ -3561,7 +3561,7 @@ create_new_panel (GtkWidget *w, gpointer data)
BASEP_SHOWN,
BASEP_LEVEL_DEFAULT,
TRUE,
SIZE_STANDARD,
PANEL_SIZE_MEDIUM,
TRUE,
TRUE,
PANEL_BACK_NONE,
......@@ -3580,7 +3580,7 @@ create_new_panel (GtkWidget *w, gpointer data)
BASEP_SHOWN,
BASEP_LEVEL_DEFAULT,
TRUE,
SIZE_STANDARD,
PANEL_SIZE_MEDIUM,
TRUE, TRUE,
PANEL_BACK_NONE,
NULL, TRUE, FALSE, TRUE,
......@@ -3598,7 +3598,7 @@ create_new_panel (GtkWidget *w, gpointer data)
BASEP_SHOWN,
BASEP_LEVEL_DEFAULT,
FALSE,
SIZE_STANDARD,
PANEL_SIZE_MEDIUM,
TRUE, TRUE,
PANEL_BACK_NONE,
NULL, TRUE, FALSE, TRUE,
......@@ -4629,43 +4629,48 @@ update_avoid_on_maximize_menu (GtkWidget *menu, gpointer data)
}
static void
update_size_menu (GtkWidget *menu, gpointer data)
update_size_menu (GtkWidget *menu,
gpointer data)
{
GtkWidget *menuitem = NULL;
char *s = NULL;
PanelWidget *cur_panel = get_panel_from_menu_data(menu, TRUE);
GtkWidget *menuitem;
PanelWidget *cur_panel;
char *s;
cur_panel = get_panel_from_menu_data (menu, TRUE);
switch (cur_panel->sz) {
case SIZE_ULTRA_TINY:
case PANEL_SIZE_XX_SMALL:
s = MENU_SIZE_ULTRA_TINY;
break;
case SIZE_TINY:
case PANEL_SIZE_X_SMALL:
s = MENU_SIZE_TINY;
break;
case SIZE_SMALL:
case PANEL_SIZE_SMALL:
s = MENU_SIZE_SMALL;
break;
case SIZE_STANDARD:
case PANEL_SIZE_MEDIUM:
s = MENU_SIZE_STANDARD;
break;
case SIZE_LARGE:
case PANEL_SIZE_LARGE:
s = MENU_SIZE_LARGE;
break;
case SIZE_HUGE:
case PANEL_SIZE_X_LARGE:
s = MENU_SIZE_HUGE;
break;
case SIZE_RIDICULOUS:
case PANEL_SIZE_XX_LARGE:
s = MENU_SIZE_RIDICULOUS;
break;
default:
s = NULL;
return;
}
menuitem = gtk_object_get_data (GTK_OBJECT (menu), s);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
TRUE);
}
static void
update_back_menu (GtkWidget *menu, gpointer data)
{
......@@ -4838,13 +4843,13 @@ make_properties_submenu (GtkWidget *menu)
};
NameIdEnum sizes[] = {
{ N_("Ultra Tiny (12 pixels)"), MENU_SIZE_ULTRA_TINY, SIZE_ULTRA_TINY },
{ N_("Tiny (24 pixels)"), MENU_SIZE_TINY, SIZE_TINY },
{ N_("Small (36 pixels)"), MENU_SIZE_SMALL, SIZE_SMALL },
{ N_("Standard (48 pixels)"), MENU_SIZE_STANDARD, SIZE_STANDARD },
{ N_("Large (64 pixels)"), MENU_SIZE_LARGE, SIZE_LARGE },
{ N_("Huge (80 pixels)"), MENU_SIZE_HUGE, SIZE_HUGE },
{ N_("Ridiculous (128 pixels)"), MENU_SIZE_RIDICULOUS, SIZE_RIDICULOUS },
{ N_("XX Small (12 pixels)"), MENU_SIZE_ULTRA_TINY, PANEL_SIZE_XX_SMALL },
{ N_("X Small (24 pixels)"), MENU_SIZE_TINY, PANEL_SIZE_X_SMALL },
{ N_("Small (36 pixels)"), MENU_SIZE_SMALL, PANEL_SIZE_SMALL },
{ N_("Medium (48 pixels)"), MENU_SIZE_STANDARD, PANEL_SIZE_MEDIUM },
{ N_("Large (64 pixels)"), MENU_SIZE_LARGE, PANEL_SIZE_LARGE },
{ N_("X Large (80 pixels)"), MENU_SIZE_HUGE, PANEL_SIZE_X_LARGE },
{ N_("XX Large (128 pixels)"), MENU_SIZE_RIDICULOUS, PANEL_SIZE_XX_LARGE },
{ NULL, NULL, -1 }
};
......
......@@ -89,7 +89,7 @@ panel_applet_frame_load (const gchar *iid,
APPLET_BONOBO);
if (!info)
g_warning ("Cannot register control widget\n");
g_warning (_("Cannot register control widget\n"));
panel_applet_frame_set_info (PANEL_APPLET_FRAME (frame), info);
}
......@@ -104,8 +104,23 @@ panel_applet_frame_change_orient (PanelAppletFrame *frame,
GNOME_PanelAppletShell_changeOrientation (frame->priv->applet_shell, orient, &env);
if (BONOBO_EX (&env))
g_warning ("Error trying to change applet's orientation\n");
g_warning (_("Exception from changeOrientation: '%s'\n"),
BONOBO_EX_REPOID (&env));
CORBA_exception_free (&env);
}
void
panel_applet_frame_change_size (PanelAppletFrame *frame,
PanelSize size)
{
CORBA_Environment env;
CORBA_exception_init (&env);
GNOME_PanelAppletShell_changeSize (frame->priv->applet_shell, size, &env);
if (BONOBO_EX (&env))
g_warning (_("Exception from changeSize: '%s'\n"), BONOBO_EX_REPOID (&env));
CORBA_exception_free (&env);
}
......@@ -187,7 +202,7 @@ panel_applet_frame_get_applet_shell (Bonobo_Control control)
"IDL:GNOME/PanelAppletShell:1.0",
&env);
if (BONOBO_EX (&env)) {
g_warning ("Unable to obtain AppletShell interface from control\n");
g_warning (_("Unable to obtain AppletShell interface from control\n"));
retval = CORBA_OBJECT_NIL;
}
......
......@@ -55,6 +55,9 @@ void panel_applet_frame_load (const gchar *iid,
void panel_applet_frame_change_orient (PanelAppletFrame *frame,
PanelOrient orient);
void panel_applet_frame_change_size (PanelAppletFrame *frame,
PanelSize size);
G_END_DECLS
#endif /* __PANEL_APPLET_CONTROL_H__ */
......@@ -17,6 +17,9 @@ G_BEGIN_DECLS
void panel_applet_change_orient (PanelApplet *applet,
PanelAppletOrient orient);
void panel_applet_change_size (PanelApplet *applet,
const gint size);
G_END_DECLS
#endif /* __PANEL_APPLET_PRIVATE_H__ */
......@@ -31,6 +31,18 @@ impl_GNOME_PanelAppletShell_changeOrientation (PortableServer_Servant servant,
panel_applet_change_orient (shell->priv->applet, orient);
}
static void
impl_GNOME_PanelAppletShell_changeSize (PortableServer_Servant servant,
const GNOME_PanelSize size,
CORBA_Environment *ev)
{
PanelAppletShell *shell;
shell = PANEL_APPLET_SHELL (bonobo_object (servant));
panel_applet_change_size (shell->priv->applet, size);
}
static void
panel_applet_shell_finalize (GObject *object)
{
......@@ -50,6 +62,7 @@ panel_applet_shell_class_init (PanelAppletShellClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
klass->epv.changeOrientation = impl_GNOME_PanelAppletShell_changeOrientation;
klass->epv.changeSize = impl_GNOME_PanelAppletShell_changeSize;
object_class->finalize = panel_applet_shell_finalize;
......
......@@ -22,13 +22,16 @@ struct _PanelAppletPrivate {
PanelAppletShell *shell;
BonoboControl *control;
PanelAppletOrient orient;
gint size;
};
static GObjectClass *parent_class;
enum {
CHANGE_ORIENT,
CHANGE_SIZE,
LAST_SIGNAL
};
......@@ -47,6 +50,19 @@ panel_applet_change_orient (PanelApplet *applet,
}
}
void
panel_applet_change_size (PanelApplet *applet,
const gint size)
{
if (applet->priv->size != size) {
applet->priv->size = size;
g_signal_emit (G_OBJECT (applet),
panel_applet_signals [CHANGE_SIZE],
0, size);
}
}
void
panel_applet_setup_menu (PanelApplet *applet,
const gchar *xml,
......@@ -160,6 +176,18 @@ panel_applet_class_init (PanelAppletClass *klass,
G_TYPE_NONE,
1,
PANEL_TYPE_G_NOME__PANEL_ORIENT);
panel_applet_signals [CHANGE_SIZE] =
g_signal_new ("change_size",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (PanelAppletClass, change_size),
NULL,
NULL,
panel_marshal_VOID__INT,
G_TYPE_NONE,
1,
G_TYPE_INT);
}
static void
......@@ -169,6 +197,7 @@ panel_applet_instance_init (PanelApplet *applet,
applet->priv = g_new0 (PanelAppletPrivate, 1);
applet->priv->orient = PANEL_APPLET_ORIENT_UP;
applet->priv->size = GNOME_PANEL_MEDIUM;
gtk_widget_set_events (GTK_WIDGET (applet),
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
......
......@@ -51,6 +51,9 @@ struct _PanelAppletClass {
void (*change_orient) (PanelApplet *applet,
PanelAppletOrient orient);
void (*change_size) (PanelApplet *applet,
gint size);
};
GType panel_applet_get_type (void) G_GNUC_CONST;
......
......@@ -310,26 +310,26 @@ update_config_size (GtkWidget *panel)
p = PANEL_WIDGET(BASEP_WIDGET(panel)->panel);
switch(p->sz) {
case SIZE_ULTRA_TINY:
case PANEL_SIZE_XX_SMALL:
i = 0;
break;
case SIZE_TINY:
case PANEL_SIZE_X_SMALL:
i = 1;
break;
case SIZE_SMALL:
case PANEL_SIZE_SMALL:
i = 2;
break;
default:
case SIZE_STANDARD:
case PANEL_SIZE_MEDIUM:
i = 3;
break;
case SIZE_LARGE:
case PANEL_SIZE_LARGE:
i = 4;
break;
case SIZE_HUGE:
case PANEL_SIZE_X_LARGE:
i = 5;
break;
case SIZE_RIDICULOUS:
case PANEL_SIZE_XX_LARGE:
i = 6;
break;
}
......@@ -1271,21 +1271,21 @@ make_size_widget (PerPanelConfig *ppc)
GTK_SIGNAL_FUNC (activate_proper_item),
NULL);
menuitem = gtk_menu_item_new_with_label (_("Ultra Tiny (12 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("XX Small Tiny (12 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_ULTRA_TINY));
GINT_TO_POINTER (PANEL_SIZE_XX_SMALL));
menuitem = gtk_menu_item_new_with_label (_("Tiny (24 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("X Small (24 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_TINY));
GINT_TO_POINTER (PANEL_SIZE_X_SMALL));
menuitem = gtk_menu_item_new_with_label (_("Small (36 pixels)"));
gtk_widget_show(menuitem);
......@@ -1293,15 +1293,15 @@ make_size_widget (PerPanelConfig *ppc)
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_SMALL));
GINT_TO_POINTER (PANEL_SIZE_SMALL));
menuitem = gtk_menu_item_new_with_label (_("Standard (48 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("Medium (48 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_STANDARD));
GINT_TO_POINTER (PANEL_SIZE_MEDIUM));
menuitem = gtk_menu_item_new_with_label (_("Large (64 pixels)"));
gtk_widget_show(menuitem);
......@@ -1309,23 +1309,23 @@ make_size_widget (PerPanelConfig *ppc)
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_LARGE));
GINT_TO_POINTER (PANEL_SIZE_LARGE));
menuitem = gtk_menu_item_new_with_label (_("Huge (80 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("X Large (80 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_HUGE));
GINT_TO_POINTER (PANEL_SIZE_X_LARGE));
menuitem = gtk_menu_item_new_with_label (_("Ridiculous (128 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("XX Large (128 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_RIDICULOUS));
GINT_TO_POINTER (PANEL_SIZE_XX_LARGE));
ppc->size_menu = gtk_option_menu_new ();
gtk_option_menu_set_menu (GTK_OPTION_MENU (ppc->size_menu), menu);
......@@ -1342,26 +1342,26 @@ make_size_widget (PerPanelConfig *ppc)
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
switch(ppc->sz) {
case SIZE_ULTRA_TINY:
case PANEL_SIZE_XX_SMALL:
i = 0;
break;
case SIZE_TINY:
case PANEL_SIZE_X_SMALL:
i = 1;
break;
case SIZE_SMALL:
case PANEL_SIZE_SMALL:
i = 2;
break;
default:
case SIZE_STANDARD:
case PANEL_SIZE_MEDIUM:
i = 3;
break;
case SIZE_LARGE:
case PANEL_SIZE_LARGE:
i = 4;
break;
case SIZE_HUGE:
case PANEL_SIZE_X_LARGE:
i = 5;
break;
case SIZE_RIDICULOUS:
case PANEL_SIZE_XX_LARGE:
i = 6;
break;
}
......
VOID:ENUM,POINTER,POINTER
VOID:ENUM
VOID:INT
......@@ -12,15 +12,15 @@ typedef GNOME_PanelOrient PanelOrient;
#define PANEL_ORIENT_LEFT GNOME_ORIENT_LEFT
#define PANEL_ORIENT_RIGHT GNOME_ORIENT_RIGHT
enum {
SIZE_ULTRA_TINY = 12,
SIZE_TINY = 24,
SIZE_SMALL = 36,
SIZE_STANDARD = 48,
SIZE_LARGE = 64,
SIZE_HUGE = 80,
SIZE_RIDICULOUS = 128
};
typedef enum {
PANEL_SIZE_XX_SMALL = GNOME_PANEL_XX_SMALL,
PANEL_SIZE_X_SMALL = GNOME_PANEL_X_SMALL,
PANEL_SIZE_SMALL = GNOME_PANEL_SMALL,
PANEL_SIZE_MEDIUM = GNOME_PANEL_MEDIUM,
PANEL_SIZE_LARGE = GNOME_PANEL_LARGE,
PANEL_SIZE_X_LARGE = GNOME_PANEL_X_LARGE,
PANEL_SIZE_XX_LARGE = GNOME_PANEL_XX_LARGE
} PanelSize;
typedef GNOME_Panel_BackType PanelBackType;
#define PANEL_BACK_NONE GNOME_Panel_BACK_NONE
......
......@@ -266,16 +266,29 @@ border_edge_change (BorderPos *border,
static void size_change_foreach(GtkWidget *w, gpointer data);
void
size_change(AppletInfo *info, PanelWidget *panel)
size_change (AppletInfo *info,
PanelWidget *panel)
{
if (info->type == APPLET_EXTERN)
extern_handle_change_size ((Extern)info->data,
panel->sz);
else if(info->type == APPLET_STATUS) {
PanelSize size = panel->sz;
switch (info->type) {
case APPLET_BONOBO:
panel_applet_frame_change_size (
PANEL_APPLET_FRAME (info->data), size);
break;
case APPLET_EXTERN:
extern_handle_change_size ((Extern)info->data, size);
break;
case APPLET_STATUS: {
StatusApplet *status = info->data;
status->size = panel->sz;
status_applet_update(status);
status->size = size;
status_applet_update (status);
}
break;
default:
break;
}
}
......
......@@ -310,26 +310,26 @@ update_config_size (GtkWidget *panel)
p = PANEL_WIDGET(BASEP_WIDGET(panel)->panel);
switch(p->sz) {
case SIZE_ULTRA_TINY:
case PANEL_SIZE_XX_SMALL:
i = 0;
break;
case SIZE_TINY:
case PANEL_SIZE_X_SMALL:
i = 1;
break;
case SIZE_SMALL:
case PANEL_SIZE_SMALL:
i = 2;
break;
default:
case SIZE_STANDARD:
case PANEL_SIZE_MEDIUM:
i = 3;
break;
case SIZE_LARGE:
case PANEL_SIZE_LARGE:
i = 4;
break;
case SIZE_HUGE:
case PANEL_SIZE_X_LARGE:
i = 5;
break;
case SIZE_RIDICULOUS:
case PANEL_SIZE_XX_LARGE:
i = 6;
break;
}
......@@ -1271,21 +1271,21 @@ make_size_widget (PerPanelConfig *ppc)
GTK_SIGNAL_FUNC (activate_proper_item),
NULL);
menuitem = gtk_menu_item_new_with_label (_("Ultra Tiny (12 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("XX Small Tiny (12 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_ULTRA_TINY));
GINT_TO_POINTER (PANEL_SIZE_XX_SMALL));
menuitem = gtk_menu_item_new_with_label (_("Tiny (24 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("X Small (24 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_TINY));
GINT_TO_POINTER (PANEL_SIZE_X_SMALL));
menuitem = gtk_menu_item_new_with_label (_("Small (36 pixels)"));
gtk_widget_show(menuitem);
......@@ -1293,15 +1293,15 @@ make_size_widget (PerPanelConfig *ppc)
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_SMALL));
GINT_TO_POINTER (PANEL_SIZE_SMALL));
menuitem = gtk_menu_item_new_with_label (_("Standard (48 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("Medium (48 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_STANDARD));
GINT_TO_POINTER (PANEL_SIZE_MEDIUM));
menuitem = gtk_menu_item_new_with_label (_("Large (64 pixels)"));
gtk_widget_show(menuitem);
......@@ -1309,23 +1309,23 @@ make_size_widget (PerPanelConfig *ppc)
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_LARGE));
GINT_TO_POINTER (PANEL_SIZE_LARGE));
menuitem = gtk_menu_item_new_with_label (_("Huge (80 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("X Large (80 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_HUGE));
GINT_TO_POINTER (PANEL_SIZE_X_LARGE));
menuitem = gtk_menu_item_new_with_label (_("Ridiculous (128 pixels)"));
menuitem = gtk_menu_item_new_with_label (_("XX Large (128 pixels)"));
gtk_widget_show(menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_object_set_user_data (GTK_OBJECT (menuitem), ppc);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (size_set_size),
GINT_TO_POINTER (SIZE_RIDICULOUS));
GINT_TO_POINTER (PANEL_SIZE_XX_LARGE));
ppc->size_menu = gtk_option_menu_new ();
gtk_option_menu_set_menu (GTK_OPTION_MENU (ppc->size_menu), menu);
......@@ -1342,26 +1342,26 @@ make_size_widget (PerPanelConfig *ppc)
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
switch(ppc->sz) {
case SIZE_ULTRA_TINY:
case PANEL_SIZE_XX_SMALL:
i = 0;
break;
case SIZE_TINY:
case PANEL_SIZE_X_SMALL:
i = 1;
break;
case SIZE_SMALL:
case PANEL_SIZE_SMALL:
i = 2;
break;
default:
case SIZE_STANDARD:
case PANEL_SIZE_MEDIUM:
i = 3;
break;
case SIZE_LARGE:
case PANEL_SIZE_LARGE:
i = 4;
break;
case SIZE_HUGE:
case PANEL_SIZE_X_LARGE:
i = 5;
break;
case SIZE_RIDICULOUS:
case PANEL_SIZE_XX_LARGE:
i = 6;
break;
}
......
......@@ -1299,7 +1299,7 @@ init_user_panels(void)
BASEP_SHOWN /* state */,
BASEP_LEVEL_DEFAULT /* level */,
TRUE /* avoid_on_maximize */,
SIZE_STANDARD /* size */,
PANEL_SIZE_MEDIUM,
TRUE /* hidebuttons_enabled */,
TRUE /* hidebutton_pixmaps */,
PANEL_BACK_NONE /* back type */,
......@@ -1372,22 +1372,10 @@ init_user_panels(void)
rotate_pixmap_bg = conditional_get_bool ("rotate_pixmap_bg",
FALSE, NULL);
sz=conditional_get_int ("sz", SIZE_STANDARD, NULL);
sz=conditional_get_int ("sz", PANEL_SIZE_MEDIUM, NULL);
if(sz < 0)
sz = 0;
/*a hack to allow for old config files to be read correctly*/
/*don't update this if new sizes (SIZE_SMALL) are added*/
if(sz < 4) {
switch(sz) {
case 0: sz = SIZE_TINY; break;
case 1: sz = SIZE_STANDARD; break;
case 2: sz = SIZE_LARGE; break;
case 3: sz = SIZE_HUGE; break;
default: break;
}
}