Added ability to turn off the brush and pattern indicators.

Also fixed a small bug in the pattern code that let a pattern stay
up if the user focussed on another widget before releasing mouse button.

Modified Files:
 	ChangeLog app/devices.c app/gimprc.c app/gimprc.h
 	app/interface.c app/preferences_dialog.c app/indicator_area.c
This commit is contained in:
Seth Burgess 1999-06-14 02:23:53 +00:00
parent 13a6519f0c
commit 8c9544675b
17 changed files with 171 additions and 16 deletions

View File

@ -1,3 +1,18 @@
Sun Jun 13 21:05:00 CST 1999 Seth Burgess <sjburges@gimp.org>
* app/devices
* app/gimprc.[c,h]
* app/interface.c
* app/preferences_dialog.c: Make the indicator area on the toolbar
something that the user can turn off after a restart. Currently it
(and most other such fucntions) give no indication of error if user
clicks OK and not Save - this needs to let the user know that changes
will not take effect w/o a save. It will not update once OK is clicked
though, which is very much less than preferable behavior
* app/indicator_area.c: fixed a bug that let the preview stay up if the
user clicked, dragged, and refocussed on another widget
Sat Jun 12 23:45:01 CEST 1999 Marc Lehmann <pcg@goof.com>
* docs/parasites.txt: nicks comments...

View File

@ -1360,8 +1360,10 @@ device_status_update (guint32 deviceid)
gtk_widget_show (deviceD->patterns[i]);
}
}
brush_area_update();
pattern_area_update();
if (show_indicators) {
brush_area_update();
pattern_area_update();
}
}

View File

