Commit Graph

17 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
9fe130cd73 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Markus Reitböck
a72a0d6405 Gui: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:03 +02:00
wmayer
fa8978ce99 Gui: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
Abdullah Tahiri
d4eaf7a90b NotificationBox: Clang format 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
f0077e5f8a NotificationArea: Change Icon color to indicate missed notifications 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
1e3b728f35 NotificationBox: Add option to hide notification if reference widget is deactivated 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
2f8be2c77b NotificationBox: Enable options to not show if reference widget is not active and refactor restricttoarea 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
05dcc0bac8 NotificationBox: Hide notification if FreeCAD is deactivated 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
b04ef3a351 NotificationBox/NotificationArea: Restrict rendering area to main frame
========================================================================

The NotificationBox is extended to take the QRect in global coordinates. Then
it will try to dimension the label within this area. If a fixed width is provided, that
is enforced (take precedence).

The NotificationArea passes the QRect of the main window to the NotificationBox.

This is intended to fix:
https://github.com/FreeCAD/FreeCAD/issues/8940
2023-03-20 15:43:42 +01:00
Abdullah Tahiri
eb590aed5d NotificationBox: Allow to set a fixed notification width 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
c7e0aad548 NotificationBox: clang-format formatting 2023-03-12 06:06:29 +01:00
Abdullah Tahiri
1ba43102b1 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
2e2ea4f360 Gui: Fix use of undocumented init() function 2023-02-23 13:26:26 +01:00
Uwe
698f4916da [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
2f057e91fa [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
d7f4f060fb 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
8925399dbb 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