Commit Graph

4443 Commits

Author SHA1 Message Date
wmayer
565cf73f1d Gui: send message events for zoom in/out commands to also support the image view 2023-03-22 16:03:14 +01:00
wmayer
63320c752b Gui: improve loading file by drag and drop 2023-03-22 16:02:28 +01:00
wmayer
a9bff40914 Gui: fix printing from ImageView 2023-03-22 15:47:25 +01:00
wmayer
965aeb4b6b Gui: add an image view 2023-03-22 15:45:38 +01:00
wmayer
77ecde6527 Core: use FileHandler in Application::sOpen and Application::sInsert 2023-03-22 15:14:45 +01:00
wmayer
f94f844142 Core: implement class FileHandler 2023-03-22 14:06:17 +01:00
wmayer
084f77f8be Core: move image plane to core system 2023-03-22 13:44:00 +01:00
Abdullah Tahiri
37eeccf705 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
wmayer
0e64e76514 Gui: fix some lint warnings 2023-03-19 03:19:49 +00:00
wmayer
3ed781ce1e Gui: solves #8939: timers are moved between non-QThreads
For more details see: https://github.com/FreeCAD/FreeCAD/issues/8939#issuecomment-1474888902
2023-03-18 22:41:48 +01:00
Paddle
13d175e891 Sketcher: Stylesheets: Taskbox buttons revert margin and padding. 2023-03-18 18:22:21 +01:00
Alexander Golubev
57f2f06fe2 Gui: add a tooltip about how to modify shortcuts into DlgKeyboard 2023-03-18 17:59:50 +01:00
Alexander Golubev
992dec2c6b Gui: Prevent UiLoader from loading 3rd-party Qt plugins.
Due to a flaw in the QUiLoader, UiLoader were loading all designer plugins
it can find in QApplication::libraryPaths(). This in general a bad
practice and leads to bugs due to some plugins may perform some unexpected
actions upon load which may interfere with FreeCAD's functionality.

To avoid such problems reset the libraryPaths before creation of a
UiLoader object.

Also move setLanguageChangeEnabled(true) into constructor due to it's
called every time it's being instanced anyway.

See: https://github.com/FreeCAD/FreeCAD/issues/8708
2023-03-18 17:59:50 +01:00
Abdullah Tahiri
45401e30ce Notifications: Extend translated notification to include caption
===============================================================

For translated notifications now the caption is included in the
message, as the translation is already done, and this improves
the semantics of existing messages.
2023-03-18 09:07:39 +01:00
wmayer
a1689319ce Gui: add missing include for Qt6 build 2023-03-18 00:08:40 +01:00
Paddle
697ca8cb1c Core: Add possibility to change the unit in the sizeLabel. 2023-03-17 14:04:24 +00:00
Abdullah Tahiri
24eb601fb0 NotificationArea: Preferences - width 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
f00e6d93dc NotificationArea: Convert plain text to HTML to perserve format 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
2de5076b74 NotificationArea: Use fixed size notifications 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
9920dff37a NotificationBox: Allow to set a fixed notification width 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
6376250ea7 NotificationArea: Allow wrapping of message text to avoid rendering issues with long messages 2023-03-17 11:29:30 +01:00
wmayer
da38f16320 Gui: set-up a logging category filter to suppress the most annoying Qt warnings 2023-03-16 20:40:00 +01:00
Paddle
9dfeccafd1 Sketcher: Stylesheet, fix manualUpdate button style. 2023-03-14 16:28:14 +01:00
Paddle
d09b1e1499 Sketcher: Solver Message simplification 2023-03-14 16:28:14 +01:00
Adrian Insaurralde Avalos
0b2a2a8cf7 fix #8847 sketcher dialog tool buttons bad styling 2023-03-14 13:32:21 +01:00
wmayer
ac2c09b487 Gui: [skip ci] fix whitespaces 2023-03-13 22:38:54 +01:00
Syres916
8a7945c9f2 [Gui] Add TODO reference hack 2023-03-13 22:34:58 +01:00
Syres916
322c1e4ddb [Gui] Improve comments regarding move of widget 2023-03-13 22:34:58 +01:00
Syres916
48ca8d5269 [Gui] Fix regressions from PR7771...
specifically 7458912b33 fixes #7965 #8440
2023-03-13 22:34:58 +01:00
Ronny Standtke
b44f82f0f6 use standard Close button for consistency with other task dialogs 2023-03-13 11:56:27 -05:00
Abdullah Tahiri
492c941395 Gui: Notifications - Convenience functions to send intrusive/non-intrusive notifications
========================================================================================

Functions to transparently send errors, warnings, notifications and translatednotifications, either
as intrusive messages (modal pop-up QMessageBox style) or as non-intrusive messages (notificationarea),
depending on the preferences of the user.

