Commit 5f581388 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

set drawer animation speed.

Thu May 07 01:59:18 1998  George Lebl  <jirka@5z.com>

        * panel-widget.[ch],main.c, panel.c, panel_global_config.[ch]:
          set drawer animation speed.

also new, the new test applet, I wasgetting tired of the boring logout
applet, so I've written a new one (just to take a break from finals) ...
it's the fish applet ... great for relief of stress, but otherwise very
useless ... it doesn't install a .desktop .. so if you really really want
to waste your time running it run fish_applet
-George
parent d7ce5fe2
Thu May 07 01:59:18 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch],main.c, panel.c, panel_global_config.[ch]:
set drawer animation speed.
Thu May 07 00:18:23 1998 George Lebl <jirka@5z.com>
* panel-widget.c: minor fix to the forbidden handeling
......
Thu May 07 01:59:18 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch],main.c, panel.c, panel_global_config.[ch]:
set drawer animation speed.
Thu May 07 00:18:23 1998 George Lebl <jirka@5z.com>
* panel-widget.c: minor fix to the forbidden handeling
......
......@@ -22,7 +22,7 @@ INCLUDES = -I. -I$(srcdir) \
## FIXME: logout should really be an internal applets since it is just
## too trivial
bin_PROGRAMS = panel logout_applet #launcher_applet
bin_PROGRAMS = panel logout_applet fish_applet #launcher_applet
CORBA_SOURCES = \
gnome-panel.cc \
......@@ -92,6 +92,16 @@ panel_LDADD = $(GNOME_LIBDIR) $(MICO_LIBS) -lXt $(GNOMEUI_LIBS) $(INTLLIBS)
#launcher_applet_LDADD = libpanel_applet.la $(GNOME_LIBDIR) $(MICO_LIBS) -lXt \
# $(GNOMEUI_LIBS) $(INTLLIBS)
fish_applet_SOURCES = \
fish.c
## Must define linker for fish_applet -- it needs a C++ linker, but
## automake doesn't discover that automatically.
fish_applet_LINK = $(CXXLINK)
fish_applet_LDADD = libpanel_applet.la $(GNOME_LIBDIR) $(MICO_LIBS) \
-lXt $(GNOMEUI_LIBS) $(INTLLIBS)
logout_applet_SOURCES = \
logout.c
## Must define linker for logout_applet -- it needs a C++ linker, but
......
/* fish.c - The msot useless applet, it's an ugly fish drawing
* by the least sane person, yes you guessed, George, it's nice
* to break the monotony of finals
*/
#include "gnome.h"
#include "applet-lib.h"
#include "applet-widget.h"
#include "fish1.xpm"
#include "fish2.xpm"
#include "fish3.xpm"
static GtkWidget *applet;
static GdkPixmap *pix[3];
static GdkPixmap *mask[3];
static gint curpix = 0;
static gint
destroy_applet(GtkWidget *widget, gpointer data)
{
gtk_exit(0);
return FALSE;
}
static gint
fish_timeout(gpointer data)
{
GtkWidget *pixmap = data;
curpix++;
if(curpix>=3) curpix=0;
gtk_pixmap_set(GTK_PIXMAP(pixmap),pix[curpix],mask[curpix]);
gtk_widget_queue_draw(pixmap);
return TRUE;
}
static GtkWidget *
create_fish_widget(GtkWidget *window)
{
GtkWidget *frame;
GtkWidget *pixmap;
GtkStyle *style;
style = gtk_widget_get_style(window);
pix[0] = gdk_pixmap_create_from_xpm_d(window->window, &mask[0],
&style->bg[GTK_STATE_NORMAL],
(gchar **)fish1_xpm);
pix[1] = gdk_pixmap_create_from_xpm_d(window->window, &mask[1],
&style->bg[GTK_STATE_NORMAL],
(gchar **)fish2_xpm);
pix[2] = gdk_pixmap_create_from_xpm_d(window->window, &mask[2],
&style->bg[GTK_STATE_NORMAL],
(gchar **)fish3_xpm);
pixmap = gtk_pixmap_new(pix[0],mask[0]);
gtk_widget_show(pixmap);
curpix = 0;
gtk_timeout_add(300,fish_timeout,pixmap);
frame = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(frame),GTK_SHADOW_IN);
gtk_container_add(GTK_CONTAINER(frame),pixmap);
return frame;
}
/*the most important dialog in the whole application*/
void
about_cb (AppletWidget *widget, gpointer data)
{
GtkWidget *about;
gchar *authors[] = {
"Wanda, the fish",
"with minor help from George",
NULL
};
about = gnome_about_new ( "The GNOME Fish Applet", "3.4.7.4",
"(C) 1998 the Free Software Foundation",
authors,
"This applet has no use what-so-ever. "
"It only takes up disk space and "
"compilation time, and if loaded it also "
"takes up precious panel space and memory. "
"If anyone is found using this applet, he "
"should be promptly sent for a psychiatric "
"evaluation.",
NULL);
gtk_widget_show (about);
return;
}
int
main(int argc, char *argv[])
{
GtkWidget *fish;
panel_corba_register_arguments();
gnome_init("fish_applet", NULL, argc, argv, 0, NULL);
applet = applet_widget_new(argv[0]);
if (!applet)
g_error("Can't create applet!\n");
gtk_widget_realize(applet);
fish = create_fish_widget(applet);
gtk_widget_show(fish);
applet_widget_add(APPLET_WIDGET(applet), fish);
gtk_widget_show(applet);
gtk_signal_connect(GTK_OBJECT(applet),"destroy",
GTK_SIGNAL_FUNC(destroy_applet),
NULL);
applet_widget_register_callback(APPLET_WIDGET(applet),
"about",
_("About"),
about_cb,
NULL);
applet_widget_gtk_main();
return 0;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -758,6 +758,7 @@ init_user_panels(void)
panel_widget_change_global(DEFAULT_EXPLICIT_HIDE_STEP_SIZE,
DEFAULT_AUTO_HIDE_STEP_SIZE,
DEFAULT_DRAWER_STEP_SIZE,
DEFAULT_MINIMIZED_SIZE,
DEFAULT_MINIMIZE_DELAY,
PANEL_SWITCH_MOVE);
......@@ -959,6 +960,10 @@ main(int argc, char **argv)
DEFAULT_EXPLICIT_HIDE_STEP_SIZE);
global_config.explicit_hide_step_size=gnome_config_get_int(buf);
g_snprintf(buf,256,"drawer_step_size=%d",
DEFAULT_DRAWER_STEP_SIZE);
global_config.drawer_step_size=gnome_config_get_int(buf);
g_snprintf(buf,256,"minimize_delay=%d", DEFAULT_MINIMIZE_DELAY);
global_config.minimize_delay=gnome_config_get_int(buf);
......
......@@ -7,6 +7,7 @@ typedef struct _GlobalConfig GlobalConfig;
struct _GlobalConfig {
gint auto_hide_step_size;
gint explicit_hide_step_size;
gint drawer_step_size;
gint minimized_size;
gint minimize_delay;
gint tooltips_enabled;
......
......@@ -17,6 +17,7 @@ static int panel_try_to_set_pixmap (PanelWidget *panel, char *pixmap);
static GdkCursor *fleur_cursor;
static gint pw_explicit_step = 50;
static gint pw_drawer_step = 20;
static gint pw_auto_step = 10;
static gint pw_minimized_size = 6;
static gint pw_minimize_delay = 300;
......@@ -1406,14 +1407,14 @@ panel_widget_open_drawer(PanelWidget *panel)
move_resize_window(GTK_WIDGET(panel),x+width,y,
0,height);
move_horiz_d(panel, x+width, x,
pw_explicit_step,FALSE);
pw_drawer_step,FALSE);
} else {
gdk_window_move(GTK_WIDGET(panel)->window,-1000,-1000);
gtk_widget_show(GTK_WIDGET(panel));
move_resize_window(GTK_WIDGET(panel),x-width,y,
0,height);
move_horiz_d(panel, x-width, x,
pw_explicit_step,FALSE);
pw_drawer_step,FALSE);
}
} else {
if(panel->drawer_drop_zone_pos==DROP_ZONE_LEFT) {
......@@ -1422,14 +1423,14 @@ panel_widget_open_drawer(PanelWidget *panel)
move_resize_window(GTK_WIDGET(panel),x,y+height,
width,0);
move_vert_d(panel, y+height, y,
pw_explicit_step,FALSE);
pw_drawer_step,FALSE);
} else {
gdk_window_move(GTK_WIDGET(panel)->window,-1000,-1000);
gtk_widget_show(GTK_WIDGET(panel));
move_resize_window(GTK_WIDGET(panel),x,y-height,
width,0);
move_vert_d(panel, y-height, y,
pw_explicit_step,FALSE);
pw_drawer_step,FALSE);
}
}
......@@ -1467,17 +1468,17 @@ panel_widget_close_drawer(PanelWidget *panel)
if(panel->orient == PANEL_HORIZONTAL) {
if(panel->drawer_drop_zone_pos==DROP_ZONE_LEFT)
move_horiz_d(panel, x, x+width,
pw_explicit_step, TRUE);
pw_drawer_step, TRUE);
else
move_horiz_d(panel, x, x-width,
pw_explicit_step, TRUE);
pw_drawer_step, TRUE);
} else {
if(panel->drawer_drop_zone_pos==DROP_ZONE_LEFT)
move_vert_d(panel, y, y+height,
pw_explicit_step, TRUE);
pw_drawer_step, TRUE);
else
move_vert_d(panel, y, y-height,
pw_explicit_step, TRUE);
pw_drawer_step, TRUE);
}
gtk_widget_hide(GTK_WIDGET(panel));
......@@ -3097,6 +3098,7 @@ panel_widget_restore_state(PanelWidget *panel)
void
panel_widget_change_global(gint explicit_step,
gint auto_step,
gint drawer_step,
gint minimized_size,
gint minimize_delay,
PanelMovementType move_type)
......@@ -3105,6 +3107,8 @@ panel_widget_change_global(gint explicit_step,
pw_explicit_step=explicit_step;
if(auto_step>0)
pw_auto_step=auto_step;
if(drawer_step>0)
pw_drawer_step=drawer_step;
if(minimized_size>0)
pw_minimized_size=minimized_size;
if(minimize_delay>=0)
......
......@@ -221,6 +221,7 @@ void panel_widget_change_drop_zone_pos(PanelWidget *panel,
/*change global params*/
void panel_widget_change_global (gint explicit_step,
gint auto_step,
gint drawer_step,
gint minimized_size,
gint minimize_delay,
PanelMovementType move_type);
......
......@@ -52,6 +52,7 @@ apply_global_config(void)
{
panel_widget_change_global(global_config.explicit_hide_step_size,
global_config.auto_hide_step_size,
global_config.drawer_step_size,
global_config.minimized_size,
global_config.minimize_delay,
global_config.movement_type);
......@@ -267,6 +268,8 @@ panel_session_save (GnomeClient *client,
global_config.auto_hide_step_size);
gnome_config_set_int("explicit_hide_step_size",
global_config.explicit_hide_step_size);
gnome_config_set_int("drawer_step_size",
global_config.drawer_step_size);
gnome_config_set_int("minimized_size", global_config.minimized_size);
gnome_config_set_int("minimize_delay", global_config.minimize_delay);
gnome_config_set_bool("tooltips_enabled",
......
......@@ -15,6 +15,7 @@ BEGIN_GNOME_DECLS
#define DEFAULT_AUTO_HIDE_STEP_SIZE 10
#define DEFAULT_EXPLICIT_HIDE_STEP_SIZE 50
#define DEFAULT_DRAWER_STEP_SIZE 30
/* amount of time in ms. to wait before lowering panel */
#define DEFAULT_MINIMIZE_DELAY 300
......
......@@ -118,6 +118,13 @@ animation_notebook_page(void)
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE,
CONFIG_PADDING_SIZE);
/* ExplicitHide Animation step_size scale frame */
frame = make_gint_scale_frame(_("Drawer Animation Speed"),
&(temp_config.drawer_step_size),
1.0,100.0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE,
CONFIG_PADDING_SIZE);
/* Minimize Delay scale frame */
frame = make_gint_scale_frame(_("Auto-Hide Minimize Delay (ms)"),
&(temp_config.minimize_delay),
......
......@@ -7,6 +7,7 @@ typedef struct _GlobalConfig GlobalConfig;
struct _GlobalConfig {
gint auto_hide_step_size;
gint explicit_hide_step_size;
gint drawer_step_size;
gint minimized_size;
gint minimize_delay;
gint tooltips_enabled;
......
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