diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2011-06-05 13:22:18 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2011-06-05 13:22:18 +0000 |
| commit | f2510631aadaae48e040a1dd0f9bc8b4de6f2054 (patch) | |
| tree | fe65c502ae9e1b5d20187273c5baa67062ca20fd /src/widgets | |
| parent | Possible Win32 compile fix. (diff) | |
| download | inkscape-f2510631aadaae48e040a1dd0f9bc8b4de6f2054.tar.gz inkscape-f2510631aadaae48e040a1dd0f9bc8b4de6f2054.zip | |
Replace use of deprecated GtkTooltips API
Fixed bugs:
- https://launchpad.net/bugs/793086
(bzr r10256.1.1)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/button.cpp | 34 | ||||
| -rw-r--r-- | src/widgets/button.h | 6 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 21 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.h | 2 | ||||
| -rw-r--r-- | src/widgets/gradient-selector.cpp | 5 | ||||
| -rw-r--r-- | src/widgets/gradient-toolbar.cpp | 18 | ||||
| -rw-r--r-- | src/widgets/gradient-vector.cpp | 5 | ||||
| -rw-r--r-- | src/widgets/paint-selector.cpp | 26 | ||||
| -rw-r--r-- | src/widgets/sp-color-icc-selector.cpp | 23 | ||||
| -rw-r--r-- | src/widgets/sp-color-icc-selector.h | 2 | ||||
| -rw-r--r-- | src/widgets/sp-color-notebook.cpp | 13 | ||||
| -rw-r--r-- | src/widgets/sp-color-scales.cpp | 54 | ||||
| -rw-r--r-- | src/widgets/sp-color-scales.h | 2 | ||||
| -rw-r--r-- | src/widgets/sp-color-wheel-selector.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/sp-color-wheel-selector.h | 2 | ||||
| -rw-r--r-- | src/widgets/spw-utilities.cpp | 4 | ||||
| -rw-r--r-- | src/widgets/toolbox.cpp | 24 |
17 files changed, 95 insertions, 152 deletions
diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp index dc830d096..9676651d3 100644 --- a/src/widgets/button.cpp +++ b/src/widgets/button.cpp @@ -46,7 +46,7 @@ static void sp_button_set_doubleclick_action (SPButton *button, SPAction *action static void sp_button_action_set_active (SPAction *action, unsigned int active, void *data); static void sp_button_action_set_sensitive (SPAction *action, unsigned int sensitive, void *data); static void sp_button_action_set_shortcut (SPAction *action, unsigned int shortcut, void *data); -static void sp_button_set_composed_tooltip (GtkTooltips *tooltips, GtkWidget *widget, SPAction *action); +static void sp_button_set_composed_tooltip (GtkWidget *widget, SPAction *action); static GtkToggleButtonClass *parent_class; SPActionEventVector button_event_vector = { @@ -98,7 +98,6 @@ sp_button_init (SPButton *button) { button->action = NULL; button->doubleclick_action = NULL; - button->tooltips = NULL; gtk_container_set_border_width (GTK_CONTAINER (button), 0); @@ -116,11 +115,6 @@ sp_button_destroy (GtkObject *object) button = SP_BUTTON (object); - if (button->tooltips) { - g_object_unref (G_OBJECT (button->tooltips)); - button->tooltips = NULL; - } - if (button->action) { sp_button_set_action (button, NULL); } @@ -186,7 +180,7 @@ sp_button_perform_action (SPButton *button, gpointer /*data*/) GtkWidget * -sp_button_new( Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action, GtkTooltips *tooltips ) +sp_button_new( Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action ) { SPButton *button; @@ -194,9 +188,6 @@ sp_button_new( Inkscape::IconSize size, SPButtonType type, SPAction *action, SPA button->type = type; button->lsize = CLAMP( size, Inkscape::ICON_SIZE_MENU, Inkscape::ICON_SIZE_DECORATION ); - button->tooltips = tooltips; - - if (tooltips) g_object_ref ((GObject *) tooltips); sp_button_set_action (button, action); if (doubleclick_action) @@ -253,9 +244,7 @@ sp_button_set_action (SPButton *button, SPAction *action) } } - if (button->tooltips) { - sp_button_set_composed_tooltip (button->tooltips, (GtkWidget *) button, action); - } + sp_button_set_composed_tooltip ((GtkWidget *) button, action); } static void @@ -283,12 +272,10 @@ static void sp_button_action_set_shortcut (SPAction *action, unsigned int /*shortcut*/, void *data) { SPButton *button=SP_BUTTON (data); - if (button->tooltips) { - sp_button_set_composed_tooltip (button->tooltips, GTK_WIDGET (button), action); - } + sp_button_set_composed_tooltip (GTK_WIDGET (button), action); } -static void sp_button_set_composed_tooltip(GtkTooltips *tooltips, GtkWidget *widget, SPAction *action) +static void sp_button_set_composed_tooltip(GtkWidget *widget, SPAction *action) { if (action) { unsigned int shortcut = sp_shortcut_get_primary (action->verb); @@ -298,16 +285,16 @@ static void sp_button_set_composed_tooltip(GtkTooltips *tooltips, GtkWidget *wid gchar *key = sp_shortcut_get_label(shortcut); gchar *tip = g_strdup_printf ("%s (%s)", action->tip, key); - gtk_tooltips_set_tip(tooltips, widget, tip, NULL); + gtk_widget_set_tooltip_text(widget, tip); g_free(tip); g_free(key); } else { // action has no shortcut - gtk_tooltips_set_tip(tooltips, widget, action->tip, NULL); + gtk_widget_set_tooltip_text(widget, action->tip); } } else { // no action - gtk_tooltips_set_tip(tooltips, widget, NULL, NULL); + gtk_widget_set_tooltip_text(widget, NULL); } } @@ -316,12 +303,11 @@ sp_button_new_from_data( Inkscape::IconSize size, SPButtonType type, Inkscape::UI::View::View *view, const gchar *name, - const gchar *tip, - GtkTooltips *tooltips ) + const gchar *tip ) { GtkWidget *button; SPAction *action=sp_action_new(view, name, name, tip, name, 0); - button = sp_button_new (size, type, action, NULL, tooltips); + button = sp_button_new (size, type, action, NULL); nr_object_unref ((NRObject *) action); return button; } diff --git a/src/widgets/button.h b/src/widgets/button.h index 26191f524..19a513074 100644 --- a/src/widgets/button.h +++ b/src/widgets/button.h @@ -38,7 +38,6 @@ struct SPButton { unsigned int psize; SPAction *action; SPAction *doubleclick_action; - GtkTooltips *tooltips; }; struct SPButtonClass { @@ -49,7 +48,7 @@ struct SPButtonClass { GType sp_button_get_type (void); -GtkWidget *sp_button_new (Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action, GtkTooltips *tooltips); +GtkWidget *sp_button_new (Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action); void sp_button_toggle_set_down (SPButton *button, gboolean down); @@ -57,8 +56,7 @@ GtkWidget *sp_button_new_from_data (Inkscape::IconSize size, SPButtonType type, Inkscape::UI::View::View *view, const gchar *name, - const gchar *tip, - GtkTooltips *tooltips); + const gchar *tip); diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 9f0367665..1de82a315 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -236,7 +236,7 @@ SPDesktopWidget::setMessage (Inkscape::MessageType type, const gchar *message) gdk_window_process_updates(GTK_WIDGET(sb)->window, TRUE); } - gtk_tooltips_set_tip (this->tt, this->select_status_eventbox, gtk_label_get_text (sb) , NULL); + gtk_widget_set_tooltip_text (this->select_status_eventbox, gtk_label_get_text (sb)); } Geom::Point @@ -313,7 +313,6 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) dtw->window = 0; dtw->desktop = NULL; dtw->_interaction_disabled_counter = 0; - dtw->tt = gtk_tooltips_new (); /* Main table */ dtw->vbox = gtk_vbox_new (FALSE, 0); @@ -359,7 +358,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) dtw->hruler = sp_hruler_new (); dtw->hruler_box = eventbox; sp_ruler_set_metric (GTK_RULER (dtw->hruler), SP_PT); - gtk_tooltips_set_tip (dtw->tt, dtw->hruler_box, gettext(sp_unit_get_plural (&sp_unit_get_by_id(SP_UNIT_PT))), NULL); + gtk_widget_set_tooltip_text (dtw->hruler_box, gettext(sp_unit_get_plural (&sp_unit_get_by_id(SP_UNIT_PT)))); gtk_container_add (GTK_CONTAINER (eventbox), dtw->hruler); gtk_table_attach (GTK_TABLE (canvas_tbl), eventbox, 1, 2, 0, 1, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), widget->style->xthickness, 0); g_signal_connect (G_OBJECT (eventbox), "button_press_event", G_CALLBACK (sp_dt_hruler_event), dtw); @@ -371,7 +370,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) dtw->vruler = sp_vruler_new (); dtw->vruler_box = eventbox; sp_ruler_set_metric (GTK_RULER (dtw->vruler), SP_PT); - gtk_tooltips_set_tip (dtw->tt, dtw->vruler_box, gettext(sp_unit_get_plural (&sp_unit_get_by_id(SP_UNIT_PT))), NULL); + gtk_widget_set_tooltip_text (dtw->vruler_box, gettext(sp_unit_get_plural (&sp_unit_get_by_id(SP_UNIT_PT)))); gtk_container_add (GTK_CONTAINER (eventbox), GTK_WIDGET (dtw->vruler)); gtk_table_attach (GTK_TABLE (canvas_tbl), eventbox, 0, 1, 1, 2, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, widget->style->ythickness); g_signal_connect (G_OBJECT (eventbox), "button_press_event", G_CALLBACK (sp_dt_vruler_event), dtw); @@ -389,8 +388,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) SP_BUTTON_TYPE_TOGGLE, NULL, INKSCAPE_ICON_ZOOM_ORIGINAL, - _("Zoom drawing if window size changes"), - dtw->tt); + _("Zoom drawing if window size changes")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dtw->sticky_zoom), prefs->getBool("/options/stickyzoom/value")); gtk_box_pack_start (GTK_BOX (dtw->vscrollbar_box), dtw->sticky_zoom, FALSE, FALSE, 0); g_signal_connect (G_OBJECT (dtw->sticky_zoom), "toggled", G_CALLBACK (sp_dtw_sticky_zoom_toggled), dtw); @@ -412,8 +410,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) SP_BUTTON_TYPE_TOGGLE, NULL, INKSCAPE_ICON_COLOR_MANAGEMENT, - tip, - dtw->tt ); + tip ); #if ENABLE_LCMS { Glib::ustring current = prefs->getString("/options/displayprofile/uri"); @@ -493,7 +490,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) // zoom status spinbutton dtw->zoom_status = gtk_spin_button_new_with_range (log(SP_DESKTOP_ZOOM_MIN)/log(2), log(SP_DESKTOP_ZOOM_MAX)/log(2), 0.1); - gtk_tooltips_set_tip (dtw->tt, dtw->zoom_status, _("Zoom"), NULL); + gtk_widget_set_tooltip_text (dtw->zoom_status, _("Zoom")); gtk_widget_set_size_request (dtw->zoom_status, STATUS_ZOOM_WIDTH, -1); gtk_entry_set_width_chars (GTK_ENTRY (dtw->zoom_status), 6); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (dtw->zoom_status), FALSE); @@ -513,7 +510,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) gtk_table_attach(GTK_TABLE(dtw->coord_status), gtk_vseparator_new(), 0,1, 0,2, GTK_FILL, GTK_FILL, 0, 0); eventbox = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER (eventbox), dtw->coord_status); - gtk_tooltips_set_tip (dtw->tt, eventbox, _("Cursor coordinates"), NULL); + gtk_widget_set_tooltip_text (eventbox, _("Cursor coordinates")); GtkWidget *label_x = gtk_label_new(_("X:")); gtk_misc_set_alignment (GTK_MISC(label_x), 0.0, 0.5); gtk_table_attach(GTK_TABLE(dtw->coord_status), label_x, 1,2, 0,1, GTK_FILL, GTK_FILL, 0, 0); @@ -1595,8 +1592,8 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) } // children } // if aux_toolbox is a container - gtk_tooltips_set_tip(this->tt, this->hruler_box, gettext(sp_unit_get_plural (nv->doc_units)), NULL); - gtk_tooltips_set_tip(this->tt, this->vruler_box, gettext(sp_unit_get_plural (nv->doc_units)), NULL); + gtk_widget_set_tooltip_text(this->hruler_box, gettext(sp_unit_get_plural (nv->doc_units))); + gtk_widget_set_tooltip_text(this->vruler_box, gettext(sp_unit_get_plural (nv->doc_units))); sp_desktop_widget_update_rulers(this); ToolboxFactory::updateSnapToolbox(this->desktop, 0, this->snap_toolbox); diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index c045d6e28..57ba71d8f 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -69,8 +69,6 @@ struct SPDesktopWidget { sigc::connection modified_connection; - GtkTooltips *tt; - SPDesktop *desktop; Gtk::Window *window; diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp index 9a907e78b..3f07e09c8 100644 --- a/src/widgets/gradient-selector.cpp +++ b/src/widgets/gradient-selector.cpp @@ -133,7 +133,6 @@ static void sp_gradient_selector_init(SPGradientSelector *sel) GtkWidget *hb = gtk_hbox_new( FALSE, 0 ); sel->nonsolid.push_back(hb); gtk_box_pack_start( GTK_BOX(sel), hb, FALSE, FALSE, 0 ); - GtkTooltips *ttips = gtk_tooltips_new (); sel->add = gtk_button_new_with_label (_("Duplicate")); sel->nonsolid.push_back(sel->add); @@ -159,12 +158,12 @@ static void sp_gradient_selector_init(SPGradientSelector *sel) sel->nonsolid.push_back(sel->spread); gtk_widget_show(sel->spread); gtk_box_pack_end( GTK_BOX(hb), sel->spread, FALSE, FALSE, 0 ); - gtk_tooltips_set_tip( ttips, sel->spread, + gtk_widget_set_tooltip_text( sel->spread, // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/pservers.html#LinearGradientSpreadMethodAttribute _("Whether to fill with flat color beyond the ends of the gradient vector " "(spreadMethod=\"pad\"), or repeat the gradient in the same direction " "(spreadMethod=\"repeat\"), or repeat the gradient in alternating opposite " - "directions (spreadMethod=\"reflect\")"), NULL); + "directions (spreadMethod=\"reflect\")")); GtkWidget *m = gtk_menu_new(); GtkWidget *mi = gtk_menu_item_new_with_label(_("none")); diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp index 64ed1e309..10e1fb95a 100644 --- a/src/widgets/gradient-toolbar.cpp +++ b/src/widgets/gradient-toolbar.cpp @@ -464,8 +464,6 @@ GtkWidget * gr_change_widget(SPDesktop *desktop) SPGradientSpread spr_selected = (SPGradientSpread) INT_MAX; // meaning undefined bool spr_multi = false; - GtkTooltips *tt = gtk_tooltips_new(); - gr_read_selection (selection, ev? ev->get_drag() : 0, gr_selected, gr_multi, spr_selected, spr_multi); GtkWidget *widget = gtk_hbox_new(FALSE, FALSE); @@ -484,7 +482,7 @@ GtkWidget * gr_change_widget(SPDesktop *desktop) { GtkWidget *hb = gtk_hbox_new(FALSE, 1); GtkWidget *b = gtk_button_new_with_label(_("Edit...")); - gtk_tooltips_set_tip(tt, b, _("Edit the stops of the gradient"), NULL); + gtk_widget_set_tooltip_text(b, _("Edit the stops of the gradient")); gtk_widget_show(b); gtk_container_add(GTK_CONTAINER(hb), b); gtk_signal_connect(GTK_OBJECT(b), "clicked", GTK_SIGNAL_FUNC(gr_edit), widget); @@ -542,8 +540,6 @@ sp_gradient_toolbox_new(SPDesktop *desktop) gtk_object_set_data(GTK_OBJECT(tbl), "dtw", desktop->canvas); gtk_object_set_data(GTK_OBJECT(tbl), "desktop", desktop); - GtkTooltips *tt = gtk_tooltips_new(); - sp_toolbox_add_label(tbl, _("<b>New:</b>")); // TODO replace aux_toolbox_space(tbl, AUX_SPACING); @@ -557,8 +553,7 @@ sp_gradient_toolbox_new(SPDesktop *desktop) SP_BUTTON_TYPE_TOGGLE, NULL, INKSCAPE_ICON_PAINT_GRADIENT_LINEAR, - _("Create linear gradient"), - tt); + _("Create linear gradient") ); g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (gr_toggle_type), tbl); g_object_set_data(G_OBJECT(tbl), "linear", button); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), @@ -571,8 +566,7 @@ sp_gradient_toolbox_new(SPDesktop *desktop) SP_BUTTON_TYPE_TOGGLE, NULL, INKSCAPE_ICON_PAINT_GRADIENT_RADIAL, - _("Create radial (elliptic or circular) gradient"), - tt); + _("Create radial (elliptic or circular) gradient")); g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (gr_toggle_type), tbl); g_object_set_data(G_OBJECT(tbl), "radial", button); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), @@ -599,8 +593,7 @@ sp_gradient_toolbox_new(SPDesktop *desktop) SP_BUTTON_TYPE_TOGGLE, NULL, INKSCAPE_ICON_OBJECT_FILL, - _("Create gradient in the fill"), - tt); + _("Create gradient in the fill")); g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (gr_toggle_fillstroke), tbl); g_object_set_data(G_OBJECT(tbl), "fill", button); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), @@ -613,8 +606,7 @@ sp_gradient_toolbox_new(SPDesktop *desktop) SP_BUTTON_TYPE_TOGGLE, NULL, INKSCAPE_ICON_OBJECT_STROKE, - _("Create gradient in the stroke"), - tt); + _("Create gradient in the stroke")); g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (gr_toggle_fillstroke), tbl); g_object_set_data(G_OBJECT(tbl), "stroke", button); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index 8ef0ee313..9aa414ab6 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -788,7 +788,6 @@ static GtkWidget * sp_gradient_vector_widget_new(SPGradient *gradient, SPStop *s gtk_box_pack_start(GTK_BOX(vb), w, TRUE, TRUE, PAD); sp_repr_add_listener(gradient->getRepr(), &grad_edit_dia_repr_events, vb); - GtkTooltips *tt = gtk_tooltips_new(); /* Stop list */ GtkWidget *mnu = gtk_option_menu_new(); @@ -805,12 +804,12 @@ static GtkWidget * sp_gradient_vector_widget_new(SPGradient *gradient, SPStop *s GtkWidget *b = gtk_button_new_with_label(_("Add stop")); gtk_widget_show(b); gtk_container_add(GTK_CONTAINER(hb), b); - gtk_tooltips_set_tip(tt, b, _("Add another control stop to gradient"), NULL); + gtk_widget_set_tooltip_text(b, _("Add another control stop to gradient")); gtk_signal_connect(GTK_OBJECT(b), "clicked", GTK_SIGNAL_FUNC(sp_grd_ed_add_stop), vb); b = gtk_button_new_with_label(_("Delete stop")); gtk_widget_show(b); gtk_container_add(GTK_CONTAINER(hb), b); - gtk_tooltips_set_tip(tt, b, _("Delete current control stop from gradient"), NULL); + gtk_widget_set_tooltip_text(b, _("Delete current control stop from gradient")); gtk_signal_connect(GTK_OBJECT(b), "clicked", GTK_SIGNAL_FUNC(sp_grd_ed_del_stop), vb); gtk_widget_show(hb); diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index 610930a46..631675ede 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -71,7 +71,7 @@ static void sp_paint_selector_class_init(SPPaintSelectorClass *klass); static void sp_paint_selector_init(SPPaintSelector *slider); static void sp_paint_selector_destroy(GtkObject *object); -static GtkWidget *sp_paint_selector_style_button_add(SPPaintSelector *psel, gchar const *px, SPPaintSelector::Mode mode, GtkTooltips *tt, gchar const *tip); +static GtkWidget *sp_paint_selector_style_button_add(SPPaintSelector *psel, gchar const *px, SPPaintSelector::Mode mode, gchar const *tip); static void sp_paint_selector_style_button_toggled(GtkToggleButton *tb, SPPaintSelector *psel); static void sp_paint_selector_fillrule_toggled(GtkToggleButton *tb, SPPaintSelector *psel); @@ -210,8 +210,6 @@ sp_paint_selector_class_init(SPPaintSelectorClass *klass) static void sp_paint_selector_init(SPPaintSelector *psel) { - GtkTooltips *tt = gtk_tooltips_new(); - psel->mode = static_cast<SPPaintSelector::Mode>(-1); // huh? do you mean 0xff? -- I think this means "not in the enum" /* Paint style button box */ @@ -222,19 +220,19 @@ sp_paint_selector_init(SPPaintSelector *psel) /* Buttons */ psel->none = sp_paint_selector_style_button_add(psel, INKSCAPE_ICON_PAINT_NONE, - SPPaintSelector::MODE_NONE, tt, _("No paint")); + SPPaintSelector::MODE_NONE, _("No paint")); psel->solid = sp_paint_selector_style_button_add(psel, INKSCAPE_ICON_PAINT_SOLID, - SPPaintSelector::MODE_COLOR_RGB, tt, _("Flat color")); + SPPaintSelector::MODE_COLOR_RGB, _("Flat color")); psel->gradient = sp_paint_selector_style_button_add(psel, INKSCAPE_ICON_PAINT_GRADIENT_LINEAR, - SPPaintSelector::MODE_GRADIENT_LINEAR, tt, _("Linear gradient")); + SPPaintSelector::MODE_GRADIENT_LINEAR, _("Linear gradient")); psel->radial = sp_paint_selector_style_button_add(psel, INKSCAPE_ICON_PAINT_GRADIENT_RADIAL, - SPPaintSelector::MODE_GRADIENT_RADIAL, tt, _("Radial gradient")); + SPPaintSelector::MODE_GRADIENT_RADIAL, _("Radial gradient")); psel->pattern = sp_paint_selector_style_button_add(psel, INKSCAPE_ICON_PAINT_PATTERN, - SPPaintSelector::MODE_PATTERN, tt, _("Pattern")); + SPPaintSelector::MODE_PATTERN, _("Pattern")); psel->swatch = sp_paint_selector_style_button_add(psel, INKSCAPE_ICON_PAINT_SWATCH, - SPPaintSelector::MODE_SWATCH, tt, _("Swatch")); + SPPaintSelector::MODE_SWATCH, _("Swatch")); psel->unset = sp_paint_selector_style_button_add(psel, INKSCAPE_ICON_PAINT_UNKNOWN, - SPPaintSelector::MODE_UNSET, tt, _("Unset paint (make it undefined so it can be inherited)")); + SPPaintSelector::MODE_UNSET, _("Unset paint (make it undefined so it can be inherited)")); /* Fillrule */ { @@ -246,7 +244,7 @@ sp_paint_selector_init(SPPaintSelector *psel) gtk_button_set_relief(GTK_BUTTON(psel->evenodd), GTK_RELIEF_NONE); gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(psel->evenodd), FALSE); // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/painting.html#FillRuleProperty - gtk_tooltips_set_tip(tt, psel->evenodd, _("Any path self-intersections or subpaths create holes in the fill (fill-rule: evenodd)"), NULL); + gtk_widget_set_tooltip_text(psel->evenodd, _("Any path self-intersections or subpaths create holes in the fill (fill-rule: evenodd)")); gtk_object_set_data(GTK_OBJECT(psel->evenodd), "mode", GUINT_TO_POINTER(SPPaintSelector::FILLRULE_EVENODD)); w = sp_icon_new(Inkscape::ICON_SIZE_DECORATION, INKSCAPE_ICON_FILL_RULE_EVEN_ODD); gtk_container_add(GTK_CONTAINER(psel->evenodd), w); @@ -257,7 +255,7 @@ sp_paint_selector_init(SPPaintSelector *psel) gtk_button_set_relief(GTK_BUTTON(psel->nonzero), GTK_RELIEF_NONE); gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(psel->nonzero), FALSE); // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/painting.html#FillRuleProperty - gtk_tooltips_set_tip(tt, psel->nonzero, _("Fill is solid unless a subpath is counterdirectional (fill-rule: nonzero)"), NULL); + gtk_widget_set_tooltip_text(psel->nonzero, _("Fill is solid unless a subpath is counterdirectional (fill-rule: nonzero)")); gtk_object_set_data(GTK_OBJECT(psel->nonzero), "mode", GUINT_TO_POINTER(SPPaintSelector::FILLRULE_NONZERO)); w = sp_icon_new(Inkscape::ICON_SIZE_DECORATION, INKSCAPE_ICON_FILL_RULE_NONZERO); gtk_container_add(GTK_CONTAINER(psel->nonzero), w); @@ -290,12 +288,12 @@ sp_paint_selector_destroy(GtkObject *object) static GtkWidget *sp_paint_selector_style_button_add(SPPaintSelector *psel, gchar const *pixmap, SPPaintSelector::Mode mode, - GtkTooltips *tt, gchar const *tip) + gchar const *tip) { GtkWidget *b, *w; b = gtk_toggle_button_new(); - gtk_tooltips_set_tip(tt, b, tip, NULL); + gtk_widget_set_tooltip_text(b, tip); gtk_widget_show(b); gtk_container_set_border_width(GTK_CONTAINER(b), 0); diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index 72134c48f..0bae54655 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -137,8 +137,7 @@ ColorICCSelector::ColorICCSelector( SPColorSelector* csel ) _fooMap(0), _adj(0), _sbtn(0), - _label(0), - _tt(0) + _label(0) #if ENABLE_LCMS , _profileName(""), @@ -270,8 +269,6 @@ void ColorICCSelector::init() _updating = FALSE; _dragging = FALSE; - _tt = gtk_tooltips_new(); - t = gtk_table_new (5, 3, FALSE); gtk_widget_show (t); gtk_box_pack_start (GTK_BOX (_csel), t, TRUE, TRUE, 0); @@ -290,7 +287,7 @@ void ColorICCSelector::init() _fixupBtn = gtk_button_new_with_label(_("Fix")); g_signal_connect( G_OBJECT(_fixupBtn), "clicked", G_CALLBACK(_fixupHit), (gpointer)this ); gtk_widget_set_sensitive( _fixupBtn, FALSE ); - gtk_tooltips_set_tip( _tt, _fixupBtn, _("Fix RGB fallback to match icc-color() value."), NULL ); + gtk_widget_set_tooltip_text( _fixupBtn, _("Fix RGB fallback to match icc-color() value.") ); //gtk_misc_set_alignment( GTK_MISC (_fixupBtn), 1.0, 0.5 ); gtk_widget_show( _fixupBtn ); gtk_table_attach( GTK_TABLE (t), _fixupBtn, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD ); @@ -338,18 +335,18 @@ void ColorICCSelector::init() /* Slider */ _fooSlider[i] = sp_color_slider_new( _fooAdj[i] ); #if ENABLE_LCMS - gtk_tooltips_set_tip( _tt, _fooSlider[i], tips[i], NULL ); + gtk_widget_set_tooltip_text( _fooSlider[i], tips[i] ); #else - gtk_tooltips_set_tip( _tt, _fooSlider[i], ".", NULL ); + gtk_widget_set_tooltip_text( _fooSlider[i], "." ); #endif // ENABLE_LCMS gtk_widget_show( _fooSlider[i] ); gtk_table_attach( GTK_TABLE (t), _fooSlider[i], 1, 2, row, row + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)GTK_FILL, XPAD, YPAD ); _fooBtn[i] = gtk_spin_button_new( _fooAdj[i], step, digits ); #if ENABLE_LCMS - gtk_tooltips_set_tip( _tt, _fooBtn[i], tips[i], NULL ); + gtk_widget_set_tooltip_text( _fooBtn[i], tips[i] ); #else - gtk_tooltips_set_tip( _tt, _fooBtn[i], ".", NULL ); + gtk_widget_set_tooltip_text( _fooBtn[i], "." ); #endif // ENABLE_LCMS sp_dialog_defocus_on_enter( _fooBtn[i] ); gtk_label_set_mnemonic_widget( GTK_LABEL(_fooLabel[i]), _fooBtn[i] ); @@ -381,7 +378,7 @@ void ColorICCSelector::init() /* Slider */ _slider = sp_color_slider_new (_adj); - gtk_tooltips_set_tip (_tt, _slider, _("Alpha (opacity)"), NULL); + gtk_widget_set_tooltip_text (_slider, _("Alpha (opacity)")); gtk_widget_show (_slider); gtk_table_attach (GTK_TABLE (t), _slider, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)GTK_FILL, XPAD, YPAD); @@ -393,7 +390,7 @@ void ColorICCSelector::init() /* Spinbutton */ _sbtn = gtk_spin_button_new (GTK_ADJUSTMENT (_adj), 1.0, 0); - gtk_tooltips_set_tip (_tt, _sbtn, _("Alpha (opacity)"), NULL); + gtk_widget_set_tooltip_text (_sbtn, _("Alpha (opacity)")); sp_dialog_defocus_on_enter (_sbtn); gtk_label_set_mnemonic_widget (GTK_LABEL(_label), _sbtn); gtk_widget_show (_sbtn); @@ -694,8 +691,8 @@ void ColorICCSelector::_setProfile( SVGICCColor* profile ) for ( guint i = 0; i < _profChannelCount; i++ ) { gtk_label_set_text_with_mnemonic( GTK_LABEL(_fooLabel[i]), names[i]); - gtk_tooltips_set_tip( _tt, _fooSlider[i], tips[i], NULL ); - gtk_tooltips_set_tip( _tt, _fooBtn[i], tips[i], NULL ); + gtk_widget_set_tooltip_text( _fooSlider[i], tips[i] ); + gtk_widget_set_tooltip_text( _fooBtn[i], tips[i] ); sp_color_slider_set_colors( SP_COLOR_SLIDER(_fooSlider[i]), SPColor(0.0, 0.0, 0.0).toRGBA32(0xff), diff --git a/src/widgets/sp-color-icc-selector.h b/src/widgets/sp-color-icc-selector.h index f40d93189..b0efa35f4 100644 --- a/src/widgets/sp-color-icc-selector.h +++ b/src/widgets/sp-color-icc-selector.h @@ -66,8 +66,6 @@ protected: GtkWidget* _sbtn; /* Spinbutton */ GtkWidget* _label; /* Label */ - GtkTooltips* _tt; /* tooltip container */ - #if ENABLE_LCMS std::string _profileName; Inkscape::ColorProfile* _prof; diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 174971555..4c2c03e8a 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -203,8 +203,6 @@ void ColorNotebook::init() GType *selector_types = 0; guint selector_type_count = 0; - GtkTooltips *tt = gtk_tooltips_new (); - /* tempory hardcoding to get types loaded */ SP_TYPE_COLOR_SCALES; SP_TYPE_COLOR_WHEEL_SELECTOR; @@ -336,24 +334,21 @@ void ColorNotebook::init() _box_colormanaged = gtk_event_box_new (); GtkWidget *colormanaged = gtk_image_new_from_icon_name ("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_container_add (GTK_CONTAINER (_box_colormanaged), colormanaged); - GtkTooltips *tooltips_colormanaged = gtk_tooltips_new (); - gtk_tooltips_set_tip (tooltips_colormanaged, _box_colormanaged, _("Color Managed"), ""); + gtk_widget_set_tooltip_text (_box_colormanaged, _("Color Managed")); gtk_widget_set_sensitive (_box_colormanaged, false); gtk_box_pack_start(GTK_BOX(rgbabox), _box_colormanaged, FALSE, FALSE, 2); _box_outofgamut = gtk_event_box_new (); GtkWidget *outofgamut = gtk_image_new_from_icon_name ("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_container_add (GTK_CONTAINER (_box_outofgamut), outofgamut); - GtkTooltips *tooltips_outofgamut = gtk_tooltips_new (); - gtk_tooltips_set_tip (tooltips_outofgamut, _box_outofgamut, _("Out of gamut!"), ""); + gtk_widget_set_tooltip_text (_box_outofgamut, _("Out of gamut!")); gtk_widget_set_sensitive (_box_outofgamut, false); gtk_box_pack_start(GTK_BOX(rgbabox), _box_outofgamut, FALSE, FALSE, 2); _box_toomuchink = gtk_event_box_new (); GtkWidget *toomuchink = gtk_image_new_from_icon_name ("too-much-ink-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_container_add (GTK_CONTAINER (_box_toomuchink), toomuchink); - GtkTooltips *tooltips_toomuchink = gtk_tooltips_new (); - gtk_tooltips_set_tip (tooltips_toomuchink, _box_toomuchink, _("Too much ink!"), ""); + gtk_widget_set_tooltip_text (_box_toomuchink, _("Too much ink!")); gtk_widget_set_sensitive (_box_toomuchink, false); gtk_box_pack_start(GTK_BOX(rgbabox), _box_toomuchink, FALSE, FALSE, 2); @@ -368,7 +363,7 @@ void ColorNotebook::init() sp_dialog_defocus_on_enter (_rgbae); gtk_entry_set_max_length (GTK_ENTRY (_rgbae), 8); gtk_entry_set_width_chars (GTK_ENTRY (_rgbae), 8); - gtk_tooltips_set_tip (tt, _rgbae, _("Hexadecimal RGBA value of the color"), NULL); + gtk_widget_set_tooltip_text (_rgbae, _("Hexadecimal RGBA value of the color")); gtk_box_pack_start(GTK_BOX(rgbabox), _rgbae, FALSE, FALSE, 0); gtk_label_set_mnemonic_widget (GTK_LABEL(_rgbal), _rgbae); diff --git a/src/widgets/sp-color-scales.cpp b/src/widgets/sp-color-scales.cpp index fb8bb0795..001b54752 100644 --- a/src/widgets/sp-color-scales.cpp +++ b/src/widgets/sp-color-scales.cpp @@ -140,8 +140,6 @@ void ColorScales::init() _updating = FALSE; _dragging = FALSE; - _tt = gtk_tooltips_new(); - t = gtk_table_new (5, 3, FALSE); gtk_widget_show (t); gtk_box_pack_start (GTK_BOX (_csel), t, TRUE, TRUE, 0); @@ -402,17 +400,17 @@ void ColorScales::setMode(SPColorScalesMode mode) case SP_COLOR_SCALES_MODE_RGB: _setRangeLimit(255.0); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[0]), _("_R:")); - gtk_tooltips_set_tip (_tt, _s[0], _("Red"), NULL); - gtk_tooltips_set_tip (_tt, _b[0], _("Red"), NULL); + gtk_widget_set_tooltip_text (_s[0], _("Red")); + gtk_widget_set_tooltip_text (_b[0], _("Red")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[1]), _("_G:")); - gtk_tooltips_set_tip (_tt, _s[1], _("Green"), NULL); - gtk_tooltips_set_tip (_tt, _b[1], _("Green"), NULL); + gtk_widget_set_tooltip_text (_s[1], _("Green")); + gtk_widget_set_tooltip_text (_b[1], _("Green")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[2]), _("_B:")); - gtk_tooltips_set_tip (_tt, _s[2], _("Blue"), NULL); - gtk_tooltips_set_tip (_tt, _b[2], _("Blue"), NULL); + gtk_widget_set_tooltip_text (_s[2], _("Blue")); + gtk_widget_set_tooltip_text (_b[2], _("Blue")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[3]), _("_A:")); - gtk_tooltips_set_tip (_tt, _s[3], _("Alpha (opacity)"), NULL); - gtk_tooltips_set_tip (_tt, _b[3], _("Alpha (opacity)"), NULL); + gtk_widget_set_tooltip_text (_s[3], _("Alpha (opacity)")); + gtk_widget_set_tooltip_text (_b[3], _("Alpha (opacity)")); sp_color_slider_set_map (SP_COLOR_SLIDER (_s[0]), NULL); gtk_widget_hide (_l[4]); gtk_widget_hide (_s[4]); @@ -428,17 +426,17 @@ void ColorScales::setMode(SPColorScalesMode mode) case SP_COLOR_SCALES_MODE_HSV: _setRangeLimit(255.0); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[0]), _("_H:")); - gtk_tooltips_set_tip (_tt, _s[0], _("Hue"), NULL); - gtk_tooltips_set_tip (_tt, _b[0], _("Hue"), NULL); + gtk_widget_set_tooltip_text (_s[0], _("Hue")); + gtk_widget_set_tooltip_text (_b[0], _("Hue")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[1]), _("_S:")); - gtk_tooltips_set_tip (_tt, _s[1], _("Saturation"), NULL); - gtk_tooltips_set_tip (_tt, _b[1], _("Saturation"), NULL); + gtk_widget_set_tooltip_text (_s[1], _("Saturation")); + gtk_widget_set_tooltip_text (_b[1], _("Saturation")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[2]), _("_L:")); - gtk_tooltips_set_tip (_tt, _s[2], _("Lightness"), NULL); - gtk_tooltips_set_tip (_tt, _b[2], _("Lightness"), NULL); + gtk_widget_set_tooltip_text (_s[2], _("Lightness")); + gtk_widget_set_tooltip_text (_b[2], _("Lightness")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[3]), _("_A:")); - gtk_tooltips_set_tip (_tt, _s[3], _("Alpha (opacity)"), NULL); - gtk_tooltips_set_tip (_tt, _b[3], _("Alpha (opacity)"), NULL); + gtk_widget_set_tooltip_text (_s[3], _("Alpha (opacity)")); + gtk_widget_set_tooltip_text (_b[3], _("Alpha (opacity)")); sp_color_slider_set_map (SP_COLOR_SLIDER (_s[0]), (guchar*)sp_color_scales_hue_map ()); gtk_widget_hide (_l[4]); gtk_widget_hide (_s[4]); @@ -456,20 +454,20 @@ void ColorScales::setMode(SPColorScalesMode mode) case SP_COLOR_SCALES_MODE_CMYK: _setRangeLimit(100.0); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[0]), _("_C:")); - gtk_tooltips_set_tip (_tt, _s[0], _("Cyan"), NULL); - gtk_tooltips_set_tip (_tt, _b[0], _("Cyan"), NULL); + gtk_widget_set_tooltip_text (_s[0], _("Cyan")); + gtk_widget_set_tooltip_text (_b[0], _("Cyan")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[1]), _("_M:")); - gtk_tooltips_set_tip (_tt, _s[1], _("Magenta"), NULL); - gtk_tooltips_set_tip (_tt, _b[1], _("Magenta"), NULL); + gtk_widget_set_tooltip_text (_s[1], _("Magenta")); + gtk_widget_set_tooltip_text (_b[1], _("Magenta")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[2]), _("_Y:")); - gtk_tooltips_set_tip (_tt, _s[2], _("Yellow"), NULL); - gtk_tooltips_set_tip (_tt, _b[2], _("Yellow"), NULL); + gtk_widget_set_tooltip_text (_s[2], _("Yellow")); + gtk_widget_set_tooltip_text (_b[2], _("Yellow")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[3]), _("_K:")); - gtk_tooltips_set_tip (_tt, _s[3], _("Black"), NULL); - gtk_tooltips_set_tip (_tt, _b[3], _("Black"), NULL); + gtk_widget_set_tooltip_text (_s[3], _("Black")); + gtk_widget_set_tooltip_text (_b[3], _("Black")); gtk_label_set_markup_with_mnemonic (GTK_LABEL (_l[4]), _("_A:")); - gtk_tooltips_set_tip (_tt, _s[4], _("Alpha (opacity)"), NULL); - gtk_tooltips_set_tip (_tt, _b[4], _("Alpha (opacity)"), NULL); + gtk_widget_set_tooltip_text (_s[4], _("Alpha (opacity)")); + gtk_widget_set_tooltip_text (_b[4], _("Alpha (opacity)")); sp_color_slider_set_map (SP_COLOR_SLIDER (_s[0]), NULL); gtk_widget_show (_l[4]); gtk_widget_show (_s[4]); diff --git a/src/widgets/sp-color-scales.h b/src/widgets/sp-color-scales.h index b50c386e8..798a920af 100644 --- a/src/widgets/sp-color-scales.h +++ b/src/widgets/sp-color-scales.h @@ -65,8 +65,6 @@ protected: GtkWidget *_b[5]; /* Spinbuttons */ GtkWidget *_l[5]; /* Labels */ - GtkTooltips *_tt; /* tooltip container */ - private: // By default, disallow copy constructor and assignment operator ColorScales(ColorScales const &obj); diff --git a/src/widgets/sp-color-wheel-selector.cpp b/src/widgets/sp-color-wheel-selector.cpp index 147c91525..25ba250a7 100644 --- a/src/widgets/sp-color-wheel-selector.cpp +++ b/src/widgets/sp-color-wheel-selector.cpp @@ -152,8 +152,6 @@ void ColorWheelSelector::init() _updating = FALSE; _dragging = FALSE; - _tt = gtk_tooltips_new(); - t = gtk_table_new (5, 3, FALSE); gtk_widget_show (t); gtk_box_pack_start (GTK_BOX (_csel), t, TRUE, TRUE, 0); @@ -179,7 +177,7 @@ void ColorWheelSelector::init() /* Slider */ _slider = sp_color_slider_new (_adj); - gtk_tooltips_set_tip (_tt, _slider, _("Alpha (opacity)"), NULL); + gtk_widget_set_tooltip_text (_slider, _("Alpha (opacity)")); gtk_widget_show (_slider); gtk_table_attach (GTK_TABLE (t), _slider, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)GTK_FILL, XPAD, YPAD); @@ -191,7 +189,7 @@ void ColorWheelSelector::init() /* Spinbutton */ _sbtn = gtk_spin_button_new (GTK_ADJUSTMENT (_adj), 1.0, 0); - gtk_tooltips_set_tip (_tt, _sbtn, _("Alpha (opacity)"), NULL); + gtk_widget_set_tooltip_text (_sbtn, _("Alpha (opacity)")); sp_dialog_defocus_on_enter (_sbtn); gtk_label_set_mnemonic_widget (GTK_LABEL(_label), _sbtn); gtk_widget_show (_sbtn); diff --git a/src/widgets/sp-color-wheel-selector.h b/src/widgets/sp-color-wheel-selector.h index 6c8d2d12b..553f351a0 100644 --- a/src/widgets/sp-color-wheel-selector.h +++ b/src/widgets/sp-color-wheel-selector.h @@ -44,8 +44,6 @@ protected: GtkWidget* _sbtn; /* Spinbutton */ GtkWidget* _label; /* Label */ - GtkTooltips* _tt; /* tooltip container */ - private: // By default, disallow copy constructor and assignment operator ColorWheelSelector( const ColorWheelSelector& obj ); diff --git a/src/widgets/spw-utilities.cpp b/src/widgets/spw-utilities.cpp index 49e3a7495..aec1e2e11 100644 --- a/src/widgets/spw-utilities.cpp +++ b/src/widgets/spw-utilities.cpp @@ -92,10 +92,8 @@ GtkWidget *spw_vbox_checkbutton(GtkWidget *dialog, GtkWidget *vbox, g_assert (dialog != NULL); g_assert (vbox != NULL); - GtkTooltips *tt = gtk_tooltips_new (); - GtkWidget *b = gtk_check_button_new_with_label (label); - gtk_tooltips_set_tip(tt, b, tip, NULL); + gtk_widget_set_tooltip_text(b, tip); g_assert (b != NULL); gtk_widget_show (b); gtk_box_pack_start (GTK_BOX (vbox), b, FALSE, FALSE, 0); diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 0dcecfcb1..238e5df7a 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -548,11 +548,11 @@ static void update_commands_toolbox(SPDesktop *desktop, SPEventContext *eventcon static GtkWidget * sp_toolbox_button_new_from_verb_with_doubleclick( GtkWidget *t, Inkscape::IconSize size, SPButtonType type, Inkscape::Verb *verb, Inkscape::Verb *doubleclick_verb, - Inkscape::UI::View::View *view, GtkTooltips *tt); + Inkscape::UI::View::View *view); class VerbAction : public Gtk::Action { public: - static Glib::RefPtr<VerbAction> create(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view, GtkTooltips *tooltips); + static Glib::RefPtr<VerbAction> create(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view); virtual ~VerbAction(); virtual void set_active(bool active = true); @@ -570,31 +570,29 @@ private: Inkscape::Verb* verb; Inkscape::Verb* verb2; Inkscape::UI::View::View *view; - GtkTooltips *tooltips; bool active; - VerbAction(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view, GtkTooltips *tooltips); + VerbAction(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view); }; -Glib::RefPtr<VerbAction> VerbAction::create(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view, GtkTooltips *tooltips) +Glib::RefPtr<VerbAction> VerbAction::create(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view) { Glib::RefPtr<VerbAction> result; SPAction *action = verb->get_action(view); if ( action ) { //SPAction* action2 = verb2 ? verb2->get_action(view) : 0; - result = Glib::RefPtr<VerbAction>(new VerbAction(verb, verb2, view, tooltips)); + result = Glib::RefPtr<VerbAction>(new VerbAction(verb, verb2, view)); } return result; } -VerbAction::VerbAction(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view, GtkTooltips *tooltips) : +VerbAction::VerbAction(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view) : Gtk::Action(Glib::ustring(verb->get_id()), Gtk::StockID(verb->get_image()), Glib::ustring(_(verb->get_name())), Glib::ustring(_(verb->get_tip()))), verb(verb), verb2(verb2), view(view), - tooltips(tooltips), active(false) { } @@ -624,8 +622,7 @@ Gtk::Widget* VerbAction::create_tool_item_vfunc() SP_BUTTON_TYPE_TOGGLE, verb, verb2, - view, - tooltips ); + view ); if ( active ) { sp_button_toggle_set_down( SP_BUTTON(button), active); } @@ -808,7 +805,7 @@ static void delete_prefspusher(GtkObject * /*obj*/, PrefPusher *watcher ) GtkWidget * sp_toolbox_button_new_from_verb_with_doubleclick(GtkWidget *t, Inkscape::IconSize size, SPButtonType type, Inkscape::Verb *verb, Inkscape::Verb *doubleclick_verb, - Inkscape::UI::View::View *view, GtkTooltips *tt) + Inkscape::UI::View::View *view) { SPAction *action = verb->get_action(view); if (!action) { @@ -824,7 +821,7 @@ GtkWidget * sp_toolbox_button_new_from_verb_with_doubleclick(GtkWidget *t, Inksc /* fixme: Handle sensitive/unsensitive */ /* fixme: Implement sp_button_new_from_action */ - GtkWidget *b = sp_button_new(size, type, action, doubleclick_action, tt); + GtkWidget *b = sp_button_new(size, type, action, doubleclick_action); gtk_widget_show(b); @@ -959,9 +956,8 @@ static Glib::RefPtr<Gtk::ActionGroup> create_or_fetch_actions( SPDesktop* deskto } if ( !mainActions->get_action("ToolZoom") ) { - GtkTooltips *tt = gtk_tooltips_new(); for ( guint i = 0; i < G_N_ELEMENTS(tools) && tools[i].type_name; i++ ) { - Glib::RefPtr<VerbAction> va = VerbAction::create(Inkscape::Verb::get(tools[i].verb), Inkscape::Verb::get(tools[i].doubleclick_verb), view, tt); + Glib::RefPtr<VerbAction> va = VerbAction::create(Inkscape::Verb::get(tools[i].verb), Inkscape::Verb::get(tools[i].doubleclick_verb), view); if ( va ) { mainActions->add(va); if ( i == 0 ) { |
