use the new tooltip API instead of the old deprecated one. Removed

2007-11-09  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimphelpui.[ch]: use the new tooltip API instead
	of the old deprecated one. Removed _gimp_help_init(). Remember
	whether tooltips are enabled or not in a local variable that can
	only be altered at startup time and not after. The API now expects
	markup instead of plain text which might cause warnings and
	perhaps needs to be changed.

	* libgimpwidgets/gimpwidgets-private.c: don't call _gimp_help_init().

	* app/config/gimpguiconfig.c: made show-tooltips a
	GIMP_CONFIG_PARAM_RESTART property.

	* app/widgets/gimptoolbox-color-area.c: don't add the tooltip here...

	* app/widgets/gimptoolbox.c: ...but here (as for all other
	indicators). Also escape '&' properly because we now use markup.

	* app/tools/gimpselectionoptions.c
	* app/widgets/gimpeditor.c
	* app/widgets/gimpwidgets-utils.c: print modifiers and
	shortcuts in bold instead of in ().

	* app/widgets/gimpcontainertreeview.c: show tooltips on rows if
	gimp_viewable_get_description() returns a tip.

	* app/dialogs/preferences-dialog.c
	* plug-ins/jpeg/jpeg-save.c
	* plug-ins/MapObject/mapobject_ui.c
	* plug-ins/Lighting/lighting_ui.c
	* plug-ins/common/animationplay.c
	* plug-ins/common/warp.c: no need to add event boxes just to have
	tooltips, the new ones work on all widgets.


svn path=/trunk/; revision=24093
This commit is contained in:
Michael Natterer 2007-11-09 11:17:00 +00:00 committed by Michael Natterer
parent e985096088
commit a446f3d7fb
17 changed files with 218 additions and 181 deletions

View File

@ -1,3 +1,38 @@
2007-11-09 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimphelpui.[ch]: use the new tooltip API instead
of the old deprecated one. Removed _gimp_help_init(). Remember
whether tooltips are enabled or not in a local variable that can
only be altered at startup time and not after. The API now expects
markup instead of plain text which might cause warnings and
perhaps needs to be changed.
* libgimpwidgets/gimpwidgets-private.c: don't call _gimp_help_init().
* app/config/gimpguiconfig.c: made show-tooltips a
GIMP_CONFIG_PARAM_RESTART property.
* app/widgets/gimptoolbox-color-area.c: don't add the tooltip here...
* app/widgets/gimptoolbox.c: ...but here (as for all other
indicators). Also escape '&' properly because we now use markup.
* app/tools/gimpselectionoptions.c
* app/widgets/gimpeditor.c
* app/widgets/gimpwidgets-utils.c: print modifiers and
shortcuts in bold instead of in ().
* app/widgets/gimpcontainertreeview.c: show tooltips on rows if
gimp_viewable_get_description() returns a tip.
* app/dialogs/preferences-dialog.c
* plug-ins/jpeg/jpeg-save.c
* plug-ins/MapObject/mapobject_ui.c
* plug-ins/Lighting/lighting_ui.c
* plug-ins/common/animationplay.c
* plug-ins/common/warp.c: no need to add event boxes just to have
tooltips, the new ones work on all widgets.
2007-11-08 Sven Neumann <sven@gimp.org>
* app/display/gimpstatusbar.c (gimp_statusbar_vprintf): also cut

View File

@ -150,7 +150,8 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_TOOLTIPS,
"show-tooltips", SHOW_TOOLTIPS_BLURB,
TRUE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TEAROFF_MENUS,
"tearoff-menus", TEAROFF_MENUS_BLURB,
TRUE,

View File

