Skip to content

Commit

Permalink
widget: Flash error/warning icon on mouse press anywhere in window
Browse files Browse the repository at this point in the history
  • Loading branch information
irgolic committed May 16, 2019
1 parent 06d478c commit 9e09094
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Orange/widgets/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
)
from AnyQt.QtCore import (
Qt, QObject, QEvent, QRect, QMargins, QByteArray, QDataStream, QBuffer,
QSettings, QUrl, QThread, pyqtSignal as Signal, QSize
)
QSettings, QUrl, QThread, pyqtSignal as Signal, QSize,
QPropertyAnimation)
from AnyQt.QtGui import QIcon, QKeySequence, QDesktopServices, QPainter

from Orange.data import FileFormat
Expand Down Expand Up @@ -827,6 +827,11 @@ def closeEvent(self, event):
self.__updateSavedGeometry()
QDialog.closeEvent(self, event)

def mousePressEvent(self, event):
""" Flash message bar icon on mouse press """
self.message_bar.anim.start(QPropertyAnimation.KeepWhenStopped)
event.ignore()

def setVisible(self, visible):
# type: (bool) -> None
"""Reimplemented from `QDialog.setVisible`."""
Expand Down

0 comments on commit 9e09094

Please sign in to comment.