diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2009-04-18 01:24:27 +0000 |
|---|---|---|
| committer | tweenk <tweenk@users.sourceforge.net> | 2009-04-18 01:24:27 +0000 |
| commit | eba76fd4133117e607221b27d0bee61ec5b17197 (patch) | |
| tree | b2cff54dd213c6e79120de6ce62eb9cc34829112 /src | |
| parent | Fix broken randomize icon (diff) | |
| download | inkscape-eba76fd4133117e607221b27d0bee61ec5b17197.tar.gz inkscape-eba76fd4133117e607221b27d0bee61ec5b17197.zip | |
Fix most icons in the geometry tool
(bzr r7727)
Diffstat (limited to 'src')
| -rw-r--r-- | src/lpe-tool-context.cpp | 23 | ||||
| -rw-r--r-- | src/lpe-tool-context.h | 7 | ||||
| -rw-r--r-- | src/widgets/toolbox.cpp | 10 |
3 files changed, 23 insertions, 17 deletions
diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index d3fb332e5..be465e324 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -54,15 +54,16 @@ void sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpoint const int num_subtools = 8; -Inkscape::LivePathEffect::EffectType lpesubtools[] = { - Inkscape::LivePathEffect::INVALID_LPE, // this must be here to account for the "all inactive" action - Inkscape::LivePathEffect::LINE_SEGMENT, - Inkscape::LivePathEffect::CIRCLE_3PTS, - Inkscape::LivePathEffect::CIRCLE_WITH_RADIUS, - Inkscape::LivePathEffect::PARALLEL, - Inkscape::LivePathEffect::PERP_BISECTOR, - Inkscape::LivePathEffect::ANGLE_BISECTOR, - Inkscape::LivePathEffect::MIRROR_SYMMETRY, +SubtoolEntry lpesubtools[] = { + // this must be here to account for the "all inactive" action + {Inkscape::LivePathEffect::INVALID_LPE, "draw-geometry-inactive"}, + {Inkscape::LivePathEffect::LINE_SEGMENT, "draw-geometry-line-segment"}, + {Inkscape::LivePathEffect::CIRCLE_3PTS, "draw-geometry-circle-from-three-points"}, + {Inkscape::LivePathEffect::CIRCLE_WITH_RADIUS, "draw-geometry-circle-from-radius"}, + {Inkscape::LivePathEffect::PARALLEL, "draw-geometry-line-parallel"}, + {Inkscape::LivePathEffect::PERP_BISECTOR, "draw-geometry-line-perpendicular"}, + {Inkscape::LivePathEffect::ANGLE_BISECTOR, "draw-geometry-angle-bisector"}, + {Inkscape::LivePathEffect::MIRROR_SYMMETRY, "draw-geometry-mirror"} }; static SPPenContextClass *lpetool_parent_class = 0; @@ -285,7 +286,7 @@ sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); int mode = prefs->getInt("/tools/lpetool/mode"); - EffectType type = lpesubtools[mode]; + EffectType type = lpesubtools[mode].type; //bool over_stroke = lc->shape_editor->is_over_stroke(Geom::Point(event->button.x, event->button.y), true); @@ -365,7 +366,7 @@ sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event) int lpetool_mode_to_index(Inkscape::LivePathEffect::EffectType const type) { for (int i = 0; i < num_subtools; ++i) { - if (lpesubtools[i] == type) { + if (lpesubtools[i].type == type) { return i; } } diff --git a/src/lpe-tool-context.h b/src/lpe-tool-context.h index 320fa5189..8a52ba97c 100644 --- a/src/lpe-tool-context.h +++ b/src/lpe-tool-context.h @@ -30,7 +30,12 @@ class SPLPEToolContextClass; /* This is the list of subtools from which the toolbar of the LPETool is built automatically */ extern const int num_subtools; -extern Inkscape::LivePathEffect::EffectType lpesubtools[]; +struct SubtoolEntry { + Inkscape::LivePathEffect::EffectType type; + gchar const *icon_name; +}; + +extern SubtoolEntry lpesubtools[]; enum LPEToolState { LPETOOL_STATE_PEN, diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 0f880e1be..ce2260451 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -5347,7 +5347,7 @@ static void sp_lpetool_mode_changed(EgeSelectOneAction *act, GObject *tbl) g_object_set_data(tbl, "freeze", GINT_TO_POINTER(TRUE)); gint mode = ege_select_one_action_get_active(act); - EffectType type = lpesubtools[mode]; + EffectType type = lpesubtools[mode].type; SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(desktop->event_context); bool success = lpetool_try_construction(lc, type); @@ -5566,17 +5566,17 @@ static void sp_lpetool_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActi gtk_list_store_set( model, &iter, 0, _("All inactive"), 1, _("No geometric tool is active"), - 2, _("all_inactive"), + 2, _("draw-geometry-inactive"), -1 ); Inkscape::LivePathEffect::EffectType type; for (int i = 1; i < num_subtools; ++i) { // we start with i = 1 because INVALID_LPE was already added - type = lpesubtools[i]; + type = lpesubtools[i].type; gtk_list_store_append( model, &iter ); gtk_list_store_set( model, &iter, 0, Inkscape::LivePathEffect::LPETypeConverter.get_label(type).c_str(), 1, Inkscape::LivePathEffect::LPETypeConverter.get_label(type).c_str(), - 2, Inkscape::LivePathEffect::LPETypeConverter.get_key(type).c_str(), + 2, lpesubtools[i].icon_name, -1 ); } @@ -5600,7 +5600,7 @@ static void sp_lpetool_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActi InkToggleAction* act = ink_toggle_action_new( "LPEShowBBoxAction", _("Show limiting bounding box"), _("Show bounding box (used to cut infinite lines)"), - "lpetool_show_bbox", + "show-bounding-box", Inkscape::ICON_SIZE_DECORATION ); gtk_action_group_add_action( mainActions, GTK_ACTION( act ) ); g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(lpetool_toggle_show_bbox), desktop ); |