@ -1023,19 +1023,10 @@ prefs_profile_combo_add_tooltip (GtkWidget *combo,
blurb = g_param_spec_get_blurb (param_spec);
/* can't set a tooltip on a combo_box */
if (blurb)
{
GtkWidget *ebox = gtk_event_box_new ();
gimp_help_set_help_data (ebox,
dgettext (GETTEXT_PACKAGE "-libgimp", blurb),
NULL);
gtk_container_add (GTK_CONTAINER (ebox), combo);
gtk_widget_show (combo);
return ebox;
}
gimp_help_set_help_data (combo,
dgettext (GETTEXT_PACKAGE "-libgimp", blurb),
NULL);
return combo;
}

View File

@ -18,11 +18,6 @@
#include "config.h"
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED (GtkTooltips)
#endif
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"
@ -312,16 +307,18 @@ gimp_selection_options_gui (GimpToolOptions *tool_options)
/* add modifier keys to the tooltips */
for (list = children, i = 0; list; list = list->next, i++)
{
GtkWidget *button = list->data;
GtkTooltipsData *data = gtk_tooltips_data_get (button);
const gchar *modifier = gimp_selection_options_get_modifier (i);
GtkWidget *button = list->data;
const gchar *modifier = gimp_selection_options_get_modifier (i);
gchar *tooltip;
if (! modifier)
continue;
if (data && data->tip_text)
tooltip = gtk_widget_get_tooltip_text (button);
if (tooltip)
{
gchar *tip = g_strdup_printf ("%s (%s)", data->tip_text, modifier);
gchar *tip = g_strdup_printf ("%s <b>%s</b>", tooltip, modifier);
gimp_help_set_help_data (button, tip, NULL);
g_free (tip);

View File

@ -91,6 +91,12 @@ static void gimp_container_tree_view_selection_changed (GtkTreeSelection *s
static gboolean gimp_container_tree_view_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpContainerTreeView *tree_view);
static gboolean gimp_container_tree_view_tooltip (GtkWidget *widget,
gint x,
gint y,
gboolean keyboard_tip,
GtkTooltip *tooltip,
GimpContainerTreeView *tree_view);
static void gimp_container_tree_view_renderer_update (GimpViewRenderer *renderer,
GimpContainerTreeView *tree_view);
@ -196,6 +202,7 @@ gimp_container_tree_view_constructor (GType type,
"search-column", COLUMN_NAME,
"enable-search", FALSE,
"headers-visible", FALSE,
"has-tooltip", TRUE,
NULL);
g_object_unref (list);
@ -256,6 +263,10 @@ gimp_container_tree_view_constructor (GType type,
G_CALLBACK (gimp_container_tree_view_drag_data_received),
tree_view);
g_signal_connect (tree_view->view, "query-tooltip",
G_CALLBACK (gimp_container_tree_view_tooltip),
tree_view);
return object;
}
@ -1024,6 +1035,54 @@ gimp_container_tree_view_button_press (GtkWidget *widget,
return TRUE;
}
static gboolean
gimp_container_tree_view_tooltip (GtkWidget *widget,
gint x,
gint y,
gboolean keyboard_tip,
GtkTooltip *tooltip,
GimpContainerTreeView *tree_view)
{
GimpViewRenderer *renderer;
GtkTreeIter iter;
GtkTreePath *path;
gboolean show_tip = FALSE;
if (! gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (widget), &x, &y,
keyboard_tip,
NULL, &path, &iter))
return FALSE;
gtk_tree_model_get (tree_view->model, &iter,
COLUMN_RENDERER, &renderer,
-1);
if (renderer)
{
gchar *desc;
gchar *tip;
desc = gimp_viewable_get_description (renderer->viewable, &tip);
if (tip)
{
gtk_tooltip_set_text (tooltip, tip);
gtk_tree_view_set_tooltip_row (GTK_TREE_VIEW (widget), tooltip, path);
show_tip = TRUE;
g_free (tip);
}
g_free (desc);
g_object_unref (renderer);
}
gtk_tree_path_free (path);
return show_tip;
}
static void
gimp_container_tree_view_renderer_update (GimpViewRenderer *renderer,
GimpContainerTreeView *tree_view)

View File

