Commit a98ffa63 authored by Nathan Lee's avatar Nathan Lee

Pencil toolbar shows flatten simplify only if simplify enabled

Makes status of flatten simplify consistently shown only if
simplify lpe was active (previously shown on mode change).

(reverts a9d5e92c)
(cherry-picked from 3ab20701)
parent 5df58fb0
Pipeline #166000947 passed with stages
in 112 minutes and 26 seconds
......@@ -228,12 +228,11 @@ PencilToolbar::mode_changed(int mode)
bool visible = (mode != 2);
if (_flatten_simplify) {
_flatten_simplify->set_visible(visible);
}
if (_simplify) {
_simplify->set_visible(visible);
if (_flatten_simplify) {
_flatten_simplify->set_visible(visible && _simplify->get_active());
}
}
if (tools_isactive(_desktop, TOOLS_FREEHAND_PEN)) {
SP_PEN_CONTEXT(_desktop->event_context)->setPolylineMode();
......@@ -336,6 +335,7 @@ PencilToolbar::maxpressure_value_changed()
void
PencilToolbar::use_pencil_pressure() {
// assumes called by pencil toolbar (and all these widgets exist)
bool pressure = _pressure_item->get_active();
auto prefs = Inkscape::Preferences::get();
prefs->setBool(freehand_tool_name() + "/pressure", pressure);
......@@ -346,6 +346,7 @@ PencilToolbar::use_pencil_pressure() {
_shape_item->set_visible(false);
_simplify->set_visible(false);
_flatten_spiro_bspline->set_visible(false);
_flatten_simplify->set_visible(false);
for (auto button : _mode_buttons) {
button->set_sensitive(false);
}
......@@ -356,7 +357,9 @@ PencilToolbar::use_pencil_pressure() {
_maxpressure->set_visible(false);
_cap_item->set_visible(false);
_shape_item->set_visible(true);
_simplify->set_visible(true);
bool simplify_visible = freehandMode != 2;
_simplify->set_visible(simplify_visible);
_flatten_simplify->set_visible(simplify_visible && _simplify->get_active());
if (freehandMode == 1 || freehandMode == 2) {
_flatten_spiro_bspline->set_visible(true);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment