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

fix a bug where a menu could only be torn off once

Thu Oct 07 18:31:37 1999  George Lebl  <jirka@5z.com>

        * menu.c: fix a bug where a menu could only be torn off once

        * gnome-panel-properties.(c|desktop),panel_config_global.[ch],
          session.[ch],main.c,menu.c,Makefile.am: put the global config
          into a crapplet
parent 202378c3
Thu Oct 07 18:31:37 1999 George Lebl <jirka@5z.com>
* menu.c: fix a bug where a menu could only be torn off once
* gnome-panel-properties.(c|desktop),panel_config_global.[ch],
session.[ch],main.c,menu.c,Makefile.am: put the global config
into a crapplet
Thu Oct 07 14:25:02 1999 George Lebl <jirka@5z.com>
* menu-fentry.c: (get_applet_goad_id_from_dentry) check ii being null
......
Thu Oct 07 18:31:37 1999 George Lebl <jirka@5z.com>
* menu.c: fix a bug where a menu could only be torn off once
* gnome-panel-properties.(c|desktop),panel_config_global.[ch],
session.[ch],main.c,menu.c,Makefile.am: put the global config
into a crapplet
Thu Oct 07 14:25:02 1999 George Lebl <jirka@5z.com>
* menu-fentry.c: (get_applet_goad_id_from_dentry) check ii being null
......
......@@ -13,7 +13,7 @@ INCLUDES = -I. -I$(srcdir) \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(includedir) $(GNOME_INCLUDEDIR) $(ORB_CFLAGS)
bin_PROGRAMS = panel
bin_PROGRAMS = panel gnome-panel-properties-capplet
libpanel_appletincludedir = $(includedir)
libpanel_statusincludedir = $(includedir)
......@@ -71,7 +71,6 @@ base_panel_SOURCES=\
session.h \
panel_config.c \
panel_config.h \
panel_config_global.c \
panel_config_global.h \
menu.c \
menu.h \
......@@ -119,14 +118,27 @@ base_panel_SOURCES=\
tearoffitem.h
panel_SOURCES = \
$(base_panel_SOURCES) \
$(CORBA_SRCLIST)
$(base_panel_SOURCES)
# it should work without this as we link libpanel_applet anyway for shlib
# applets and it already links to CORBA_SRCLIST, so this should give us a
# dubious gain in linking speed and memory usage
# $(CORBA_SRCLIST)
$(base_panel_SOURCES): $(CORBA_SRCLIST)
#$(base_panel_SOURCES): $(CORBA_SRCLIST)
panel_LDADD = libpanel_applet.la $(GNOME_LIBDIR) $(GNORBA_LIBS) $(ORB_LIBS) $(GNOMEUI_LIBS) $(INTLLIBS)
panel_LDFLAGS=-export-dynamic
gnome_panel_properties_capplet_SOURCES = \
gnome-panel-properties.c \
panel-util.c \
$(CORBA_SRCLIST)
gnome_panel_properties_capplet_LDADD = -lcapplet \
$(GNOME_LIBDIR) $(ORB_LIBS) \
$(GNOMEUI_LIBS) $(INTLLIBS) -lgnorba
data_DATA = panelrc
## Why not just make this via configure? Because @datadir@ will be
......@@ -148,14 +160,15 @@ MOSTLYCLEANFILES = panelrc
MAINTAINERCLEANFILES = $(CORBA_SRCLIST)
EXTRA_DIST = \
panelrc.in \
panel.in \
appletsConf.sh.in \
dockletsConf.sh.in \
panel.gnorba \
panel.soundlist \
APPLET_WRITING \
panel.hints
panelrc.in \
panel.in \
appletsConf.sh.in \
dockletsConf.sh.in \
panel.gnorba \
panel.soundlist \
APPLET_WRITING \
panel.hints \
gnome-panel-properties.desktop
## Put `exec' in the name because this should be installed by
## `install-exec', not `install-data'.
......@@ -193,4 +206,10 @@ soundlist_DATA = panel.soundlist
hintsdir = $(datadir)/gnome/hints
hints_DATA = panel.hints
sysdir = $(datadir)/control-center/
sys_DATA = gnome-panel-properties.desktop
install-data-local:
$(INSTALL_DATA) $(srcdir)/gnome-panel-properties.desktop $(DESTDIR)$(datadir)/gnome/apps/Settings/gnome-panel-properties.desktop
$(srcdir)/panel-util.c: $(CORBA_SRCLIST)
......@@ -32,7 +32,6 @@ int applet_count = 0;
extern int config_sync_timeout;
extern int applets_to_sync;
extern int panels_to_sync;
extern int globals_to_sync;
extern int need_complete_save;
extern GlobalConfig global_config;
......
......@@ -29,7 +29,6 @@ extern int applet_count;
extern int config_sync_timeout;
extern int applets_to_sync;
extern int panels_to_sync;
extern int globals_to_sync;
extern int need_complete_save;
extern GtkTooltips *panel_tooltips;
......@@ -82,6 +81,10 @@ s_panel_add_status(POA_GNOME_Panel *servant,
CORBA_unsigned_long* wid,
CORBA_Environment *ev);
static void
s_panel_notice_config_changes(POA_GNOME_Panel *servant,
CORBA_Environment *ev);
/*** PanelSpot stuff ***/
......@@ -194,7 +197,8 @@ static POA_GNOME_Panel__epv panel_epv = {
(gpointer)&s_panel_add_applet_full,
(gpointer)&s_panel_quit,
(gpointer)&s_panel_get_in_drag,
(gpointer)&s_panel_add_status
(gpointer)&s_panel_add_status,
(gpointer)&s_panel_notice_config_changes
};
static POA_GNOME_Panel__vepv panel_vepv = { &panel_base_epv, &panel_epv };
static POA_GNOME_Panel panel_servant = { NULL, &panel_vepv };
......@@ -624,6 +628,13 @@ s_panel_add_status(POA_GNOME_Panel *servant,
return CORBA_Object_duplicate(acc, ev);
}
static void
s_panel_notice_config_changes(POA_GNOME_Panel *servant,
CORBA_Environment *ev)
{
load_up_globals();
}
/*** PanelSpot stuff ***/
......
#include "config.h"
/* gnome-panel-properties: crapplet for global panel properties
*
* Copyright (C) 1999 Free Software Foundation
* Author: George Lebl <jirka@5z.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include <config.h>
#include <gnome.h>
#include <string.h>
#include "panel-include.h"
/* used to temporarily store config values until the 'Apply'
* button is pressed. */
GlobalConfig temp_config;
extern GlobalConfig global_config;
extern int config_sync_timeout;
extern int panels_to_sync;
extern int applets_to_sync;
extern int globals_to_sync;
extern int need_complete_save;
static GtkWidget *aniframe[2];
static GtkWidget *tilefile[LAST_TILE];
static GtkWidget *tileborder[LAST_TILE];
#include <libgnorba/gnorba.h>
#include "capplet-widget.h"
/*we just use the GlobalConfig and LAST_TILE definitions, some panel-util stuff,
and the DEFAULT_* defines from session.h !!!*/
#include "panel-types.h"
#include "panel_config_global.h"
#include "panel-util.h"
#include "session.h"
static GlobalConfig global_config;
static GlobalConfig loaded_config;
/* animation page */
static GtkWidget *enable_animations_cb;
static GtkWidget *simple_movement_cb;
static GtkWidget *anim_frame;
static GtkAdjustment *auto_hide_step_size;
static GtkAdjustment *explicit_hide_step_size;
static GtkAdjustment *drawer_step_size;
static GtkAdjustment *minimize_delay;
static GtkAdjustment *minimized_size;
/* buttons page */
static GtkWidget *tile_enable_cb[LAST_TILE];
static GtkWidget *tile_file_box[LAST_TILE];
static GtkWidget *tile_border_box[LAST_TILE];
static GtkAdjustment *tile_border[LAST_TILE];
static GtkAdjustment *tile_depth[LAST_TILE];
static GtkWidget *entry_up[LAST_TILE];
static GtkWidget *entry_down[LAST_TILE];
static GtkWidget *config_window;
static GtkWidget *hide_panel_frame_cb;
static GtkWidget *tile_when_over_cb;
static void
config_destroy(GtkWidget *widget, gpointer data)
{
config_window = NULL;
}
static void
set_toggle_button_value (GtkWidget *widget, gpointer data)
{
*(int *)data=(GTK_TOGGLE_BUTTON(widget)->active==TRUE);
if(config_window)
gnome_property_box_changed (GNOME_PROPERTY_BOX (config_window));
}
/* applet page*/
static GtkWidget *movement_type_switch_rb;
static GtkWidget *movement_type_free_rb;
static GtkWidget *movement_type_push_rb;
static GtkAdjustment *applet_padding;
static void
config_apply (GtkWidget *widget, int page, gpointer data)
{
int i;
if(page!=-1)
return;
for(i=0;i<LAST_TILE;i++) {
g_free(global_config.tile_up[i]);
g_free(global_config.tile_down[i]);
}
memcpy(&global_config,&temp_config,sizeof(GlobalConfig));
for(i=0;i<LAST_TILE;i++) {
global_config.tile_up[i] =
gnome_icon_entry_get_filename(GNOME_ICON_ENTRY(entry_up[i]));
global_config.tile_down[i] =
gnome_icon_entry_get_filename(GNOME_ICON_ENTRY(entry_down[i]));
}
/* miscellaneous page */
static GtkWidget *show_small_icons_cb;
static GtkWidget *show_dot_buttons_cb;
static GtkWidget *off_panel_popups_cb;
static GtkWidget *hungry_menus_cb;
static GtkWidget *tooltips_enabled_cb;
static GtkWidget *drawer_auto_close_cb;
static GtkWidget *autoraise_cb;
static GtkWidget *keep_bottom_cb;
apply_global_config();
static gboolean changing = TRUE;
static GtkWidget *capplet;
globals_to_sync = TRUE;
panel_config_sync();
static void
changed_cb(void)
{
if(!changing)
capplet_widget_state_changed(CAPPLET_WIDGET(capplet), TRUE);
}
static void
......@@ -118,25 +137,13 @@ config_event(GtkWidget *widget,GdkEvent *event,GtkNotebook *nbook)
return FALSE;
}
static void
int_scale_update (GtkAdjustment *adjustment, gpointer data)
{
int *val = data;
double scale_val = adjustment->value;
*val = (int) scale_val;
if(config_window)
gnome_property_box_changed (GNOME_PROPERTY_BOX (config_window));
}
static GtkWidget *
make_int_scale_box (char *title, int *data,
make_int_scale_box (char *title, GtkAdjustment **adj,
double min, double max, double step)
{
GtkWidget *label;
GtkWidget *box;
GtkWidget *scale;
GtkObject *scale_data;
/* vbox for frame */
box = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
......@@ -149,18 +156,16 @@ make_int_scale_box (char *title, int *data,
gtk_widget_show (label);
/* Animation step_size scale */
scale_data = gtk_adjustment_new((double) (*data),
min, max, step, step, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_data));
*adj = GTK_ADJUSTMENT(gtk_adjustment_new(min, min, max, step, step, 0.0));
scale = gtk_hscale_new (*adj);
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, 0);
gtk_signal_connect(GTK_OBJECT (scale_data),
gtk_signal_connect(GTK_OBJECT (*adj),
"value_changed",
GTK_SIGNAL_FUNC (int_scale_update),
data);
GTK_SIGNAL_FUNC (changed_cb),NULL);
gtk_widget_show (scale);
return box;
......@@ -169,25 +174,56 @@ make_int_scale_box (char *title, int *data,
static int
set_anim_button_value(GtkWidget *w, gpointer data)
{
int disable = !(GTK_TOGGLE_BUTTON(w)->active);
int enable = GTK_TOGGLE_BUTTON(w)->active;
gtk_widget_set_sensitive(aniframe[0],!disable);
gtk_widget_set_sensitive(aniframe[1],!disable);
temp_config.disable_animations = disable;
gtk_widget_set_sensitive(simple_movement_cb,enable);
gtk_widget_set_sensitive(anim_frame,enable);
if(config_window)
gnome_property_box_changed (GNOME_PROPERTY_BOX (config_window));
if(!changing)
capplet_widget_state_changed(CAPPLET_WIDGET(capplet), TRUE);
return FALSE;
}
static void
sync_animation_page_with_config(GlobalConfig *conf)
{
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(auto_hide_step_size,
conf->auto_hide_step_size);
gtk_adjustment_set_value(explicit_hide_step_size,
conf->explicit_hide_step_size);
gtk_adjustment_set_value(drawer_step_size,
conf->drawer_step_size);
gtk_adjustment_set_value(minimize_delay,
conf->minimize_delay);
gtk_adjustment_set_value(minimized_size,
conf->minimized_size);
}
static void
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->auto_hide_step_size = auto_hide_step_size->value;
conf->explicit_hide_step_size = explicit_hide_step_size->value;
conf->drawer_step_size = drawer_step_size->value;
conf->minimize_delay = minimize_delay->value;
conf->minimized_size = minimized_size->value;
}
static GtkWidget *
animation_notebook_page(void)
{
GtkWidget *frame;
GtkWidget *box;
GtkWidget *vbox;
GtkWidget *button;
GtkWidget *w;
GtkWidget *frame_vbox;
/* main vbox */
......@@ -195,57 +231,45 @@ animation_notebook_page(void)
gtk_container_set_border_width(GTK_CONTAINER (vbox), GNOME_PAD_SMALL);
/* Animation enable */
button = gtk_check_button_new_with_label (_("Enable animations"));
gtk_signal_connect (GTK_OBJECT (button), "toggled",
enable_animations_cb = gtk_check_button_new_with_label (_("Enable animations"));
gtk_signal_connect (GTK_OBJECT (enable_animations_cb), "toggled",
GTK_SIGNAL_FUNC (set_anim_button_value),NULL);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), enable_animations_cb, FALSE, FALSE, 0);
w = gtk_check_button_new_with_label (_("Constant speed animations"));
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
/*we have to do this after everything we need aniframe varaibles set*/
if (temp_config.simple_movement)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
/*note it's not a frame, but it's disabled anyhow*/
aniframe[0] = w;
if (temp_config.disable_animations)
gtk_widget_set_sensitive(w,FALSE);
gtk_signal_connect (GTK_OBJECT (w), "toggled",
GTK_SIGNAL_FUNC (set_toggle_button_value),
&(temp_config.simple_movement));
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);
/* AutoHide Animation step_size scale frame */
frame = gtk_frame_new (_("Animation speed"));
gtk_container_set_border_width(GTK_CONTAINER (frame), GNOME_PAD_SMALL);
if (temp_config.disable_animations)
gtk_widget_set_sensitive (frame, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
aniframe[1] = frame;
anim_frame = gtk_frame_new (_("Animation speed"));
gtk_container_set_border_width(GTK_CONTAINER (anim_frame), GNOME_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (vbox), anim_frame, TRUE, TRUE, 0);
gtk_widget_show (anim_frame);
frame_vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
gtk_container_set_border_width (GTK_CONTAINER (frame_vbox), GNOME_PAD_SMALL);
gtk_container_add (GTK_CONTAINER (frame), frame_vbox);
gtk_container_add (GTK_CONTAINER (anim_frame), frame_vbox);
gtk_widget_show (frame_vbox);
box = make_int_scale_box(_("Auto hide"),
&(temp_config.auto_hide_step_size),
&auto_hide_step_size,
1.0, 100.0, 1.0);
gtk_box_pack_start (GTK_BOX (frame_vbox), box, TRUE, FALSE,0);
gtk_widget_show (box);
/* ExplicitHide Animation step_size scale frame */
box = make_int_scale_box(_("Explicit hide"),
&(temp_config.explicit_hide_step_size),
&explicit_hide_step_size,
1.0, 100.0, 1.0);
gtk_box_pack_start (GTK_BOX (frame_vbox), box, TRUE, FALSE,0);
/* DrawerHide Animation step_size scale frame */
box = make_int_scale_box(_("Drawer sliding"),
&(temp_config.drawer_step_size),
&drawer_step_size,
1.0, 100.0, 1.0);
gtk_box_pack_start (GTK_BOX (frame_vbox), box, TRUE, FALSE,0);
frame = gtk_frame_new (_("Auto hide"));
gtk_container_set_border_width(GTK_CONTAINER (frame), GNOME_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
......@@ -258,51 +282,72 @@ animation_notebook_page(void)
/* Minimize Delay scale frame */
box = make_int_scale_box (_("Delay (ms)"),
&(temp_config.minimize_delay),
&minimize_delay,
30.0, 10000.0, 10.0);
gtk_box_pack_start (GTK_BOX (frame_vbox), box, TRUE, FALSE, 0);
/* Minimized size scale frame */
box = make_int_scale_box (_("Size (pixels)"),
&(temp_config.minimized_size),
&minimized_size,
1.0, 10.0, 1.0);
gtk_box_pack_start (GTK_BOX (frame_vbox), box, TRUE, FALSE, 0);
/*we have to do this after everything we need aniframe varaibles set*/
if (!temp_config.disable_animations)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
return (vbox);
}
static int
set_movement (GtkWidget *widget, gpointer data)
static void
sync_buttons_page_with_config(GlobalConfig *conf)
{
PanelMovementType move_type = (PanelMovementType) data;
if(!(GTK_TOGGLE_BUTTON(widget)->active))
return FALSE;
temp_config.movement_type = move_type;
int i;
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(hide_panel_frame_cb),
conf->hide_panel_frame);
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(tile_when_over_cb),
conf->tile_when_over);
if(config_window)
gnome_property_box_changed (GNOME_PROPERTY_BOX (config_window));
return FALSE;
for(i=0;i<LAST_TILE;i++) {
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(tile_enable_cb[i]),
conf->tiles_enabled[i]);
gnome_icon_entry_set_icon(GNOME_ICON_ENTRY(entry_up[i]),
conf->tile_up[i]);
gnome_icon_entry_set_icon(GNOME_ICON_ENTRY(entry_down[i]),
conf->tile_down[i]);
gtk_adjustment_set_value(tile_border[i],conf->tile_border[i]);
gtk_adjustment_set_value(tile_depth[i],conf->tile_depth[i]);
}
}
static void
sync_config_with_buttons_page(GlobalConfig *conf)
{
int i;
conf->hide_panel_frame =
GTK_TOGGLE_BUTTON(hide_panel_frame_cb)->active;
conf->tile_when_over =
GTK_TOGGLE_BUTTON(tile_when_over_cb)->active;
static int
set_icon_button_value(GtkWidget *w, gpointer data)
for(i=0;i<LAST_TILE;i++) {
conf->tiles_enabled[i] =
GTK_TOGGLE_BUTTON(tile_enable_cb[i])->active;
g_free(conf->tile_up[i]);
conf->tile_up[i] =
gnome_icon_entry_get_filename(GNOME_ICON_ENTRY(entry_up[i]));
g_free(conf->tile_down[i]);
conf->tile_down[i] =
gnome_icon_entry_get_filename(GNOME_ICON_ENTRY(entry_down[i]));
conf->tile_border[i] = tile_border[i]->value;
conf->tile_depth[i] = tile_depth[i]->value;
}
}
static void
set_icon_button(GtkWidget *w, gpointer data)
{
int i = GPOINTER_TO_INT(data);
int active = GTK_TOGGLE_BUTTON(w)->active;
gtk_widget_set_sensitive(tilefile[i],active);
gtk_widget_set_sensitive(tileborder[i],active);
temp_config.tiles_enabled[i] = active;
gtk_widget_set_sensitive(tile_file_box[i],active);
gtk_widget_set_sensitive(tile_border_box[i],active);
if(config_window)
gnome_property_box_changed (GNOME_PROPERTY_BOX (config_window));
return FALSE;
changed_cb();
}
enum {
......@@ -313,22 +358,20 @@ enum {
N_PAGES
};
static gint
static void
show_page (GtkWidget *w, gpointer data)
{
GtkWidget *notebook = gtk_object_get_user_data (GTK_OBJECT (w));
gtk_notebook_set_page (GTK_NOTEBOOK (notebook), GPOINTER_TO_INT (data));
return FALSE;
}
static GtkWidget *
icon_notebook_page(int i, GtkWidget *config_box)
icon_notebook_page(int i)
{
GtkWidget *frame;
GtkWidget *w;
GtkWidget *table;
GtkWidget *vbox;
GtkWidget *toggle;
char *icon_titles[]={
N_("Launcher icon"),
......@@ -339,7 +382,6 @@ icon_notebook_page(int i, GtkWidget *config_box)
/* Image frame */
frame = gtk_frame_new (_(icon_titles[i]));
gtk_container_set_border_width(GTK_CONTAINER (frame), GNOME_PAD_SMALL);
gtk_widget_set_sensitive(frame,temp_config.tiles_enabled[i]);
/* main vbox */
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
......@@ -347,17 +389,15 @@ icon_notebook_page(int i, GtkWidget *config_box)
gtk_container_add (GTK_CONTAINER (frame), vbox);
/* toggle button */
toggle = gtk_check_button_new_with_label (_("Tiles enabled"));
if (temp_config.tiles_enabled[i])
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), TRUE);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (set_icon_button_value),
tile_enable_cb[i] = gtk_check_button_new_with_label (_("Tiles enabled"));
gtk_signal_connect (GTK_OBJECT (tile_enable_cb[i]), "toggled",
GTK_SIGNAL_FUNC (set_icon_button),
GINT_TO_POINTER(i));
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), tile_enable_cb[i], FALSE, FALSE, 0);
/* table for frame */
tilefile[i] = table = gtk_table_new(2,3,FALSE);
tile_file_box[i] = table = gtk_table_new(2,3,FALSE);
gtk_container_set_border_width(GTK_CONTAINER (table), GNOME_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
......@@ -365,26 +405,36 @@ icon_notebook_page(int i, GtkWidget *config_box)
entry_up[i] = create_icon_entry(table,"tile_file",0, 1,
_("Normal Tile"),
global_config.tile_up[i],
config_box);
NULL);
w = gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (entry_up[i]));
gtk_signal_connect_while_alive(GTK_OBJECT(w), "changed",
GTK_SIGNAL_FUNC(changed_cb),
NULL,
GTK_OBJECT(capplet));
entry_down[i] = create_icon_entry(table,"tile_file",1, 2,
_("Clicked Tile"),
global_config.tile_down[i],
config_box);
NULL);
w = gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (entry_down[i]));
gtk_signal_connect_while_alive(GTK_OBJECT(w), "changed",
GTK_SIGNAL_FUNC(changed_cb),
NULL,
GTK_OBJECT(capplet));
w = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
gtk_widget_show (w);
/* Minimized size scale frame */
tileborder[i] = w = make_int_scale_box (_("Border width (tile only)"),
&(temp_config.tile_border[i]),
tile_border_box[i] = w = make_int_scale_box (_("Border width (tile only)"),
&tile_border[i],
0.0, 10.0, 1.0);
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
gtk_widget_set_sensitive(w,temp_config.tiles_enabled[i]);
/* Minimized size scale frame */
w = make_int_scale_box (_("Depth (displacement when pressed)"),
&(temp_config.tile_depth[i]),
&tile_depth[i],
0.0, 10.0, 1.0);
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
......@@ -392,7 +442,7 @@ icon_notebook_page(int i, GtkWidget *config_box)
}
static GtkWidget *
buttons_notebook_page (GtkWidget *config_box)
buttons_notebook_page (void)
{
GtkWidget *m, *w;
GtkWidget *box;
......@@ -432,7 +482,7 @@ buttons_notebook_page (GtkWidget *config_box)
gtk_widget_show (w);
gtk_menu_append (GTK_MENU (m), w);
page = icon_notebook_page (i, config_box);
page = icon_notebook_page (i);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, NULL);
gtk_object_set_user_data (GTK_OBJECT (w), notebook);
......@@ -446,36 +496,62 @@ buttons_notebook_page (GtkWidget *config_box)
gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0);
gtk_widget_show (notebook);
/* show/hide frame */
w = gtk_check_button_new_with_label (_("Make buttons flush with panel edge"));
if (temp_config.hide_panel_frame)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
gtk_signal_connect (GTK_OBJECT (w), "toggled",
GTK_SIGNAL_FUNC (set_toggle_button_value),
&(temp_config.hide_panel_frame));
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
/* show/hide frame */
hide_panel_frame_cb = gtk_check_button_new_with_label (_("Make buttons flush with panel edge"));
gtk_signal_connect (GTK_OBJECT (hide_panel_frame_cb), "toggled",
GTK_SIGNAL_FUNC (changed_cb), NULL);
gtk_box_pack_start (GTK_BOX (vbox), hide_panel_frame_cb, FALSE, FALSE, 0);
/* only show tiles when mouse is over the button */
w = gtk_check_button_new_with_label (_("Show button tiles only when cursor is over the button"));
if (temp_config.tile_when_over)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
gtk_signal_connect (GTK_OBJECT (w), "toggled",
GTK_SIGNAL_FUNC (set_toggle_button_value),