diff options
| author | Martin Owens <doctormo@gmail.com> | 2016-04-01 13:35:30 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2016-04-01 13:35:30 +0000 |
| commit | a6b3ec9cdaf7867d6b02da3122ab4c06bf2246a5 (patch) | |
| tree | 12dd215fa9e3e92be38e8f8bd4b073ee58bdcf66 /src/widgets/swatch-selector.cpp | |
| parent | Bug #1553497 Voronoi Extension: Delaunay triangulate can get fill color from ... (diff) | |
| download | inkscape-a6b3ec9cdaf7867d6b02da3122ab4c06bf2246a5.tar.gz inkscape-a6b3ec9cdaf7867d6b02da3122ab4c06bf2246a5.zip | |
Fix regression in swatch color selection and improve it by allowing drag to change the swatch color too.
Fixed bugs:
- https://launchpad.net/bugs/1564597
(bzr r14757)
Diffstat (limited to 'src/widgets/swatch-selector.cpp')
| -rw-r--r-- | src/widgets/swatch-selector.cpp | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/src/widgets/swatch-selector.cpp b/src/widgets/swatch-selector.cpp index 6f2807255..b9cce1d19 100644 --- a/src/widgets/swatch-selector.cpp +++ b/src/widgets/swatch-selector.cpp @@ -37,10 +37,11 @@ SwatchSelector::SwatchSelector() : color_selector->show(); pack_start(*color_selector); - _selected_color.signal_grabbed.connect(sigc::mem_fun(this, &SwatchSelector::_grabbedCb)); - _selected_color.signal_dragged.connect(sigc::mem_fun(this, &SwatchSelector::_draggedCb)); - _selected_color.signal_released.connect(sigc::mem_fun(this, &SwatchSelector::_releasedCb)); - _selected_color.signal_changed.connect(sigc::mem_fun(this, &SwatchSelector::_changedCb)); + //_selected_color.signal_grabbed.connect(sigc::mem_fun(this, &SwatchSelector::_grabbedCb)); + _selected_color.signal_dragged.connect(sigc::mem_fun(this, &SwatchSelector::_changedCb)); + _selected_color.signal_released.connect(sigc::mem_fun(this, &SwatchSelector::_changedCb)); + // signal_changed doesn't get called if updating shape with colour. + //_selected_color.signal_changed.connect(sigc::mem_fun(this, &SwatchSelector::_changedCb)); } SwatchSelector::~SwatchSelector() @@ -53,45 +54,6 @@ SPGradientSelector *SwatchSelector::getGradientSelector() return _gsel; } -void SwatchSelector::_grabbedCb() -{ -} - -void SwatchSelector::_draggedCb() -{ - // if (data) { - //SwatchSelector *swsel = reinterpret_cast<SwatchSelector*>(data); - - // TODO might have to block cycles - - // Copied from gradient-vector.cpp, but does not appear to cause visible changes: - /* - if (swsel->_gsel) { - SPGradient *gradient = swsel->_gsel->getVector(); - SPGradient *ngr = sp_gradient_ensure_vector_normalized(gradient); - if (ngr != gradient) { - // Our master gradient has changed - // TODO replace with proper - sp_gradient_vector_widget_load_gradient(GTK_WIDGET(swsel->_gsel), ngr); - } - - sp_gradient_ensure_vector(ngr); - - - SPStop* stop = ngr->getFirstStop(); - if (stop) { - swsel->_csel->base->getColorAlpha(stop->specified_color, &stop->opacity); - stop->currentColor = false; - // TODO push refresh - } - } - */ - // } -} - -void SwatchSelector::_releasedCb() -{ -} - void SwatchSelector::_changedCb() { if (_updating_color) { |
