diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2015-05-21 08:09:24 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2015-05-21 08:09:24 +0000 |
| commit | da59adbf4c5d970a899919d37a22a31865f9c540 (patch) | |
| tree | 687b92edd754b9899d5c0c31ca382c803676498d /src | |
| parent | image_attributes.inx: mark more strings for translation; update POTFILES.in (diff) | |
| download | inkscape-da59adbf4c5d970a899919d37a22a31865f9c540.tar.gz inkscape-da59adbf4c5d970a899919d37a22a31865f9c540.zip | |
Don't fill entry box with zeros while typing. Bug introduced with r14160.
(bzr r14166)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/widget/color-entry.cpp | 10 | ||||
| -rw-r--r-- | src/ui/widget/color-entry.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/ui/widget/color-entry.cpp b/src/ui/widget/color-entry.cpp index 473d7de65..f5658c3a6 100644 --- a/src/ui/widget/color-entry.cpp +++ b/src/ui/widget/color-entry.cpp @@ -20,6 +20,7 @@ namespace Widget { ColorEntry::ColorEntry(SelectedColor &color) : _color(color) , _updating(false) + , _updatingrgba(false) { _color_changed_connection = color.signal_changed.connect(sigc::mem_fun(this, &ColorEntry::_onColorChanged)); _color_dragged_connection = color.signal_dragged.connect(sigc::mem_fun(this, &ColorEntry::_onColorChanged)); @@ -41,6 +42,9 @@ void ColorEntry::on_changed() if (_updating) { return; } + if (_updatingrgba) { + return; // Typing text into entry box + } Glib::ustring text = get_text(); bool changed = false; @@ -64,11 +68,13 @@ void ColorEntry::on_changed() if (len < 8) { rgba = rgba << (4 * (8 - len)); } + _updatingrgba = true; if (changed) { set_text(str); } SPColor color(rgba); _color.setColorAlpha(color, SP_RGBA32_A_F(rgba)); + _updatingrgba = false; } g_free(str); } @@ -76,6 +82,10 @@ void ColorEntry::on_changed() void ColorEntry::_onColorChanged() { + if (_updatingrgba) { + return; + } + SPColor color = _color.color(); gdouble alpha = _color.alpha(); diff --git a/src/ui/widget/color-entry.h b/src/ui/widget/color-entry.h index cd7d6164a..edabe1980 100644 --- a/src/ui/widget/color-entry.h +++ b/src/ui/widget/color-entry.h @@ -34,6 +34,7 @@ private: sigc::connection _color_changed_connection; sigc::connection _color_dragged_connection; bool _updating; + bool _updatingrgba; }; } |
