mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04: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:
parent
7ef1ee916b
commit
730367557f
@ -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();
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,11 @@ public:
|
||||
static const int LongAutoHideTimeout;
|
||||
static const int DisableAutoHide;
|
||||
|
||||
void setAnimate(bool state);
|
||||
|
||||
signals:
|
||||
void showAnimationStarted();
|
||||
void hideAnimationStarted();
|
||||
|
||||
public slots:
|
||||
void showMessage(const QString& text, MessageWidget::MessageType type);
|
||||
@ -49,6 +52,7 @@ public slots:
|
||||
private:
|
||||
QTimer* m_autoHideTimer;
|
||||
int m_autoHideTimeout;
|
||||
bool m_animate;
|
||||
};
|
||||
|
||||
#endif // MESSAGEWIDGET_H
|
||||
|
@ -39,6 +39,7 @@ EditGroupWidgetKeeShare::EditGroupWidgetKeeShare(QWidget* parent)
|
||||
m_ui->messageWidget->hide();
|
||||
m_ui->messageWidget->setCloseButtonVisible(false);
|
||||
m_ui->messageWidget->setAutoHideTimeout(-1);
|
||||
m_ui->messageWidget->setAnimate(false);
|
||||
|
||||
m_ui->passwordEdit->enablePasswordGenerator();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user