@ -101,6 +101,7 @@ static char * old_image_title_format;
static int old_global_paint_options;
static int old_max_new_image_size;
static int old_thumbnail_mode;
static int old_show_indicators;
/* variables which can't be changed on the fly */
static int edit_stingy_memory_use;
@ -273,6 +274,12 @@ file_prefs_ok_callback (GtkWidget *widget,
gtk_tooltips_enable (tool_tips);
else
gtk_tooltips_disable (tool_tips);
/* This needs modification to notify the user of which simply cannot be
* changed on the fly. Currently it ignores these options if only OK is
* pressed.
*/
}
static void
@ -370,6 +377,12 @@ file_prefs_save_callback (GtkWidget *widget,
update = g_list_append (update, "save-device-status");
remove = g_list_append (remove, "dont-save-device-status");
}
if (show_indicators != old_show_indicators)
{
update = g_list_append (update, "show-indicators");
remove = g_list_append (remove, "dont-show-indicators");
restart_notification = TRUE;
}
if (always_restore_session != old_always_restore_session)
update = g_list_append (update, "always-restore-session");
if (default_width != old_default_width ||
@ -560,6 +573,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
num_processors = old_num_processors;
max_new_image_size = old_max_new_image_size;
thumbnail_mode = old_thumbnail_mode;
show_indicators = old_show_indicators;
if (preview_size != old_preview_size)
{
@ -653,6 +667,8 @@ file_prefs_toggle_callback (GtkWidget *widget,
}
else if (data == &global_paint_options)
paint_options_set_global (GTK_TOGGLE_BUTTON (widget)->active);
else if (data == &show_indicators)
show_indicators = GTK_TOGGLE_BUTTON (widget)->active;
else if (data == &thumbnail_mode)
{
val = data;
@ -1435,6 +1451,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_global_paint_options = global_paint_options;
old_max_new_image_size = max_new_image_size;
old_thumbnail_mode = thumbnail_mode;
old_show_indicators = show_indicators;
file_prefs_strset (&old_temp_path, edit_temp_path);
file_prefs_strset (&old_swap_path, edit_swap_path);
@ -1951,6 +1968,22 @@ file_pref_cmd_callback (GtkWidget *widget,
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
gtk_widget_show (label);
/* Indicators */
vbox2 = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2);
gtk_container_add (GTK_CONTAINER (vbox), vbox2);
gtk_widget_show (vbox2);
button =
gtk_check_button_new_with_label(_("Display brush and pattern indicators on Toolbar"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
show_indicators);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
(GtkSignalFunc) file_prefs_toggle_callback,
&show_indicators);
gtk_widget_show (button);
/* Expand the "Interface" branch */
gtk_ctree_expand (GTK_CTREE (ctree), top_insert);

View File

@ -550,7 +550,8 @@ create_toolbox ()
/*create_tool_label (vbox);*/
/*create_progress_area (vbox);*/
create_color_area (vbox);
create_indicator_area (vbox);
if (show_indicators)
create_indicator_area (vbox);
gtk_widget_show (window);

View File

@ -550,7 +550,8 @@ create_toolbox ()
/*create_tool_label (vbox);*/
/*create_progress_area (vbox);*/
create_color_area (vbox);
create_indicator_area (vbox);
if (show_indicators)
create_indicator_area (vbox);
gtk_widget_show (window);

View File

@ -149,6 +149,7 @@ int using_xserver_resolution = FALSE;
int num_processors = 1;
char * image_title_format = NULL;
int global_paint_options = TRUE;
int show_indicators = TRUE;
int max_new_image_size = 33554432; /* 32 MB */
int thumbnail_mode = 1;
@ -288,6 +289,8 @@ static ParseFunc funcs[] =
{ "image-title-format", TT_STRING, &image_title_format, NULL },
{ "parasite", TT_XPARASITE, NULL, NULL },
{ "global-paint-options", TT_BOOLEAN, &global_paint_options, NULL },
{ "show-indicators", TT_BOOLEAN, &show_indicators, NULL },
{ "dont-show-indicators", TT_BOOLEAN, NULL, &show_indicators },
{ "no-global-paint-options", TT_BOOLEAN, NULL, &global_paint_options },
{ "module-load-inhibit", TT_PATH, &module_db_load_inhibit, NULL },
{ "max-new-image-size", TT_MEMSIZE, &max_new_image_size, NULL },

View File

@ -74,6 +74,7 @@ extern int using_xserver_resolution;
extern int num_processors;
extern char * image_title_format;
extern int global_paint_options;
extern int show_indicators;
extern int max_new_image_size;
extern int thumbnail_mode;

View File

@ -1360,8 +1360,10 @@ device_status_update (guint32 deviceid)
gtk_widget_show (deviceD->patterns[i]);
}
}
brush_area_update();
pattern_area_update();
if (show_indicators) {
brush_area_update();
pattern_area_update();
}
}

View File

