Short background Color animation on scroll

When the tree selection changes, trigger a short animation of the
background color of the name-label of the selected module/parameter

Change-Id: Ia56619a7e73458a5ac63ef821b5ac7ab5f7451df
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/30651
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
This commit is contained in:
Alexander Zaft
2023-03-10 11:00:50 +01:00
parent aa43254b55
commit 81f9e89402
7 changed files with 96 additions and 22 deletions

View File

@@ -25,8 +25,8 @@ import json
from collections import OrderedDict
from frappy.gui.qt import QCursor, QFont, QFontMetrics, QIcon, QInputDialog, \
QMenu, QTextCursor, QVBoxLayout, QWidget, pyqtSignal, pyqtSlot, \
toHtmlEscaped
QMenu, QSettings, QTextCursor, QVBoxLayout, QWidget, pyqtSignal, \
pyqtSlot, toHtmlEscaped
from frappy.errors import SECoPError
from frappy.gui.moduleoverview import ModuleOverview
@@ -200,10 +200,13 @@ class NodeWidget(QWidget):
if module == '' and param == '':
return # for now, don't do anything when resetting selection
if param == '':
self.view.ensureWidgetVisible(self._modules[module])
widget = self._modules[module].moduleName
else:
pw = self._modules[module]._paramWidgets[param][0]
self.view.ensureWidgetVisible(pw)
widget = self._modules[module]._paramWidgets[param][0]
self.view.ensureWidgetVisible(widget)
settings = QSettings()
if settings.value('highlightanimation', True, bool):
widget.triggerAnimation()
def _treeContextMenu(self, pos):
index = self.tree.indexAt(pos)