use gtk_widget_set_tooltip_text() from gimp_help_set_help() and added

2007-11-22  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimphelpui.[ch]: use
	gtk_widget_set_tooltip_text() from gimp_help_set_help() and added
	gimp_help_set_help_data_with_markup() for the cases where markup
	is needed.

	* libgimpwidgets/gimpwidgets.def: updated.

	* app/tools/gimpselectionoptions.c
	* app/widgets/gimpeditor.c
	* app/widgets/gimpwidgets-utils.c: use the new function where markup
	in tooltips is being used.

	* app/widgets/gimptoolbox-color-area.c: no need to escape the
	ampersand any longer.

svn path=/trunk/; revision=24217
This commit is contained in:
Sven Neumann 2007-11-22 13:59:06 +00:00 committed by Sven Neumann
parent 0f08574bf7
commit dc5d601675
11 changed files with 83 additions and 19 deletions

View File

@ -1,3 +1,20 @@
2007-11-22 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimphelpui.[ch]: use
gtk_widget_set_tooltip_text() from gimp_help_set_help() and added
gimp_help_set_help_data_with_markup() for the cases where markup
is needed.
* libgimpwidgets/gimpwidgets.def: updated.
* app/tools/gimpselectionoptions.c
* app/widgets/gimpeditor.c
* app/widgets/gimpwidgets-utils.c: use the new function where markup
in tooltips is being used.
* app/widgets/gimptoolbox-color-area.c: no need to escape the
ampersand any longer.
2007-11-22 Jakub Steiner <jimmac@ximian.com>
* data/images/gimp-splash.png: New unstable splash

View File

@ -320,7 +320,7 @@ gimp_selection_options_gui (GimpToolOptions *tool_options)
{
gchar *tip = g_strdup_printf ("%s <b>%s</b>", tooltip, modifier);
gimp_help_set_help_data (button, tip, NULL);
gimp_help_set_help_data_with_markup (button, tip, NULL);
g_free (tip);
g_free (tooltip);

View File

@ -701,7 +701,7 @@ gimp_editor_add_action_button (GimpEditor *editor,
help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID);
if (tooltip || help_id)
gimp_help_set_help_data (button, tooltip, help_id);
gimp_help_set_help_data_with_markup (button, tooltip, help_id);
g_free (tooltip);

View File

@ -77,7 +77,7 @@ gimp_toolbox_color_area_create (GimpToolbox *toolbox,
GDK_LEAVE_NOTIFY_MASK);
gimp_help_set_help_data
(color_area, _("Foreground &amp; background colors.\n"
(color_area, _("Foreground & background colors.\n"
"The black and white squares reset colors.\n"
"The arrows swap colors.\n"
"Click to open the color selection dialog."), NULL);

View File

@ -1007,7 +1007,7 @@ gimp_widget_accel_changed (GtkAccelGroup *accel_group,
tooltip = g_strdup (orig_tooltip);
}
gimp_help_set_help_data (widget, tooltip, help_id);
gimp_help_set_help_data_with_markup (widget, tooltip, help_id);
g_free (tooltip);
g_free (orig_tooltip);
@ -1018,9 +1018,7 @@ void
gimp_widget_set_accel_help (GtkWidget *widget,
GtkAction *action)
{
GClosure *accel_closure = NULL;
accel_closure = gtk_action_get_accel_closure (action);
GClosure *accel_closure = gtk_action_get_accel_closure (action);
if (accel_closure)
{

View File

@ -1,3 +1,10 @@
2007-11-22 Sven Neumann <sven@gimp.org>
* libgimpwidgets/libgimpwidgets-sections.txt: added
gimp_help_set_help_data_with_markup.
* devel-docs/libgimpwidgets/tmpl/gimphelpui.sgml: regenerated.
2007-11-19 Sven Neumann <sven@gimp.org>
* libgimp/libgimp-docs.sgml: added "Index of new symbols in GIMP 2.6".

View File

@ -623,6 +623,7 @@ gimp_help_disable_tooltips
gimp_standard_help_func
gimp_help_connect
gimp_help_set_help_data
gimp_help_set_help_data_with_markup
gimp_context_help
<SUBSECTION Standard>
gimp_help_id_quark

View File

@ -97,6 +97,16 @@ Since: GIMP 2.2
@help_id:
<!-- ##### FUNCTION gimp_help_set_help_data_with_markup ##### -->
<para>
</para>
@widget:
@tooltip:
@help_id:
<!-- ##### FUNCTION gimp_context_help ##### -->
<para>

View File

@ -193,6 +193,31 @@ gimp_help_set_help_data (GtkWidget *widget,
{
g_return_if_fail (GTK_IS_WIDGET (widget));
if (tooltips_enabled)
gtk_widget_set_tooltip_text (widget, tooltip);
g_object_set_qdata (G_OBJECT (widget), GIMP_HELP_ID, (gpointer) help_id);
}
/**
* gimp_help_set_help_data_with_markup:
* @widget: The #GtkWidget you want to set a @tooltip and/or @help_id for.
* @tooltip: The markup for this widget's tooltip (or %NULL).
* @help_id: The @help_id for the #GtkTipsQuery tooltips inspector.
*
* Just like gimp_help_set_help_data(), but it allows to pass text which
* is marked up with
* <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* Since: GIMP 2.6
**/
void
gimp_help_set_help_data_with_markup (GtkWidget *widget,
const gchar *tooltip,
const gchar *help_id)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
if (tooltips_enabled)
gtk_widget_set_tooltip_markup (widget, tooltip);

View File

@ -28,27 +28,32 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
void gimp_help_enable_tooltips (void);
void gimp_help_disable_tooltips (void);
void gimp_help_enable_tooltips (void);
void gimp_help_disable_tooltips (void);
/* the standard gimp help function
*/
void gimp_standard_help_func (const gchar *help_id,
gpointer help_data);
void gimp_standard_help_func (const gchar *help_id,
gpointer help_data);
/* connect the help callback of a window */
void gimp_help_connect (GtkWidget *widget,
GimpHelpFunc help_func,
const gchar *help_id,
gpointer help_data);
void gimp_help_connect (GtkWidget *widget,
GimpHelpFunc help_func,
const gchar *help_id,
gpointer help_data);
/* set help data for non-window widgets */
void gimp_help_set_help_data (GtkWidget *widget,
const gchar *tooltip,
const gchar *help_id);
void gimp_help_set_help_data (GtkWidget *widget,
const gchar *tooltip,
const gchar *help_id);
/* set help data with markup for non-window widgets */
void gimp_help_set_help_data_with_markup (GtkWidget *widget,
const gchar *tooltip,
const gchar *help_id);
/* activate the context help inspector */
void gimp_context_help (GtkWidget *widget);
void gimp_context_help (GtkWidget *widget);
#define GIMP_HELP_ID (gimp_help_id_quark ())

View File

@ -149,6 +149,7 @@ EXPORTS
gimp_help_enable_tooltips
gimp_help_id_quark
gimp_help_set_help_data
gimp_help_set_help_data_with_markup
gimp_hint_box_get_type
gimp_hint_box_new
gimp_int_adjustment_update