From: joncruz Date: Wed, 21 Mar 2007 23:51:04 +0000 (+0000) Subject: Added tootips for toolbar spinbuttons X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=75d40495d9a6b8f2d5a4830368618ddbb6ae8ab7;p=inkscape.git Added tootips for toolbar spinbuttons --- diff --git a/src/ege-adjustment-action.cpp b/src/ege-adjustment-action.cpp index fe26cd87e..abe021cf7 100644 --- a/src/ege-adjustment-action.cpp +++ b/src/ege-adjustment-action.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include "ege-adjustment-action.h" @@ -90,6 +91,7 @@ struct _EgeAdjustmentDescr struct _EgeAdjustmentActionPrivate { GtkAdjustment* adj; + GtkTooltips* toolTips; GtkWidget* focusWidget; gdouble climbRate; guint digits; @@ -222,6 +224,7 @@ static void ege_adjustment_action_init( EgeAdjustmentAction* action ) { action->private_data = EGE_ADJUSTMENT_ACTION_GET_PRIVATE( action ); action->private_data->adj = 0; + action->private_data->toolTips = 0; action->private_data->focusWidget = 0; action->private_data->climbRate = 0.0; action->private_data->digits = 2; @@ -714,6 +717,20 @@ static GtkWidget* create_tool_item( GtkAction* action ) const gchar* sss = g_value_get_string( &value ); GtkWidget* lbl = gtk_label_new( sss ? sss : "wwww" ); + { + GValue tooltip; + memset( &tooltip, 0, sizeof(tooltip) ); + g_value_init( &tooltip, G_TYPE_STRING ); + g_object_get_property( G_OBJECT(action), "tooltip", &tooltip ); + const gchar* tipstr = g_value_get_string( &tooltip ); + if ( tipstr && *tipstr ) { + if ( !action->private_data->toolTips ) { + action->private_data->toolTips = gtk_tooltips_new(); + } + gtk_tooltips_set_tip( action->private_data->toolTips, spinbutton, tipstr, 0 ); + } + } + gtk_misc_set_alignment( GTK_MISC(lbl), 1.0, 0.5 ); gtk_box_pack_start( GTK_BOX(hb), lbl, FALSE, FALSE, 0 );