summaryrefslogtreecommitdiff
path: root/silx/gui/plot/LegendSelector.py
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@debian.org>2017-11-25 16:55:20 +0100
committerPicca Frédéric-Emmanuel <picca@debian.org>2017-11-25 16:55:20 +0100
commite19c96eff0c310c06c4f268c8b80cb33bd08996f (patch)
treef2b4a365ed899be04766f3937bcc2d58d22be065 /silx/gui/plot/LegendSelector.py
parentbfa4dba15485b4192f8bbe13345e9658c97ecf76 (diff)
New upstream version 0.6.1+dfsg
Diffstat (limited to 'silx/gui/plot/LegendSelector.py')
-rw-r--r--silx/gui/plot/LegendSelector.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/silx/gui/plot/LegendSelector.py b/silx/gui/plot/LegendSelector.py
index 31bc3db..e9cfd1d 100644
--- a/silx/gui/plot/LegendSelector.py
+++ b/silx/gui/plot/LegendSelector.py
@@ -29,7 +29,7 @@ This widget is meant to work with :class:`PlotWindow`.
__authors__ = ["V.A. Sole", "T. Rueter", "T. Vincent"]
__license__ = "MIT"
-__data__ = "08/08/2016"
+__data__ = "16/10/2017"
import logging
@@ -971,9 +971,10 @@ class LegendsDockWidget(qt.QDockWidget):
def renameCurve(self, oldLegend, newLegend):
"""Change the name of a curve using remove and addCurve
- :param str oldLegend: The legend of the curve to be change
+ :param str oldLegend: The legend of the curve to be changed
:param str newLegend: The new legend of the curve
"""
+ is_active = self.plot.getActiveCurve(just_legend=True) == oldLegend
curve = self.plot.getCurve(oldLegend)
self.plot.remove(oldLegend, kind='curve')
self.plot.addCurve(curve.getXData(copy=False),
@@ -992,6 +993,8 @@ class LegendsDockWidget(qt.QDockWidget):
selectable=curve.isSelectable(),
fill=curve.isFill(),
resetzoom=False)
+ if is_active:
+ self.plot.setActiveCurve(newLegend)
def _legendSignalHandler(self, ddict):
"""Handles events from the LegendListView signal"""