Commit Graph

7 Commits

Author SHA1 Message Date
Abdullah Tahiri
77dc9bba1b NotificationBox: clang-format formatting 2023-03-12 06:06:29 +01:00
Abdullah Tahiri
cd79ea5994 NotificationBox: Fixes
======================

QToolTip removed the Windows specific behaviour of passing a screen widget as parent for QLabel
in 44fb925f50471ebc23dcccfaa4e9d9873b05d205. NotificationBox code is simplified not to use a
parent widget at all.

A inappropriate review fix actually causing a bug is fixed.

https://github.com/FreeCAD/FreeCAD/pull/8352#discussion_r1111342024
2023-03-12 06:06:29 +01:00
Chris Hennes
91d553139d Gui: Fix use of undocumented init() function 2023-02-23 13:26:26 +01:00
Uwe
585de7c8a0 [Gui] second hotfix for NotificationBox.cpp
- #include "PreCompiled.h" is missing, see https://github.com/FreeCAD/FreeCAD/pull/8536#issuecomment-1435782841

- also remove unused headers
2023-02-19 00:43:52 +01:00
Uwe
043b8cf2d6 [Gui] hotfix for NotificationBox.cpp
- master in uncompilable on Windows, see https://github.com/FreeCAD/FreeCAD/pull/8352#issuecomment-1435769625
 and we already got reports about this. Thus a hotfix for the meantime.

- (the formatting change was automatically done by MSVC according to our clang file)
2023-02-18 22:18:46 +01:00
Abdullah Tahiri
c98022e7fd Gui: NotificationBox - review changes
=====================================

Changes consquence of the review by OpenBrain:
- Use smart pointer for NotificationLabel (QT deleteLater compatible)
- Consistent use of measurement units in parameter naming.
- Consistent wording of code documentation.
- Improvements in branching of QTootTip based code.
- Remove redundant stop on singleshot qtimer.
- Improved filtering of click events.
2023-02-18 16:58:43 +01:00
Abdullah Tahiri
6532098308 Gui: NotificationBox - New non-intrusive auto-closing notification box
======================================================================

In short, a "tooltip" alike notification, where the user can continue working without having
to interact with the notification. If the user is interested in the notification, he or she can
stop to read it. If not interested, the user can ignore it and continue working. The notification
will automatically disappear when the timer lapses or before that time, as described below.

A new widget similar to QToolTip, to have a similar look and feel
and interface, while avoiding early closing on user action.

QToolTip is not intended for notifications, but to provide contextual help. While
QToolTip could have been used for part of the functionality (by filtering out events),
other parts required additional changes to the interface

Gui::NotificationBox is a reimplementation intended to provide user notifications. It
relies on the proven code of QToolTip for the wanted behaviour.

Additional functionality:
- A notification box has a minimum time for which it won't close, unless popped out (click inside
the notification).
- After the minimum time, if left mouse button is clicked (anywhere) it auto-closes, as it is
understood the user has continued working.
- After a maximum time, it will automatically close (even in nothing is clicked).
2023-02-18 16:58:43 +01:00