@ -672,9 +672,9 @@ gimp_editor_add_action_button (GimpEditor *editor,
if (ext_tooltip)
{
gchar *tmp = g_strconcat (tooltip, "\n(",
gchar *tmp = g_strconcat (tooltip, "\n<b>",
gimp_get_mod_string (mod_mask),
") ", ext_tooltip, NULL);
"</b> ", ext_tooltip, NULL);
g_free (ext_tooltip);
g_free (tooltip);

View File

@ -76,6 +76,12 @@ gimp_toolbox_color_area_create (GimpToolbox *toolbox,
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
gimp_help_set_help_data
(color_area, _("Foreground &amp; background colors.\n"
"The black and white squares reset colors.\n"
"The arrows swap colors.\n"
"Click to open the color selection dialog."), NULL);
g_signal_connect (color_area, "color-clicked",
G_CALLBACK (color_area_color_clicked),
context);

View File

@ -685,11 +685,6 @@ toolbox_create_color_area (GimpToolbox *toolbox,
gtk_container_add (GTK_CONTAINER (alignment), col_area);
gtk_widget_show (col_area);
gimp_help_set_help_data
(col_area, _("Foreground & background colors. The black and white "
"squares reset colors. The arrows swap colors. Click "
"to open the color selection dialog."), NULL);
return alignment;
}

View File

@ -999,7 +999,7 @@ gimp_widget_accel_changed (GtkAccelGroup *accel_group,
gchar *accel = gtk_accelerator_get_label (accel_key->accel_key,
accel_key->accel_mods);
tooltip = g_strdup_printf ("%s (%s)", orig_tooltip, accel);
tooltip = g_strdup_printf ("%s <b>%s</b>", orig_tooltip, accel);
g_free (accel);
}
else

View File

@ -22,11 +22,6 @@
#include "config.h"
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED (GtkTooltips)
#endif
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
@ -43,6 +38,12 @@ typedef enum
} GimpWidgetHelpType;
/* local variables */
static gboolean tooltips_enabled = TRUE;
static gboolean tooltips_enable_called = FALSE;
/* local function prototypes */
static const gchar * gimp_help_get_help_data (GtkWidget *widget,
@ -62,38 +63,8 @@ static gboolean gimp_context_help_key_press (GtkWidget *widget,
static gboolean gimp_context_help_idle_show_help (gpointer data);
/* local variables */
static GtkTooltips *tool_tips = NULL;
/* public functions */
/**
* _gimp_help_init:
*
* This function initializes GIMP's help system.
*
* Currently it only creates a #GtkTooltips object with gtk_tooltips_new()
* which will be used by gimp_help_set_help_data().
*
* Nota that this function is called automatically by gimp_widgets_init().
**/
void
_gimp_help_init (void)
{
if (tool_tips)
{
g_warning ("_gimp_help_init() must only be called once!");
return;
}
tool_tips = gtk_tooltips_new ();
/* take ownership of the tooltips */
g_object_ref_sink (tool_tips);
}
/**
* gimp_help_enable_tooltips:
*
@ -102,7 +73,11 @@ _gimp_help_init (void)
void
gimp_help_enable_tooltips (void)
{
gtk_tooltips_enable (tool_tips);
if (! tooltips_enable_called)
{
tooltips_enable_called = TRUE;
tooltips_enabled = TRUE;
}
}
/**
@ -113,7 +88,11 @@ gimp_help_enable_tooltips (void)
void
gimp_help_disable_tooltips (void)
{
gtk_tooltips_disable (tool_tips);
if (! tooltips_enable_called)
{
tooltips_enable_called = TRUE;
tooltips_enabled = FALSE;
}
}
/**
@ -214,10 +193,10 @@ gimp_help_set_help_data (GtkWidget *widget,
{
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_id);
if (tooltips_enabled)
gtk_widget_set_tooltip_markup (widget, tooltip);
if (! tooltip)
g_object_set_qdata (G_OBJECT (widget), GIMP_HELP_ID, (gpointer) help_id);
g_object_set_qdata (G_OBJECT (widget), GIMP_HELP_ID, (gpointer) help_id);
}
/**
@ -272,19 +251,12 @@ gimp_help_get_help_data (GtkWidget *widget,
GtkWidget **help_widget,
gpointer *ret_data)
{
GtkTooltipsData *tooltips_data;
gchar *help_id = NULL;
gpointer help_data = NULL;
gchar *help_id = NULL;
gpointer help_data = NULL;
for (; widget; widget = widget->parent)
{
tooltips_data = gtk_tooltips_data_get (widget);
if (tooltips_data && tooltips_data->tip_private)
help_id = tooltips_data->tip_private;
else
help_id = g_object_get_qdata (G_OBJECT (widget), GIMP_HELP_ID);
help_id = g_object_get_qdata (G_OBJECT (widget), GIMP_HELP_ID);
help_data = g_object_get_data (G_OBJECT (widget), "gimp-help-data");
if (help_id)
@ -318,17 +290,10 @@ gimp_help_callback (GtkWidget *widget,
case GIMP_WIDGET_HELP_TYPE_HELP:
if (help_func)
{
GtkTooltipsData *tooltips_data;
gchar *help_id = NULL;
gpointer help_data = NULL;
tooltips_data = gtk_tooltips_data_get (widget);
if (tooltips_data && tooltips_data->tip_private)
help_id = tooltips_data->tip_private;
else
help_id = g_object_get_qdata (G_OBJECT (widget), GIMP_HELP_ID);
gchar *help_id = NULL;
gpointer help_data = NULL;
help_id = g_object_get_qdata (G_OBJECT (widget), GIMP_HELP_ID);
help_data = g_object_get_data (G_OBJECT (widget), "gimp-help-data");
(* help_func) (help_id, help_data);

View File

@ -53,11 +53,7 @@ void gimp_context_help (GtkWidget *widget);
#define GIMP_HELP_ID (gimp_help_id_quark ())
GQuark gimp_help_id_quark (void) G_GNUC_CONST;
/* only for private use in libgimpwidgets */
G_GNUC_INTERNAL void _gimp_help_init (void);
GQuark gimp_help_id_quark (void) G_GNUC_CONST;
G_END_DECLS

View File

@ -28,7 +28,6 @@
#include "gimpwidgetstypes.h"
#include "gimphelpui.h"
#include "gimpstock.h"
#include "gimpwidgets-private.h"
@ -84,7 +83,5 @@ gimp_widgets_init (GimpHelpFunc standard_help_func,
g_list_foreach (icon_list, (GFunc) g_object_unref, NULL);
g_list_free (icon_list);
_gimp_help_init ();
gimp_widgets_initialized = TRUE;
}

View File

@ -366,7 +366,6 @@ create_light_page (void)
GtkWidget *page;
GtkWidget *frame;
GtkWidget *table;
GtkWidget *ebox;
GtkWidget *button;
GtkObject *adj;
GtkWidget *label;
@ -420,29 +419,30 @@ create_light_page (void)
NULL);
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (light_type_combo),
mapvals.lightsource[k].type);
gtk_table_attach_defaults (GTK_TABLE (table), light_type_combo,
1, 2, 1, 2);
gtk_widget_show (light_type_combo);
g_signal_connect (light_type_combo, "changed",
G_CALLBACK (apply_settings),
NULL);
ebox = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (ebox), light_type_combo);
gtk_widget_show (ebox);
gtk_table_attach_defaults (GTK_TABLE (table),
ebox, 1, 2, 1, 2);
gtk_widget_show (light_type_combo);
gimp_help_set_help_data (ebox, _("Type of light source to apply"), NULL);
gimp_help_set_help_data (light_type_combo,
_("Type of light source to apply"), NULL);
colorbutton = gimp_color_button_new (_("Select lightsource color"),
64, 16,
&mapvals.lightsource[k].color,
GIMP_COLOR_AREA_FLAT);
gimp_color_button_set_update (GIMP_COLOR_BUTTON (colorbutton), TRUE);
g_signal_connect (colorbutton, "color-changed",
G_CALLBACK (apply_settings),
NULL);
gtk_widget_show (colorbutton);
gtk_table_attach_defaults (GTK_TABLE (table),
colorbutton, 1, 2, 2, 3);
g_signal_connect (colorbutton, "color-changed",
G_CALLBACK (apply_settings),
NULL);
gimp_help_set_help_data (colorbutton,
_("Set light source color"), NULL);
@ -454,9 +454,11 @@ create_light_page (void)
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("_Intensity:"), 0.0, 0.5,
spin_intensity, 1, TRUE);
g_signal_connect (adj, "value-changed",
G_CALLBACK (apply_settings),
NULL);
gimp_help_set_help_data (spin_intensity,
_("Light intensity"), NULL);
@ -473,9 +475,11 @@ create_light_page (void)
gimp_table_attach_aligned (GTK_TABLE (table), 2, 1,
_("_X:"), 0.0, 0.5,
spin_pos_x, 1, TRUE);
g_signal_connect (adj, "value-changed",
G_CALLBACK (apply_settings),
NULL);
gimp_help_set_help_data (spin_pos_x,
_("Light source X position in XYZ space"), NULL);
@ -486,9 +490,11 @@ create_light_page (void)
gimp_table_attach_aligned (GTK_TABLE (table), 2, 2,
_("_Y:"), 0.0, 0.5,
spin_pos_y, 1, TRUE);
g_signal_connect (adj, "value-changed",
G_CALLBACK (apply_settings),
NULL);
gimp_help_set_help_data (spin_pos_y,
_("Light source Y position in XYZ space"), NULL);
@ -499,9 +505,11 @@ create_light_page (void)
gimp_table_attach_aligned (GTK_TABLE (table), 2, 3,
_("_Z:"), 0.0, 0.5,
spin_pos_z, 1, TRUE);
g_signal_connect (adj, "value-changed",
G_CALLBACK (apply_settings),
NULL);
gimp_help_set_help_data (spin_pos_z,
_("Light source Z position in XYZ space"), NULL);
@ -517,9 +525,11 @@ create_light_page (void)
gimp_table_attach_aligned (GTK_TABLE (table), 4, 1,
_("X:"), 0.0, 0.5,
spin_dir_x, 1, TRUE);
g_signal_connect (adj, "value-changed",
G_CALLBACK (apply_settings),
NULL);
gimp_help_set_help_data (spin_dir_x,
_("Light source X direction in XYZ space"), NULL);
@ -529,9 +539,11 @@ create_light_page (void)
gimp_table_attach_aligned (GTK_TABLE (table), 4, 2,
_("Y:"), 0.0, 0.5,
spin_dir_y, 1, TRUE);
g_signal_connect (adj, "value-changed",
G_CALLBACK (apply_settings),
NULL);
gimp_help_set_help_data (spin_dir_y,
_("Light source Y direction in XYZ space"), NULL);
@ -541,9 +553,11 @@ create_light_page (void)
gimp_table_attach_aligned (GTK_TABLE (table), 4, 3,
_("Z:"), 0.0, 0.5,
spin_dir_z, 1, TRUE);
g_signal_connect (adj, "value-changed",
G_CALLBACK (apply_settings),
NULL);
gimp_help_set_help_data (spin_dir_z,
_("Light source Z direction in XYZ space"),
NULL);
@ -624,21 +638,25 @@ create_material_page (void)
_("_Glowing:"), 0.0, 0.5,
image, 1, FALSE);
gtk_size_group_add_widget (group, label);
spinbutton = gimp_spin_button_new (&adj, mapvals.material.ambient_int,
0, G_MAXFLOAT, 0.01, 0.1, 1.0, 0.0, 2);
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (spinbutton);
g_signal_connect (adj, "value-changed",
G_CALLBACK (gimp_double_adjustment_update),
&mapvals.material.ambient_int);
g_signal_connect (adj, "value-changed",
G_CALLBACK (interactive_preview_callback),
NULL);
gtk_widget_show (spinbutton);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
gimp_help_set_help_data (spinbutton,
_("Amount of original color to show where no "
"direct light falls"), NULL);
image = gtk_image_new_from_stock (STOCK_INTENSITY_AMBIENT_HIGH,
GTK_ICON_SIZE_BUTTON);
gtk_table_attach (GTK_TABLE (table), image, 3, 4, 0, 1,
@ -653,21 +671,25 @@ create_material_page (void)
_("_Bright:"), 0.0, 0.5,
image, 1, FALSE);
gtk_size_group_add_widget (group, label);
spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_int,
0, G_MAXFLOAT, 0.01, 0.1, 1.0, 0.0, 2);
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (spinbutton);
g_signal_connect (adj, "value-changed",
G_CALLBACK (gimp_double_adjustment_update),
&mapvals.material.diffuse_int);
g_signal_connect (adj, "value-changed",
G_CALLBACK (interactive_preview_callback),
NULL);
gtk_widget_show (spinbutton);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
gimp_help_set_help_data (spinbutton,
_("Intensity of original color when lit by a light "
"source"), NULL);
image = gtk_image_new_from_stock (STOCK_INTENSITY_DIFFUSE_HIGH,
GTK_ICON_SIZE_BUTTON);
gtk_table_attach (GTK_TABLE (table), image, 3, 4, 1, 2,
@ -682,21 +704,25 @@ create_material_page (void)
_("_Shiny:"), 0.0, 0.5,
image, 1, FALSE);
gtk_size_group_add_widget (group, label);
spinbutton = gimp_spin_button_new (&adj, mapvals.material.specular_ref,
0, G_MAXFLOAT, 0.01, 0.1, 1.0, 0.0, 2);
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 2, 3,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (spinbutton);
g_signal_connect (adj, "value-changed",
G_CALLBACK (gimp_double_adjustment_update),
&mapvals.material.specular_ref);
g_signal_connect (adj, "value-changed",
G_CALLBACK (interactive_preview_callback),
NULL);
gtk_widget_show (spinbutton);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
gimp_help_set_help_data (spinbutton,
_("Controls how intense the highlights will be"),
NULL);
image = gtk_image_new_from_stock (STOCK_REFLECTIVITY_SPECULAR_HIGH,
GTK_ICON_SIZE_BUTTON);
gtk_table_attach (GTK_TABLE (table), image, 3, 4, 2, 3,
@ -710,21 +736,25 @@ create_material_page (void)
_("_Polished:"), 0.0, 0.5,
image, 1, FALSE);
gtk_size_group_add_widget (group, label);
spinbutton = gimp_spin_button_new (&adj, mapvals.material.highlight,
0, G_MAXFLOAT, 0.01, 0.1, 1.0, 0.0, 2);
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 3, 4,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (spinbutton);
g_signal_connect (adj, "value-changed",
G_CALLBACK (gimp_double_adjustment_update),
&mapvals.material.highlight);
g_signal_connect (adj, "value-changed",
G_CALLBACK (interactive_preview_callback),
NULL);
gtk_widget_show (spinbutton);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
gimp_help_set_help_data (spinbutton,
_("Higher values makes the highlights more focused"),
NULL);
image = gtk_image_new_from_stock (STOCK_REFLECTIVITY_HIGHLIGHT_HIGH,
GTK_ICON_SIZE_BUTTON);
gtk_table_attach (GTK_TABLE (table), image, 3, 4, 3, 4,
@ -735,13 +765,14 @@ create_material_page (void)
button = gtk_check_button_new_with_mnemonic (_("_Metallic"));
gtk_table_attach (GTK_TABLE (table), button, 0, 3, 4, 5,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (button);
g_signal_connect (button, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&mapvals.material.metallic);
g_signal_connect (button, "toggled",
G_CALLBACK (interactive_preview_callback),
NULL);
gtk_widget_show (button);
gtk_widget_show (page);
@ -847,7 +878,6 @@ create_environment_page (void)
GtkWidget *table;
GtkWidget *frame;
GtkWidget *combo;
GtkWidget *ebox;
page = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@ -886,15 +916,11 @@ create_environment_page (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), mapvals.envmap_id,
G_CALLBACK (envmap_combo_callback),
NULL);
ebox = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (ebox), combo);
gtk_widget_show (combo);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("En_vironment image:"), 0.0, 0.5,
ebox, 1, FALSE);
gimp_help_set_help_data (ebox, _("Environment image to use"), NULL);
combo, 1, FALSE);
gimp_help_set_help_data (combo, _("Environment image to use"), NULL);
gtk_widget_show (page);

