mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-22 13:02:10 -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
3 changed files with 26 additions and 2 deletions
|
@ -36,6 +36,11 @@ MessageWidget::MessageWidget(QWidget* parent)
|
||||||
connect(this, SIGNAL(hideAnimationFinished()), m_autoHideTimer, SLOT(stop()));
|
connect(this, SIGNAL(hideAnimationFinished()), m_autoHideTimer, SLOT(stop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MessageWidget::setAnimate(bool state)
|
||||||
|
{
|
||||||
|
m_animate = state;
|
||||||
|
}
|
||||||
|
|
||||||
int MessageWidget::autoHideTimeout() const
|
int MessageWidget::autoHideTimeout() const
|
||||||
{
|
{
|
||||||
return m_autoHideTimeout;
|
return m_autoHideTimeout;
|
||||||
|
@ -50,8 +55,15 @@ void MessageWidget::showMessage(const QString& text, KMessageWidget::MessageType
|
||||||
{
|
{
|
||||||
setMessageType(type);
|
setMessageType(type);
|
||||||
setText(text);
|
setText(text);
|
||||||
|
|
||||||
emit showAnimationStarted();
|
emit showAnimationStarted();
|
||||||
animatedShow();
|
if (m_animate) {
|
||||||
|
animatedShow();
|
||||||
|
} else {
|
||||||
|
show();
|
||||||
|
emit showAnimationFinished();
|
||||||
|
}
|
||||||
|
|
||||||
if (autoHideTimeout > 0) {
|
if (autoHideTimeout > 0) {
|
||||||
m_autoHideTimer->start(autoHideTimeout);
|
m_autoHideTimer->start(autoHideTimeout);
|
||||||
} else {
|
} else {
|
||||||
|
@ -61,7 +73,14 @@ void MessageWidget::showMessage(const QString& text, KMessageWidget::MessageType
|
||||||
|
|
||||||
void MessageWidget::hideMessage()
|
void MessageWidget::hideMessage()
|
||||||
{
|
{
|
||||||
animatedHide();
|
emit hideAnimationStarted();
|
||||||
|
if (m_animate) {
|
||||||
|
animatedHide();
|
||||||
|
} else {
|
||||||
|
hide();
|
||||||
|
emit hideAnimationFinished();
|
||||||
|
}
|
||||||
|
|
||||||
m_autoHideTimer->stop();
|
m_autoHideTimer->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,11 @@ public:
|
||||||
static const int LongAutoHideTimeout;
|
static const int LongAutoHideTimeout;
|
||||||
static const int DisableAutoHide;
|
static const int DisableAutoHide;
|
||||||
|
|
||||||
|
void setAnimate(bool state);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void showAnimationStarted();
|
void showAnimationStarted();
|
||||||
|
void hideAnimationStarted();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void showMessage(const QString& text, MessageWidget::MessageType type);
|
void showMessage(const QString& text, MessageWidget::MessageType type);
|
||||||
|
@ -49,6 +52,7 @@ public slots:
|
||||||
private:
|
private:
|
||||||
QTimer* m_autoHideTimer;
|
QTimer* m_autoHideTimer;
|
||||||
int m_autoHideTimeout;
|
int m_autoHideTimeout;
|
||||||
|
bool m_animate;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MESSAGEWIDGET_H
|
#endif // MESSAGEWIDGET_H
|
||||||
|
|
|
@ -39,6 +39,7 @@ EditGroupWidgetKeeShare::EditGroupWidgetKeeShare(QWidget* parent)
|
||||||
m_ui->messageWidget->hide();
|
m_ui->messageWidget->hide();
|
||||||
m_ui->messageWidget->setCloseButtonVisible(false);
|
m_ui->messageWidget->setCloseButtonVisible(false);
|
||||||
m_ui->messageWidget->setAutoHideTimeout(-1);
|
m_ui->messageWidget->setAutoHideTimeout(-1);
|
||||||
|
m_ui->messageWidget->setAnimate(false);
|
||||||
|
|
||||||
m_ui->passwordEdit->enablePasswordGenerator();
|
m_ui->passwordEdit->enablePasswordGenerator();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue