Commit 1e93126f authored by Glynn Foster's avatar Glynn Foster Committed by Glynn Foster

basep-widget.c, gnome-panel-properties.c, Remove 'simple_movement' and opt

2001-10-18  Glynn Foster  <glynn.foster@sun.com>

	* basep-widget.c, gnome-panel-properties.c,
	* panel_config_global.h, session.c: Remove 'simple_movement' and
	  opt for the slightly more complicated sin() algorithm as default.
parent 3067a91d
2001-10-18 Glynn Foster <glynn.foster@sun.com>
* basep-widget.c, gnome-panel-properties.c,
* panel_config_global.h, session.c: Remove 'simple_movement' and
opt for the slightly more complicated sin() algorithm as default.
2001-10-18 Mark McLoughlin <mark@skynet.ie>
* main.h, main.c (panel_main_gconf_client): impl.
......
......@@ -589,35 +589,28 @@ basep_widget_set_ebox_orient(BasePWidget *basep,
static int
move_step(int src, int dest, long start_time, long end_time, long cur_time)
{
double percentage;
double n, d, percentage;
if(src == dest)
return dest;
if(global_config.simple_movement) {
percentage = ((double)(cur_time-start_time))/(end_time-start_time);
if(percentage>1.0)
percentage = 1.0;
return src + ((dest - src)*percentage);
} else {
double n = cur_time-start_time;
double d = end_time-start_time;
if(n<d) {
/*blah blah blah just a simple function to make the
movement more "sin" like ... we run it twice to
pronounce make it more pronounced*/
percentage = sin(M_PI*(n/d)-M_PI/2)/2+0.5;
percentage = sin(M_PI*percentage-M_PI/2)/2+0.5;
if(percentage<0.0)
percentage = 0.0;
else if(percentage>1.0)
percentage = 1.0;
} else
n = cur_time-start_time;
d = end_time-start_time;
if(n<d) {
/*blah blah blah just a simple function to make the
movement more "sin" like ... we run it twice to
pronounce make it more pronounced*/
percentage = sin(M_PI*(n/d)-M_PI/2)/2+0.5;
percentage = sin(M_PI*percentage-M_PI/2)/2+0.5;
if(percentage<0.0)
percentage = 0.0;
else if(percentage>1.0)
percentage = 1.0;
} else
percentage = 1.0;
return src + ((dest - src)*percentage);
}
return src + ((dest - src)*percentage);
}
void
......
......@@ -62,7 +62,6 @@ GSList *applets_last = NULL;
/* animation page */
static GtkWidget *enable_animations_cb;
static GtkWidget *simple_movement_cb;
static GtkWidget *anim_frame;
static GtkAdjustment *hiding_step_size;
static GtkAdjustment *minimize_delay;
......@@ -254,7 +253,6 @@ set_anim_button_value(GtkWidget *w, gpointer data)
{
int enable = GTK_TOGGLE_BUTTON(w)->active;
gtk_widget_set_sensitive(simple_movement_cb,enable);
gtk_widget_set_sensitive(anim_frame,enable);
if(!changing)
......@@ -265,16 +263,12 @@ set_anim_button_value(GtkWidget *w, gpointer data)
static void
sync_animation_page_with_config(GlobalConfig *conf)
{
gtk_widget_set_sensitive(simple_movement_cb,
!conf->disable_animations);
gtk_widget_set_sensitive(anim_frame,
!conf->disable_animations);
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(enable_animations_cb),
/*notice the not*/
!conf->disable_animations);
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(simple_movement_cb),
conf->simple_movement);
gtk_adjustment_set_value(hiding_step_size,
conf->hiding_step_size);
gtk_adjustment_set_value(minimize_delay,
......@@ -290,8 +284,6 @@ sync_config_with_animation_page(GlobalConfig *conf)
/*notice the not*/
conf->disable_animations =
! GTK_TOGGLE_BUTTON(enable_animations_cb)->active;
conf->simple_movement =
GTK_TOGGLE_BUTTON(simple_movement_cb)->active;
conf->hiding_step_size = hiding_step_size->value;
conf->minimize_delay = minimize_delay->value;
conf->maximize_delay = maximize_delay->value;
......@@ -315,11 +307,6 @@ animation_notebook_page(void)
GTK_SIGNAL_FUNC (set_anim_button_value),NULL);
gtk_box_pack_start (GTK_BOX (vbox), enable_animations_cb, FALSE, FALSE, 0);
simple_movement_cb = gtk_check_button_new_with_label (_("Constant speed animations"));
gtk_box_pack_start (GTK_BOX (vbox), simple_movement_cb, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (simple_movement_cb), "toggled",
GTK_SIGNAL_FUNC (changed_cb), NULL);
/* Auto and Explicit Hide Animation step_size scale frame */
anim_frame = gtk_frame_new (_("Panel Animation Settings"));
gtk_container_set_border_width(GTK_CONTAINER (anim_frame), GNOME_PAD_SMALL);
......@@ -1388,8 +1375,6 @@ loadup_vals (void)
global_config.drawer_auto_close =
conditional_get_bool ("drawer_auto_close", FALSE, NULL);
global_config.simple_movement =
conditional_get_bool ("simple_movement", FALSE, NULL);
global_config.hide_panel_frame =
conditional_get_bool ("hide_panel_frame", FALSE, NULL);
global_config.tile_when_over =
......@@ -1515,8 +1500,6 @@ write_config (GlobalConfig *conf)
conf->normal_layer);
gnome_config_set_bool("drawer_auto_close",
conf->drawer_auto_close);
gnome_config_set_bool("simple_movement",
conf->simple_movement);
gnome_config_set_bool("hide_panel_frame",
conf->hide_panel_frame);
gnome_config_set_bool("tile_when_over",
......
......@@ -62,7 +62,6 @@ GSList *applets_last = NULL;
/* animation page */
static GtkWidget *enable_animations_cb;
static GtkWidget *simple_movement_cb;
static GtkWidget *anim_frame;
static GtkAdjustment *hiding_step_size;
static GtkAdjustment *minimize_delay;
......@@ -254,7 +253,6 @@ set_anim_button_value(GtkWidget *w, gpointer data)
{
int enable = GTK_TOGGLE_BUTTON(w)->active;
gtk_widget_set_sensitive(simple_movement_cb,enable);
gtk_widget_set_sensitive(anim_frame,enable);
if(!changing)
......@@ -265,16 +263,12 @@ set_anim_button_value(GtkWidget *w, gpointer data)
static void
sync_animation_page_with_config(GlobalConfig *conf)
{
gtk_widget_set_sensitive(simple_movement_cb,
!conf->disable_animations);
gtk_widget_set_sensitive(anim_frame,
!conf->disable_animations);
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(enable_animations_cb),
/*notice the not*/
!conf->disable_animations);
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(simple_movement_cb),
conf->simple_movement);
gtk_adjustment_set_value(hiding_step_size,
conf->hiding_step_size);
gtk_adjustment_set_value(minimize_delay,
......@@ -290,8 +284,6 @@ sync_config_with_animation_page(GlobalConfig *conf)
/*notice the not*/
conf->disable_animations =
! GTK_TOGGLE_BUTTON(enable_animations_cb)->active;
conf->simple_movement =
GTK_TOGGLE_BUTTON(simple_movement_cb)->active;
conf->hiding_step_size = hiding_step_size->value;
conf->minimize_delay = minimize_delay->value;
conf->maximize_delay = maximize_delay->value;
......@@ -315,11 +307,6 @@ animation_notebook_page(void)
GTK_SIGNAL_FUNC (set_anim_button_value),NULL);
gtk_box_pack_start (GTK_BOX (vbox), enable_animations_cb, FALSE, FALSE, 0);
simple_movement_cb = gtk_check_button_new_with_label (_("Constant speed animations"));
gtk_box_pack_start (GTK_BOX (vbox), simple_movement_cb, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (simple_movement_cb), "toggled",
GTK_SIGNAL_FUNC (changed_cb), NULL);
/* Auto and Explicit Hide Animation step_size scale frame */
anim_frame = gtk_frame_new (_("Panel Animation Settings"));
gtk_container_set_border_width(GTK_CONTAINER (anim_frame), GNOME_PAD_SMALL);
......@@ -1388,8 +1375,6 @@ loadup_vals (void)
global_config.drawer_auto_close =
conditional_get_bool ("drawer_auto_close", FALSE, NULL);
global_config.simple_movement =
conditional_get_bool ("simple_movement", FALSE, NULL);
global_config.hide_panel_frame =
conditional_get_bool ("hide_panel_frame", FALSE, NULL);
global_config.tile_when_over =
......@@ -1515,8 +1500,6 @@ write_config (GlobalConfig *conf)
conf->normal_layer);
gnome_config_set_bool("drawer_auto_close",
conf->drawer_auto_close);
gnome_config_set_bool("simple_movement",
conf->simple_movement);
gnome_config_set_bool("hide_panel_frame",
conf->hide_panel_frame);
gnome_config_set_bool("tile_when_over",
......
......@@ -22,7 +22,6 @@ struct _GlobalConfig {
gboolean keep_bottom;
gboolean normal_layer;
gboolean drawer_auto_close;
gboolean simple_movement;
gboolean tiles_enabled[LAST_TILE];
char *tile_up[LAST_TILE];
char *tile_down[LAST_TILE];
......
......@@ -22,7 +22,6 @@ struct _GlobalConfig {
gboolean keep_bottom;
gboolean normal_layer;
gboolean drawer_auto_close;
gboolean simple_movement;
gboolean tiles_enabled[LAST_TILE];
char *tile_up[LAST_TILE];
char *tile_down[LAST_TILE];
......
......@@ -1765,8 +1765,6 @@ load_up_globals (void)
global_config.drawer_auto_close =
conditional_get_bool ("drawer_auto_close", FALSE, NULL);
global_config.simple_movement =
conditional_get_bool ("simple_movement", FALSE, NULL);
global_config.hide_panel_frame =
conditional_get_bool ("hide_panel_frame", FALSE, NULL);
global_config.tile_when_over =
......@@ -1870,8 +1868,6 @@ write_global_config (void)
global_config.normal_layer);
gnome_config_set_bool ("drawer_auto_close",
global_config.drawer_auto_close);
gnome_config_set_bool ("simple_movement",
global_config.simple_movement);
gnome_config_set_bool ("hide_panel_frame",
global_config.hide_panel_frame);
gnome_config_set_bool ("tile_when_over",
......@@ -1956,8 +1952,6 @@ convert_write_config(void)
global_config.keep_bottom);
gnome_config_set_bool("drawer_auto_close",
global_config.drawer_auto_close);
gnome_config_set_bool("simple_movement",
global_config.simple_movement);
gnome_config_set_bool("hide_panel_frame",
global_config.hide_panel_frame);
gnome_config_set_bool("tile_when_over",
......@@ -2046,7 +2040,6 @@ convert_read_old_config(void)
global_config.keep_bottom = gnome_config_get_bool("keep_bottom=FALSE");
global_config.drawer_auto_close = gnome_config_get_bool("drawer_auto_close=FALSE");
global_config.simple_movement = gnome_config_get_bool("simple_movement=FALSE");
global_config.hide_panel_frame = gnome_config_get_bool("hide_panel_frame=FALSE");
global_config.tile_when_over = gnome_config_get_bool("tile_when_over=FALSE");
for(i=0;i<LAST_TILE;i++) {
......
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