-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a rare issue in warning bar geometry
- Loading branch information
Showing
3 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Latest version: | ||
|
||
15 Aug 2023, V1.1.1 | ||
29 Aug 2023, V1.1.1 | ||
|
||
See "ChangeLog" for changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (C) Pedram Pourang (aka Tsu Jan) 2022 <[email protected]> | ||
* Copyright (C) Pedram Pourang (aka Tsu Jan) 2022-2023 <[email protected]> | ||
* | ||
* FeatherNotes is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
|
@@ -78,7 +78,7 @@ class WarningBar : public QWidget | |
|
||
if (parent) | ||
{ // compress the bar vertically and show it with animation | ||
QTimer::singleShot (anotherBar ? DURATION + 10 : 0, this, [=]() { | ||
QTimer::singleShot (anotherBar ? DURATION + 10 : 0, this, [this, parent]() { | ||
parent->installEventFilter (this); | ||
int h = grid_->minimumHeightForWidth (parent->width()) + grid_->contentsMargins().bottom(); | ||
QRect g (0, parent->height() - h, parent->width(), h); | ||
|
@@ -133,7 +133,17 @@ class WarningBar : public QWidget | |
if (QWidget *w = qobject_cast<QWidget*>(o)) | ||
{ | ||
if (w == parentWidget()) | ||
{ // compress the bar as far as its text is shown completely | ||
{ | ||
if (animation_) | ||
{ | ||
animation_->stop(); | ||
if (isClosing_) | ||
{ | ||
this->deleteLater(); | ||
return false; | ||
} | ||
} | ||
/* compress the bar as far as its text is shown completely */ | ||
int h = grid_->minimumHeightForWidth (w->width()) + grid_->contentsMargins().bottom(); | ||
setGeometry (QRect (0, w->height() - h, w->width(), h)); | ||
} | ||
|
@@ -157,7 +167,6 @@ public slots: | |
if (!isClosing_) | ||
{ | ||
isClosing_ = true; | ||
parentWidget()->removeEventFilter (this); // no movement on closing | ||
animation_->stop(); | ||
animation_->setStartValue (geometry()); | ||
animation_->setEndValue (QRect (0, parentWidget()->height(), parentWidget()->width(), 0)); | ||
|