mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-27 20:36:49 -08:00
Ability to disable animation of message widget
* Allows for persistent messages that can change text without disturbing the user interface * Immediate improvement to KeeShare group edit window
This commit is contained in:
1 parent
7ef1ee916b
commit
730367557f
3 files changed
+26
-2
No files matched your search
@@ -36,6 +36,11 @@ MessageWidget::MessageWidget(QWidget* parent)
|
||||
connect(this, SIGNAL(hideAnimationFinished()), m_autoHideTimer, SLOT(stop()));
|
||||
}
|
||||
|
||||
void MessageWidget::setAnimate(bool state)
|
||||
{
|
||||
m_animate = state;
|
||||
}
|
||||
|
||||
int MessageWidget::autoHideTimeout() const
|
||||
{
|
||||
return m_autoHideTimeout;
|
||||
@@ -50,8 +55,15 @@ void MessageWidget::showMessage(const QString& text, KMessageWidget::MessageType
|
||||
{
|
||||
setMessageType(type);
|
||||
setText(text);
|
||||
|
||||
emit showAnimationStarted();
|
||||
animatedShow();
|
||||
if (m_animate) {
|
||||
animatedShow();
|
||||
} else {
|
||||
show();
|
||||
emit showAnimationFinished();
|
||||
}
|
||||
|
||||
if (autoHideTimeout > 0) {
|
||||
m_autoHideTimer->start(autoHideTimeout);
|
||||
} else {
|
||||
@@ -61,7 +73,14 @@ void MessageWidget::showMessage(const QString& text, KMessageWidget::MessageType
|
||||
|
||||
void MessageWidget::hideMessage()
|
||||
{
|
||||
animatedHide();
|
||||
emit hideAnimationStarted();
|
||||
if (m_animate) {
|
||||
animatedHide();
|
||||
} else {
|
||||
hide();
|
||||
emit hideAnimationFinished();
|
||||
}
|
||||
|
||||
m_autoHideTimer->stop();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user