@ -121,6 +121,7 @@ brush_area_update ()
int ystart;
int i, j;
brush = get_active_brush();
if (!brush)
{
@ -368,9 +369,15 @@ pattern_area_events (GtkWidget *widget,
case GDK_BUTTON_PRESS:
bevent = (GdkEventButton *) event;
if (bevent->button == 1)
{
gdk_pointer_grab (widget->window, FALSE,
(GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK),
NULL, NULL, bevent->time);
create_pattern_dialog();
/* Show the pattern popup window if the pattern is too large */
@ -384,6 +391,7 @@ pattern_area_events (GtkWidget *widget,
bevent = (GdkEventButton *) event;
if (bevent->button == 1)
gdk_pointer_ungrab (bevent->time);
{
if (device_patpopup != NULL)
gtk_widget_hide (device_patpopup);

View File

@ -1360,8 +1360,10 @@ device_status_update (guint32 deviceid)
gtk_widget_show (deviceD->patterns[i]);
}
}
brush_area_update();
pattern_area_update();
if (show_indicators) {
brush_area_update();
pattern_area_update();
}
}

View File

@ -101,6 +101,7 @@ static char * old_image_title_format;
static int old_global_paint_options;
static int old_max_new_image_size;
static int old_thumbnail_mode;
static int old_show_indicators;
/* variables which can't be changed on the fly */
static int edit_stingy_memory_use;
@ -273,6 +274,12 @@ file_prefs_ok_callback (GtkWidget *widget,
gtk_tooltips_enable (tool_tips);
else
gtk_tooltips_disable (tool_tips);
/* This needs modification to notify the user of which simply cannot be
* changed on the fly. Currently it ignores these options if only OK is
* pressed.
*/
}
static void
@ -370,6 +377,12 @@ file_prefs_save_callback (GtkWidget *widget,
update = g_list_append (update, "save-device-status");
remove = g_list_append (remove, "dont-save-device-status");
}
if (show_indicators != old_show_indicators)
{
update = g_list_append (update, "show-indicators");
remove = g_list_append (remove, "dont-show-indicators");
restart_notification = TRUE;
}
if (always_restore_session != old_always_restore_session)
update = g_list_append (update, "always-restore-session");
if (default_width != old_default_width ||
@ -560,6 +573,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
num_processors = old_num_processors;
max_new_image_size = old_max_new_image_size;
thumbnail_mode = old_thumbnail_mode;
show_indicators = old_show_indicators;
if (preview_size != old_preview_size)
{
@ -653,6 +667,8 @@ file_prefs_toggle_callback (GtkWidget *widget,
}
else if (data == &global_paint_options)
paint_options_set_global (GTK_TOGGLE_BUTTON (widget)->active);
else if (data == &show_indicators)
show_indicators = GTK_TOGGLE_BUTTON (widget)->active;
else if (data == &thumbnail_mode)
{
val = data;
@ -1435,6 +1451,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_global_paint_options = global_paint_options;
old_max_new_image_size = max_new_image_size;
old_thumbnail_mode = thumbnail_mode;
old_show_indicators = show_indicators;
file_prefs_strset (&old_temp_path, edit_temp_path);
file_prefs_strset (&old_swap_path, edit_swap_path);
@ -1951,6 +1968,22 @@ file_pref_cmd_callback (GtkWidget *widget,
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
gtk_widget_show (label);
/* Indicators */
vbox2 = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2);
gtk_container_add (GTK_CONTAINER (vbox), vbox2);
gtk_widget_show (vbox2);
button =
gtk_check_button_new_with_label(_("Display brush and pattern indicators on Toolbar"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
show_indicators);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
(GtkSignalFunc) file_prefs_toggle_callback,
&show_indicators);
gtk_widget_show (button);
/* Expand the "Interface" branch */
gtk_ctree_expand (GTK_CTREE (ctree), top_insert);

View File

@ -121,6 +121,7 @@ brush_area_update ()
int ystart;
int i, j;
brush = get_active_brush();
if (!brush)
{
@ -368,9 +369,15 @@ pattern_area_events (GtkWidget *widget,
case GDK_BUTTON_PRESS:
bevent = (GdkEventButton *) event;
if (bevent->button == 1)
{
gdk_pointer_grab (widget->window, FALSE,
(GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK),
NULL, NULL, bevent->time);
create_pattern_dialog();
/* Show the pattern popup window if the pattern is too large */
@ -384,6 +391,7 @@ pattern_area_events (GtkWidget *widget,
bevent = (GdkEventButton *) event;
if (bevent->button == 1)
gdk_pointer_ungrab (bevent->time);
{
if (device_patpopup != NULL)
gtk_widget_hide (device_patpopup);

View File

@ -550,7 +550,8 @@ create_toolbox ()
/*create_tool_label (vbox);*/
/*create_progress_area (vbox);*/
create_color_area (vbox);
create_indicator_area (vbox);
if (show_indicators)
create_indicator_area (vbox);
gtk_widget_show (window);

View File

@ -101,6 +101,7 @@ static char * old_image_title_format;
static int old_global_paint_options;
static int old_max_new_image_size;
static int old_thumbnail_mode;
static int old_show_indicators;
/* variables which can't be changed on the fly */
static int edit_stingy_memory_use;
@ -273,6 +274,12 @@ file_prefs_ok_callback (GtkWidget *widget,
gtk_tooltips_enable (tool_tips);
else
gtk_tooltips_disable (tool_tips);
/* This needs modification to notify the user of which simply cannot be
* changed on the fly. Currently it ignores these options if only OK is
* pressed.
*/
}
static void
@ -370,6 +377,12 @@ file_prefs_save_callback (GtkWidget *widget,
update = g_list_append (update, "save-device-status");
remove = g_list_append (remove, "dont-save-device-status");
}
if (show_indicators != old_show_indicators)
{
update = g_list_append (update, "show-indicators");
remove = g_list_append (remove, "dont-show-indicators");
restart_notification = TRUE;
}
if (always_restore_session != old_always_restore_session)
update = g_list_append (update, "always-restore-session");
if (default_width != old_default_width ||
@ -560,6 +573,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
num_processors = old_num_processors;
max_new_image_size = old_max_new_image_size;
thumbnail_mode = old_thumbnail_mode;
show_indicators = old_show_indicators;
if (preview_size != old_preview_size)
{
@ -653,6 +667,8 @@ file_prefs_toggle_callback (GtkWidget *widget,
}
else if (data == &global_paint_options)
paint_options_set_global (GTK_TOGGLE_BUTTON (widget)->active);
else if (data == &show_indicators)
show_indicators = GTK_TOGGLE_BUTTON (widget)->active;
else if (data == &thumbnail_mode)
{
val = data;
@ -1435,6 +1451,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_global_paint_options = global_paint_options;
old_max_new_image_size = max_new_image_size;
old_thumbnail_mode = thumbnail_mode;
old_show_indicators = show_indicators;
file_prefs_strset (&old_temp_path, edit_temp_path);
file_prefs_strset (&old_swap_path, edit_swap_path);
@ -1951,6 +1968,22 @@ file_pref_cmd_callback (GtkWidget *widget,
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
gtk_widget_show (label);
/* Indicators */
vbox2 = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2);
gtk_container_add (GTK_CONTAINER (vbox), vbox2);
gtk_widget_show (vbox2);
button =
gtk_check_button_new_with_label(_("Display brush and pattern indicators on Toolbar"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
show_indicators);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
(GtkSignalFunc) file_prefs_toggle_callback,
&show_indicators);
gtk_widget_show (button);
/* Expand the "Interface" branch */
gtk_ctree_expand (GTK_CTREE (ctree), top_insert);

View File

@ -1360,8 +1360,10 @@ device_status_update (guint32 deviceid)
gtk_widget_show (deviceD->patterns[i]);
}
}
brush_area_update();
pattern_area_update();
if (show_indicators) {
brush_area_update();
pattern_area_update();
}
}

View File

@ -1360,8 +1360,10 @@ device_status_update (guint32 deviceid)
gtk_widget_show (deviceD->patterns[i]);
}
}
brush_area_update();
pattern_area_update();
if (show_indicators) {
brush_area_update();
pattern_area_update();
}
}

View File

@ -121,6 +121,7 @@ brush_area_update ()
int ystart;
int i, j;
brush = get_active_brush();
if (!brush)
{
@ -368,9 +369,15 @@ pattern_area_events (GtkWidget *widget,
case GDK_BUTTON_PRESS:
bevent = (GdkEventButton *) event;
if (bevent->button == 1)
{
gdk_pointer_grab (widget->window, FALSE,
(GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK),
NULL, NULL, bevent->time);
create_pattern_dialog();
/* Show the pattern popup window if the pattern is too large */
@ -384,6 +391,7 @@ pattern_area_events (GtkWidget *widget,
bevent = (GdkEventButton *) event;
if (bevent->button == 1)
gdk_pointer_ungrab (bevent->time);
{
if (device_patpopup != NULL)
gtk_widget_hide (device_patpopup);