View File

@ -459,7 +459,6 @@ create_options_page (void)
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *combo;
GtkWidget *ebox;
GtkWidget *toggle;
GtkWidget *table;
GtkWidget *spinbutton;
@ -492,19 +491,14 @@ create_options_page (void)
_("Cylinder"), MAP_CYLINDER,
NULL);
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), mapvals.maptype);
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
gtk_widget_show (combo);
g_signal_connect (combo, "changed",
G_CALLBACK (mapmenu_callback),
&mapvals.maptype);
ebox = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (ebox), combo);
gtk_widget_show (combo);
gtk_box_pack_start (GTK_BOX (hbox), ebox, TRUE, TRUE, 0);
gtk_widget_show (ebox);
gimp_help_set_help_data (ebox, _("Type of object to map to"), NULL);
gimp_help_set_help_data (combo, _("Type of object to map to"), NULL);
toggle = gtk_check_button_new_with_label (_("Transparent background"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
@ -558,14 +552,14 @@ create_options_page (void)
gtk_frame_set_label_widget (GTK_FRAME (frame), toggle);
gtk_widget_show (toggle);
gimp_help_set_help_data (toggle,
_("Enable/disable jagged edges removal "
"(antialiasing)"), NULL);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&mapvals.antialiasing);
gimp_help_set_help_data (toggle,
_("Enable/disable jagged edges removal "
"(antialiasing)"), NULL);
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
@ -615,7 +609,6 @@ create_light_page (void)
GtkWidget *frame;
GtkWidget *table;
GtkWidget *combo;
GtkWidget *ebox;
GtkWidget *colorbutton;
GtkWidget *spinbutton;
GtkObject *adj;
@ -638,20 +631,15 @@ create_light_page (void)
NULL);
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo),
mapvals.lightsource.type);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Lightsource type:"), 0.0, 0.5,
combo, 1, FALSE);
g_signal_connect (combo, "changed",
G_CALLBACK (lightmenu_callback),
&mapvals.lightsource.type);
ebox = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (ebox), combo);
gtk_widget_show (combo);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Lightsource type:"), 0.0, 0.5,
ebox, 1, FALSE);
gimp_help_set_help_data (ebox, _("Type of light source to apply"), NULL);
gimp_help_set_help_data (combo, _("Type of light source to apply"), NULL);
colorbutton = gimp_color_button_new (_("Select lightsource color"),
64, 16,

View File

@ -569,7 +569,6 @@ build_dialog (GimpImageBaseType basetype,
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *abox;
GtkWidget *ebox;
GtkToolItem *item;
GtkAction *action;
GdkCursor *cursor;
@ -638,12 +637,8 @@ build_dialog (GimpImageBaseType basetype,
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
ebox = gtk_event_box_new ();
gtk_box_pack_start (GTK_BOX (hbox), ebox, FALSE, FALSE, 0);
gtk_widget_show (ebox);
speedcombo = gtk_combo_box_new_text ();
gtk_container_add (GTK_CONTAINER (ebox), speedcombo);
gtk_box_pack_start (GTK_BOX (hbox), speedcombo, FALSE, FALSE, 0);
gtk_widget_show (speedcombo);
for (index = 0; index < 7; index++)
@ -661,7 +656,7 @@ build_dialog (GimpImageBaseType basetype,
G_CALLBACK (speedcombo_changed),
NULL);
gimp_help_set_help_data (ebox, _("Playback speed"), NULL);
gimp_help_set_help_data (speedcombo, _("Playback speed"), NULL);
progress = gtk_progress_bar_new ();
gtk_box_pack_start (GTK_BOX (hbox), progress, TRUE, TRUE, 0);

View File

@ -366,7 +366,6 @@ warp_dialog (GimpDrawable *drawable)
GtkWidget *spinbutton;
GtkObject *adj;
GtkWidget *combo;
GtkWidget *ebox;
GtkSizeGroup *label_group;
GtkSizeGroup *spin_group;
GSList *group = NULL;
@ -648,19 +647,15 @@ warp_dialog (GimpDrawable *drawable)
/* --------- Gradient map menu ---------------- */
combo = gimp_drawable_combo_box_new (warp_map_constrain, drawable);
gtk_table_attach (GTK_TABLE (table), combo, 2, 3, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (combo);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dvals.grad_map,
G_CALLBACK (gimp_int_combo_box_get_active),
&dvals.grad_map);
ebox = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (ebox), combo);
gtk_widget_show (combo);
gtk_table_attach (GTK_TABLE (table), ebox, 2, 3, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (ebox);
gimp_help_set_help_data (ebox, _("Gradient map selection menu"), NULL);
gimp_help_set_help_data (combo, _("Gradient map selection menu"), NULL);
/* ---------------------------------------------- */
@ -695,19 +690,15 @@ warp_dialog (GimpDrawable *drawable)
/* --------- Vector map menu ---------------- */
combo = gimp_drawable_combo_box_new (warp_map_constrain, drawable);
gtk_table_attach (GTK_TABLE (table), combo, 2, 3, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (combo);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dvals.vector_map,
G_CALLBACK (gimp_int_combo_box_get_active),
&dvals.vector_map);
ebox = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (ebox), combo);
gtk_widget_show (combo);
gtk_table_attach (GTK_TABLE (table), ebox, 2, 3, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (ebox);
gimp_help_set_help_data (ebox,
gimp_help_set_help_data (combo,
_("Fixed-direction-vector map selection menu"),
NULL);

View File

@ -805,7 +805,6 @@ save_dialog (void)
GtkWidget *frame;
GtkWidget *toggle;
GtkWidget *spinbutton;
GtkWidget *ebox;
GtkWidget *label;
GtkWidget *combo;
GtkWidget *text_view;
@ -866,21 +865,17 @@ save_dialog (void)
G_CALLBACK (make_preview),
NULL);
ebox = gtk_event_box_new ();
gtk_box_pack_start (GTK_BOX (vbox), ebox, FALSE, FALSE, 0);
gtk_widget_show (ebox);
gimp_help_set_help_data (ebox,
_("Enable preview to obtain the file size."), NULL);
preview_size = gtk_label_new (_("File size: unknown"));
gtk_misc_set_alignment (GTK_MISC (preview_size), 0.0, 0.5);
gimp_label_set_attributes (GTK_LABEL (preview_size),
PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
-1);
gtk_container_add (GTK_CONTAINER (ebox), preview_size);
gtk_box_pack_start (GTK_BOX (vbox), preview_size, FALSE, FALSE, 0);
gtk_widget_show (preview_size);
gimp_help_set_help_data (preview_size,
_("Enable preview to obtain the file size."), NULL);
pg.preview = toggle =
gtk_check_button_new_with_mnemonic (_("Show _preview in image window"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), jsvals.preview);