]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Adding the modification of the zorder to the toggleHighlight for Barplots
authorjh777916 <juba.hamma@cea.fr>
Fri, 8 Sep 2023 13:46:53 +0000 (15:46 +0200)
committerjh777916 <juba.hamma@cea.fr>
Fri, 8 Sep 2023 13:46:53 +0000 (15:46 +0200)
tools/CurvePlot/src/python/views/BarView.py

index 187af9b1470b9a77599a294b2c263cfdf47b6d2e..47125c92523aac51f27aafccc545fd428faf5344 100644 (file)
@@ -32,6 +32,7 @@ class BarView(View):
     self._initialLineWidth = None
     self._initialEdgeColorBar = None
     self._initialAlpha = None
+    self._initialZOrder = None
     self._parentXYView = parentXYView
     
     self._facecolor = None
@@ -57,11 +58,8 @@ class BarView(View):
     self._initialLineWidth = 0. #self._mplBars[0].get_linewidth()
     self._initialEdgeColorBar = self._mplBars[0].get_edgecolor()
     self._initialAlpha = self._mplBars[0].get_alpha()
+    self._initialZOrder = self._mplBars[0].get_zorder()
 
-    # Logger.Debug(" > Bar initial lw    : {}".format(self._initialLineWidth))
-    # Logger.Debug(" > Bar initial ec    : {}".format(self._initialEdgeColorBar))
-    # Logger.Debug(" > Bar initial alpha : {}".format(self._initialAlpha))
-  
   def onCurveTitleChange(self):
     if self._mplBars is None:
       return
@@ -87,12 +85,14 @@ class BarView(View):
         rect.set_linewidth(1.)
         rect.set_alpha(1)
         rect.set_edgecolor("crimson")
+        rect.set_zorder(1000)
       self._isHighlighted = True
     elif not highlight and (force or self._isHighlighted):
       for rect in bar : 
         rect.set_linewidth(self._initialLineWidth)
         rect.set_alpha(self._initialAlpha)
         rect.set_edgecolor(self._initialEdgeColorBar)
+        rect.set_zorder(self._initialZOrder)
       self._isHighlighted = False
     else:
       # Nothing to do, already the correct state