Commit 6cea7d2d authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

state preservation, identified 3 different hidden states

Sun Feb 15 17:08:40 1998  George Lebl  <jirka@5z.com>

        * panel-widget.[ch]: state preservation, identified 3
          different hidden states

Sun Feb 15 15:16:44 1998  George Lebl  <jirka@5z.com>

        * panel.c, panel-widget.c, panel-widget.h, main.c: fixed
          a few bugs with panel-widget, added more support for
          free floating panels
parent f12a1e5d
Sun Feb 15 17:08:40 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch]: state preservation, identified 3
different hidden states
Sun Feb 15 15:16:44 1998 George Lebl <jirka@5z.com>
* panel.c, panel-widget.c, panel-widget.h, main.c: fixed
a few bugs with panel-widget, added more support for
free floating panels
Sun Feb 15 00:34:55 1998 George Lebl <jirka@5z.com>
* panel-widget.c: fixed a with applet placement.
......
Sun Feb 15 17:08:40 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch]: state preservation, identified 3
different hidden states
Sun Feb 15 15:16:44 1998 George Lebl <jirka@5z.com>
* panel.c, panel-widget.c, panel-widget.h, main.c: fixed
a few bugs with panel-widget, added more support for
free floating panels
Sun Feb 15 00:34:55 1998 George Lebl <jirka@5z.com>
* panel-widget.c: fixed a with applet placement.
......
......@@ -176,21 +176,22 @@ init_user_panels(void)
{
char buf[256];
int count,num;
int length,x,y;
int size,x,y;
PanelConfig config;
GtkWidget *panel;
GtkWidget *panel_menu;
PanelState state;
count=gnome_config_get_int("/panel/Config/panel_count=0");
if(count<=0) count++; /*this will load up a single panel with
default settings*/
for(num=1;num<=count;num++) {
/*these are only for free floating non-drawer like panels */
sprintf(buf,"/panel/Panel_%d/length=%d",num, 300);
length=gnome_config_get_int(buf);
sprintf(buf,"/panel/Panel_%d/geomx=0",num);
sprintf(buf,"/panel/Panel_%d/size=%d",num, 50);
size=gnome_config_get_int(buf);
sprintf(buf,"/panel/Panel_%d/position_x=0",num);
x=gnome_config_get_int(buf);
sprintf(buf,"/panel/Panel_%d/geomy=0",num);
sprintf(buf,"/panel/Panel_%d/position_y=0",num);
y=gnome_config_get_int(buf);
sprintf(buf,"/panel/Panel_%d/snapped=%d",num,
......@@ -207,19 +208,21 @@ init_user_panels(void)
sprintf(buf,"/panel/Panel_%d/state=%d",num,
PANEL_SHOWN);
config.state=gnome_config_get_int(buf);
state=gnome_config_get_int(buf);
panel = panel_widget_new(length,
panel = panel_widget_new(size,
config.orient,
config.snapped,
config.mode,
config.state,
state,
DEFAULT_EXPLICIT_HIDE_STEP_SIZE,
DEFAULT_MINIMIZED_SIZE,
DEFAULT_MINIMIZE_DELAY);
DEFAULT_MINIMIZE_DELAY,
/*the last three will get changed
anyway, they are globals*/
x,
y);
/*FIXME: this should be made cleaner I guess*/
......
......@@ -73,7 +73,7 @@ config_apply (GtkWidget *widget, gpointer data)
panel_config_struct.orient,
panel_config_struct.snapped,
panel_config_struct.mode,
panel_config_struct.state,
panel->state,
global_config.auto_hide_step_size,
global_config.minimized_size,
global_config.minimize_delay);
......@@ -82,7 +82,7 @@ config_apply (GtkWidget *widget, gpointer data)
panel_config_struct.orient,
panel_config_struct.snapped,
panel_config_struct.mode,
panel_config_struct.state,
panel->state,
global_config.explicit_hide_step_size,
global_config.minimized_size,
global_config.minimize_delay);
......@@ -225,7 +225,6 @@ panel_config(PanelWidget *panel)
panel_config_struct.orient = panel->orient;
panel_config_struct.snapped = panel->snapped;
panel_config_struct.mode = panel->mode;
panel_config_struct.state = panel->state;
/* main window */
......
This diff is collapsed.
......@@ -28,6 +28,7 @@ typedef enum {
} PanelOrientation;
typedef enum {
PANEL_FREE,
PANEL_DRAWER,
PANEL_TOP,
PANEL_BOTTOM,
PANEL_LEFT,
......@@ -40,13 +41,14 @@ typedef enum {
typedef enum {
PANEL_SHOWN,
PANEL_MOVING,
PANEL_HIDDEN
PANEL_HIDDEN,
PANEL_HIDDEN_RIGHT,
PANEL_HIDDEN_LEFT
} PanelState;
struct _AppletRecord
{
GtkWidget *applet;
GtkWidget *drawer;
gint cells;
};
......@@ -94,23 +96,20 @@ struct _PanelWidgetClass
};
guint panel_widget_get_type (void);
GtkWidget* panel_widget_new (gint length,
GtkWidget* panel_widget_new (gint size,
PanelOrientation orient,
PanelSnapped snapped,
PanelMode mode,
PanelState state,
gint step_size,
gint minimized_size,
gint minimize_delay);
gint minimize_delay,
gint pos_x,
gint pos_y);
/*add an applet to the panel, preferably at position pos*/
gint panel_widget_add (PanelWidget *panel,
GtkWidget *applet,
gint pos);
/*add a drawer (you supply the button) to the panel, preferably at
position pos*/
gint panel_widget_add_with_drawer (PanelWidget *panel,
GtkWidget *button,
gint pos);
/*move oldpos to newpos*/
gint panel_widget_move (PanelWidget *panel,
gint oldpos,
......
......@@ -144,6 +144,7 @@ save_panel_configuration(gpointer data, gpointer user_data)
char *path;
char *fullpath;
char buf[256];
int x,y;
int *num = user_data;
PanelWidget *panel = data;
......@@ -166,10 +167,6 @@ 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);
gnome_config_set_int(fullpath,panel->step_size);
g_free(fullpath);*/
fullpath = g_copy_strings(path,"minimized_size",NULL);
gnome_config_set_int(fullpath,panel->minimized_size);
g_free(fullpath);
......@@ -178,6 +175,21 @@ save_panel_configuration(gpointer data, gpointer user_data)
gnome_config_set_int(fullpath,panel->minimize_delay);
g_free(fullpath);
fullpath = g_copy_strings(path,"size",NULL);
gnome_config_set_int(fullpath,panel->size);
g_free(fullpath);
/*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);
g_free(path);
}
......
......@@ -29,7 +29,6 @@ struct _PanelConfig {
PanelOrientation orient;
PanelSnapped snapped;
PanelMode mode;
PanelState state;
};
typedef enum {
......
......@@ -73,7 +73,7 @@ config_apply (GtkWidget *widget, gpointer data)
panel_config_struct.orient,
panel_config_struct.snapped,
panel_config_struct.mode,
panel_config_struct.state,
panel->state,
global_config.auto_hide_step_size,
global_config.minimized_size,
global_config.minimize_delay);
......@@ -82,7 +82,7 @@ config_apply (GtkWidget *widget, gpointer data)
panel_config_struct.orient,
panel_config_struct.snapped,
panel_config_struct.mode,
panel_config_struct.state,
panel->state,
global_config.explicit_hide_step_size,
global_config.minimized_size,
global_config.minimize_delay);
......@@ -225,7 +225,6 @@ panel_config(PanelWidget *panel)
panel_config_struct.orient = panel->orient;
panel_config_struct.snapped = panel->snapped;
panel_config_struct.mode = panel->mode;
panel_config_struct.state = panel->state;
/* main window */
......
......@@ -74,7 +74,7 @@ gint_scale_update (GtkAdjustment *adjustment, gpointer data)
}
GtkWidget *
make_gint_scale_frame(gchar *title, gint *data)
make_gint_scale_frame(gchar *title, gint *data, double min, double max)
{
GtkWidget *frame;
GtkWidget *box;
......@@ -93,7 +93,7 @@ make_gint_scale_frame(gchar *title, gint *data)
/* Animation step_size scale */
scale_data = gtk_adjustment_new((double) (*data),
3.0, 100.0, 1.0, 1.0, 0.0);
min, max, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_data));
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
......@@ -122,28 +122,32 @@ animation_notebook_page(void)
/* AutoHide Animation step_size scale frame */
frame = make_gint_scale_frame(_("Auto-Hide Animation Speed"),
&(temp_config.auto_hide_step_size));
&(temp_config.auto_hide_step_size),
1.0,100.0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE,
CONFIG_PADDING_SIZE);
gtk_widget_show (frame);
/* ExplicitHide Animation step_size scale frame */
frame = make_gint_scale_frame(_("Explicit-Hide Animation Speed"),
&(temp_config.explicit_hide_step_size));
&(temp_config.explicit_hide_step_size),
1.0,100.0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE,
CONFIG_PADDING_SIZE);
gtk_widget_show (frame);
/* Minimize Delay scale frame */
frame = make_gint_scale_frame(_("Auto-Hide Minimize Delay (ms)"),
&(temp_config.minimize_delay));
&(temp_config.minimize_delay),
30.0,1000.0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE,
CONFIG_PADDING_SIZE);
gtk_widget_show (frame);
/* Minimized size scale frame */
frame = make_gint_scale_frame(_("Auto-Hide Minimized Size (pixels)"),
&(temp_config.minimized_size));
&(temp_config.minimized_size),
1.0,10.0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE,
CONFIG_PADDING_SIZE);
gtk_widget_show (frame);
......
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