X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fwidgets%2Fstroke-style.cpp;h=f502f87d30056c941514065ccc6eb21c6d700124;hb=14436564bb2e08caedc3899e7be87c3abaea21c5;hp=b1678f26631e880368eeff697cd0acdca013e7ee;hpb=a73e5f92baa51f76f70126ed64cabac4fa811764;p=inkscape.git diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index b1678f266..f502f87d3 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -1073,6 +1073,8 @@ sp_stroke_style_line_widget_new(void) gint i = 0; + //TRANSLATORS: only translate "string" in "context|string". + // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS /* Stroke width */ spw_label(t, Q_("StrokeWidth|Width:"), 0, i); @@ -1085,7 +1087,7 @@ sp_stroke_style_line_widget_new(void) // with it, the two remaining calls of stroke_average_width, allowing us to get rid of that // function in desktop-style. - a = new Gtk::Adjustment(1.0, 0.0, 1000.0, 0.1, 10.0, 10.0); + a = new Gtk::Adjustment(1.0, 0.0, 1000.0, 0.1, 10.0, 0.0); spw->set_data("width", a); sb = new Gtk::SpinButton(*a, 0.1, 3); tt->set_tip(*sb, _("Stroke width")); @@ -1125,22 +1127,27 @@ sp_stroke_style_line_widget_new(void) // For an example, draw a triangle with a large stroke width and modify the // "Join" option (in the Fill and Stroke dialog). tt->set_tip(*tb, _("Miter join")); + spw->set_data("miter join", tb); tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_JOIN_ROUND, hb, spw, "join", "round"); + // TRANSLATORS: Round join: joining lines with a rounded corner. // For an example, draw a triangle with a large stroke width and modify the // "Join" option (in the Fill and Stroke dialog). tt->set_tip(*tb, _("Round join")); + spw->set_data("round join", tb); tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_JOIN_BEVEL, hb, spw, "join", "bevel"); + // TRANSLATORS: Bevel join: joining lines with a blunted (flattened) corner. // For an example, draw a triangle with a large stroke width and modify the // "Join" option (in the Fill and Stroke dialog). tt->set_tip(*tb, _("Bevel join")); + spw->set_data("bevel join", tb); i++; @@ -1155,7 +1162,7 @@ sp_stroke_style_line_widget_new(void) hb = spw_hbox(t, 3, 1, i); - a = new Gtk::Adjustment(4.0, 0.0, 100.0, 0.1, 10.0, 10.0); + a = new Gtk::Adjustment(4.0, 0.0, 100.0, 0.1, 10.0, 0.0); spw->set_data("miterlimit", a); sb = new Gtk::SpinButton(*a, 0.1, 2); @@ -1179,6 +1186,7 @@ sp_stroke_style_line_widget_new(void) tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_CAP_BUTT, hb, spw, "cap", "butt"); + spw->set_data("cap butt", tb); // TRANSLATORS: Butt cap: the line shape does not extend beyond the end point // of the line; the ends of the line are square @@ -1186,6 +1194,7 @@ sp_stroke_style_line_widget_new(void) tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_CAP_ROUND, hb, spw, "cap", "round"); + spw->set_data("cap round", tb); // TRANSLATORS: Round cap: the line shape extends beyond the end point of the // line; the ends of the line are rounded @@ -1193,6 +1202,7 @@ sp_stroke_style_line_widget_new(void) tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_CAP_SQUARE, hb, spw, "cap", "square"); + spw->set_data("cap square", tb); // TRANSLATORS: Square cap: the line shape extends beyond the end point of the // line; the ends of the line are square @@ -1393,11 +1403,12 @@ sp_stroke_style_line_update(Gtk::Container *spw, Inkscape::Selection *sel) int result_cap = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_STROKECAP); int result_join = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_STROKEJOIN); - if (result_sw == QUERY_STYLE_NOTHING) { - /* No objects stroked, set insensitive */ - sset->set_sensitive(false); + if (!sel || sel->isEmpty()) { + // Nothing selected, grey-out all controls in the stroke-style dialog + sset->set_sensitive(false); spw->set_data("update", GINT_TO_POINTER(FALSE)); + return; } else { sset->set_sensitive(true); @@ -1421,6 +1432,31 @@ sp_stroke_style_line_update(Gtk::Container *spw, Inkscape::Selection *sel) } else { width->set_value(100); } + + // if none of the selected objects has a stroke, than quite some controls should be disabled + // The markers might still be shown though, so these will not be disabled + bool enabled = (result_sw != QUERY_STYLE_NOTHING) && !query->stroke.isNoneSet(); + /* No objects stroked, set insensitive */ + Gtk::RadioButton *tb = NULL; + tb = static_cast(spw->get_data("miter join")); + tb->set_sensitive(enabled); + tb = static_cast(spw->get_data("round join")); + tb->set_sensitive(enabled); + tb = static_cast(spw->get_data("bevel join")); + tb->set_sensitive(enabled); + + Gtk::SpinButton* sb = NULL; + sb = static_cast(spw->get_data("miterlimit_sb")); + sb->set_sensitive(enabled); + + tb = static_cast(spw->get_data("cap butt")); + tb->set_sensitive(enabled); + tb = static_cast(spw->get_data("cap round")); + tb->set_sensitive(enabled); + tb = static_cast(spw->get_data("cap square")); + tb->set_sensitive(enabled); + + dsel->set_sensitive(enabled); } if (result_ml != QUERY_STYLE_NOTHING)