It is intended to substitute calls to QMessageBox with these functions in WBs, including the Sketcher WB.

Example:

QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
                      QObject::tr("Cannot add a constraint between two external geometries."));

Can be rewritten as:

 Gui::TranslatedNotification(obj,
               QObject::tr("Wrong selection"),
               QObject::tr("Cannot add a constraint between two external geometries."));

or

 Gui::TranslatedNotification("Sketcher",
               QObject::tr("Wrong selection"),
               QObject::tr("Cannot add a constraint between two external geometries."));

where the first parameter (obj or "Sketcher") is the notifier string. If obj is an App::DocumentObject
(or a derived class of it), internally the function transparently calls getFullLabel() to get the notifier
string.
2023-03-12 18:44:55 +01:00
wmayer
c8c9f42ae8 MSVC: fix compiler warnings about redefined pre-processor directives
Swapping the order of Qt and Inventor headers fixes them because the latter uses #ifdef/#endif guards
2023-03-12 16:17:38 +01:00
wmayer
8457037f17 clang: fix -Wdeprecated-declarations 2023-03-12 15:05:21 +01:00
wmayer
580b775690 clang: fix -Wunused-parameter, -Wunused-variable, -Wswitch 2023-03-12 15:05:21 +01:00
Abdullah Tahiri
d43f4cd26b Gui: Preference Page for NotificationArea
=========================================

Configuration preference page for controlling the notification area (non-intrusive messages and widget).
2023-03-12 06:06:29 +01:00
Abdullah Tahiri
eb7bf5d977 Gui: Remove old signal for critical messages in favour of Notification Area
===========================================================================

The former system of autoclosing messageboxes is removed in favour of the Notification Area.
2023-03-12 06:06:29 +01:00
Abdullah Tahiri
b27bd2b4b5 Gui: Add Notification Area to Status bar
========================================

Parameter "NotificationAreaEnabled" can be used to completely disable the Notification Area.

If disabled it won't appear on the UI at all and no non-intrusive notification will be generated.
2023-03-12 06:06:29 +01:00
Abdullah Tahiri
60cb06e20c Gui: Notification Area
======================

A notification area consisting of one area for non-intrusive notifications, and a widget showing previous
errors, warnings, critical messages and notifications.

Notifications being marked with QT_TRANSLATION_NOOP with context "Notifications" are translated.

Messages are shown during a minimum show time, unless pop up (clicked inside). Messages stay until
a maximum show time. Between the minimum and the maximum show times left mouse button events make
the non-intrusive notification disappear.

The widget stores a configurable amount of messages after which old messages are removed to make room for
new ones.

Unread messages are shown in bold.
2023-03-12 06:06:29 +01:00
Abdullah Tahiri
a35374d12e Gui: New Icon for Notification Area
Gui: Icon resources - Warning icon

Gui: Icons - squash
2023-03-12 06:06:29 +01:00
Abdullah Tahiri
63f3bdaf77 Base: Observer - fix template instantiation
===========================================

Merit goes to Werner for figuring out the issue and proposing a MSVC/MSYS2 viable solution:
https://github.com/FreeCAD/FreeCAD/pull/8781#issuecomment-1464898566
2023-03-12 06:06:29 +01:00
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
Uwe
fff0f535dd [Gui] fix bug on restoring PrefColorButton
- onRestore did not read in transparencies because App::Color::fromPackedRGB was used instead of App::Color::fromPackedRGBA
2023-03-11 15:49:59 +01:00
Syres916
e0211a5abd [Gui] Fix display names of Recent Macros 2023-03-09 15:08:35 +01:00
Uwe
74388badff [Gui] [skip ci] improve new icon
- remove the Python logo in it (not visible in this size and can be license issue in future)
- save as plain SVG
2023-03-09 15:04:54 +01:00
Syres916
5abe450b0c [Gui] Add an icon for Std_RecentMacros command (#8793)
* [Gui] Add Std_RecentMacros.svg icon
* [Gui] Add Std_RecentMacros icon
* [Gui] Add icon to Std_RecentMacros command
2023-03-09 14:55:30 +01:00
wmayer
b7b8113824 Gui: fixes #8501: FreeCAD crashes when constraining a sketch with an expression containing . (dot) 2023-03-09 12:45:16 +01:00
wmayer
f70bf280c6 Gui: fix possibly garbled toolbars and menus
See also Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986821
For now enable this line only for Windows builds
2023-03-09 12:44:45 +01:00
wmayer
4cf705b9d8 Gui: check for more ExpressionBinding types 2023-03-09 12:43:44 +01:00
wmayer
0efab730c1 Gui: split icon handling from ExpressionBinding 2023-03-09 12:43:44 +01:00