Commit Graph

124 Commits

Author SHA1 Message Date
xtemp09
eb0c980c1d [GUI] Handle ampersand in windowTitle 2025-11-24 08:18:28 -06:00
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
matt-taylor-git
38785ddd96 Fix: Update tooltip for grouped commands (#24043)
When a command is part of a toolbar group, the tooltip for the group's button was not correctly updated with the shortcut of the selected command. This was happening because the tooltip generation was using the shortcut of the group itself, not the selected child command.

This commit fixes the issue by ensuring that the tooltip of the group action is updated with the full tooltip of the child action, which already contains the correct shortcut information. This is done in both 'ActionGroup::onActivated' (for when a new tool is selected) and 'ActionGroup::setCheckedAction' (for the initial default tool).
2025-09-19 15:20:39 +00:00
Markus Reitböck
6ef07bb358 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
Max Wilfinger
9fc40b33de Fix source string mistakes reported on Crowdin (#23157)
* Fix source string mistakes reported on Crowdin

* Update src/Mod/Draft/Resources/ui/TaskPanel_CircularArray.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/Resources/ui/TaskPanel_CircularArray.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftfunctions/upgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftfunctions/upgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftguitools/gui_downgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/Resources/ui/TaskPanel_SetStyle.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

---------

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-24 20:51:32 -05:00
Max Wilfinger
ecf02b7878 Gui: Update UI strings for consistency
Closes: #22135
2025-08-04 20:14:45 +02:00
xtemp09
d87b41181e Add "Clear Recent files list" item (#22638)
* Add "Clear Recent files" item

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-07-23 04:11:48 +00:00
tiagomscardoso
5dc523ec27 Gui: prevent hover tooltip from covering menu items (#22019)
* fix #21330: prevent hover tooltip from covering menu items
Instead of showing the tooltip at the mouse cursor,
it is now displayed to the right of the corresponding
menu option, avoiding overlap with the menu itself.

* Update src/Gui/Action.cpp

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-06-23 17:40:16 +00:00
wmayer
0ea02d60c1 Gui: Add Action::setBlockedChecked
Remove the second parameter of Action::setChecked and
provide Action::setBlockedChecked instead.
2025-05-30 14:21:53 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Ladislav Michl
c293d74566 Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Bræstrup Sayoc
f647d4a1eb Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
tritao
8aa50c4380 Gui: Reorganize the dialog files into a top Dialogs folder. 2025-01-24 16:28:02 -06:00
Snow Faerie
8bc062b6e8 Fix and add menu accelerators (#15532)
* Fix and add menu accelerators: menus common to all workbenches

I use menu accelerators fairly often, so I find it very frustrating when
they are missing, or worse, they don't work due to the same letter being
assigned to several commands.

This patch adds accelerators to lots of menu entries missing them and
fixes broken accelerators.

Wherever possible, standard accelerator keys are used:
https://doc.qt.io/qt-5/accelerators.html

This commit covers accelerator fixes that are common to all workbenches.
Accelerator fixes for specific workbenches will be done in separate
commits.

* Add missing accelerators: Spreadsheet workbench
2024-12-13 10:39:30 -06:00
wmayer
a4b555ea29 Core: Use ModuleIO in RecentFilesAction & RecentMacrosAction 2024-10-15 14:06:09 +02:00
Kacper Donat
46a84da571 Gui: Fix issue with missing icons in sketcher
This boiled down to conflict of using `data` attribute of the QAction in
ActionGroup and ToolBarManager. I reworked ActionGroup here to not use
the data attribute but this is not a proper solution - but it should be
working well enough.

Proper solution would be to leave the data for the specific usecases (like index)
and store the command name in some other place. It would however require
us to subclass the QAction which is not something that should be done so
late in the release cycle.
2024-08-25 19:40:25 -05:00
wmayer
e47f6af9d7 Gui: Fix memory leak 2024-05-17 15:54:08 +02:00
Kacper Donat
2e6af15880 Gui: Reuse QActions for workbench activation
This fixes segfault that can occour due to keeping reference to QAction
that is supposed to change workbench.
2024-05-12 19:05:14 +02:00
Kacper Donat
82f6b68307 Gui: Use RTL layout when Wb Tab Bar is placed in right corner
Right corner is placed to the right edge of screen, so its natural
growth occours on the left side. Basically it is Right to Left order and
so in that case the "end" is actually on left and so TabBar should grow
in that direction.

Unfortunately it is not possible to simply use RTL Qt feature to handle
that case as it would result in reverse order of workbenches (people will still
read it in LTR order) and icons on the right which is not wanted. That's
custom support is introduced.
2024-05-12 19:05:14 +02:00
Zheng Lei
c24ace7f73 Gui: support toolbar drag and drop to status bar and menu bar (#13571)
* Gui: support toolbar drag and drop to status bar and menu bar

Closes FreeCAD/FreeCAD#12979

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Gui: improve toolbar handling in status and menu bar

* Gui: fix workbench tab bar orientation in status or menu bar

* Gui: remove workbench toolbar position settings

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 17:59:16 +02:00
PaddleStroke
cd94350df0 Core: Introduce Tab-Bar workbench selector 2024-04-01 10:35:53 -05:00
luzpaz
5839134e95 Fix various typos throughout the codebase (#13029)
* Fix various typos throughout the codebase

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-18 16:54:30 -05:00
Kacper Donat
a8f0f5964e Gui: Allow ActionGroups to not remember choice
This is fix to issue mentioned in the #11717, on discord and forum that
for smart dimension tool the chosen tool should not be remembered. This
will ensure that the "smart" tool is always visible on the toolbar and
other tools are accessible in case that such explicit choice is needed.
2023-12-18 17:51:48 +01:00
tmksw
39f76dde67 Gui: Do not add non-existing files to open recent menu 2023-11-13 14:03:36 -03:00
wmayer
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Paddle
ccb9d7faeb Move all the preference pages to PreferencePages subfolder. 2023-08-08 11:12:48 +02:00
wmayer
0af4990817 modernize C++: make unique 2023-08-07 19:51:30 -06:00
wmayer
5621a0089f Qt6 port:
Fix deprecation warnings with version 6.3 or 6.4
2023-08-04 21:23:14 -06:00
luzpaz
090ae4571a Gui: Action.cpp minor code formatting tweak
Utilize the `+=` assignment operator for readability
2023-06-25 19:43:42 -04:00
Adrián Insaurralde Avalos
f25e765aa1 [skip-ci] Fix #9775 - incorrect pref. path on hint 2023-06-25 14:54:03 -04:00
Paddle
c3c5f491ef Wb group fixes 2023-05-22 15:21:40 +02:00
Paddle
f3d5b204d2 Core: WorkbenchComboBox and WorkbenchGroup simplification. 2023-05-22 10:13:13 +02:00
Paddle
4407387ab4 Pref: wb: change to disabled + ordered lists. 2023-03-31 14:12:27 +02:00
Paddle
996f4da123 Pref: wb: remove the list of disabled wb.
TODO: Addon Manager should add workbenches to the list of enabled wb on installation. And remove them from the list on uninstall.
TODO: Addon Manager 'disable mode' should be removed.
2023-03-31 14:12:27 +02:00
Paddle
4b60df5ced Preference: Replace the name LazyLoaded by Workbenches. 2023-03-28 11:59:32 +02:00
Paddle
d7efe5a616 Preferences: Workbench : Replace the functions used to retrieve the list of enabled wb 2023-03-28 11:59:32 +02:00
Syres916
e0211a5abd [Gui] Fix display names of Recent Macros 2023-03-09 15:08:35 +01:00
Syres916
5171079cc4 [Gui] Recent macros, improve wording of Hint msg 2023-03-03 20:29:38 -06:00
Syres916
6611f607b4 [Gui] Recent macros, enhance warning msg
See discussion : https://forum.freecadweb.org/viewtopic.php?f=3&t=75350
2023-03-03 20:29:38 -06:00
Abdullah Tahiri
5244e28565 Gui: ActionGroup - aboutToShow and aboutToHide
==============================================

ActionGroup may integrate a drop down menu (internally a QMenu).

QMenu has signals aboutToShow and aboutToHide, which are called just before showing/hiding the menu.

This commit extends ActionGroup by providing corresponding signals.

An ActionGroup can be added to more than one toolbar and thus creates more than one menu. So, it can theoretically
happen that you have opened a menu and click on another menu. For this reason, the menu is passed as argument:

void aboutToHideMenu(QMenu*);
void aboutToShowMenu(QMenu*);
2023-02-25 23:13:55 +01:00
wmayer
684e9fd425 Gui: fix removing item from recent files list 2023-02-16 00:06:33 +01:00
0penBrain
6e65e77915 Gui: ActionGroup also get its tooltip title updated 2022-11-21 04:06:20 +01:00
wmayer
4483c77530 Gui: MSVC requires a user-defined destructor of RecentFilesAction
otherwise the class declaration of Private is needed in the header file
2022-11-16 12:46:47 +01:00
wmayer
dacf04c835 Gui: fix some clang-tidy warnings:
* modernize-return-braced-init-list
* modernize-use-equals-default
* modernize-loop-convert
* readability-implicit-bool-conversion
* readability-named-parameter
2022-11-13 18:43:39 +01:00
wmayer
756e081a78 Gui: fix some clang-tidy warnings:
* readability-braces-around-statements
2022-11-13 17:42:08 +01:00
wmayer
904f92d747 Gui: [skip ci] fix some clang-tidy warnings:
* cppcoreguidelines-non-private-member-variables-in-classes
2022-11-13 17:16:03 +01:00
wmayer
bbb3697b77 Gui: [skip ci] fix some clang-tidy warnings:
* cppcoreguidelines-special-member-functions
* cppcoreguidelines-explicit-virtual-functions
* readability-inconsistent-declaration-parameter-name
2022-11-13 16:35:11 +01:00
wmayer
0679c40d26 Gui: fix readability-identifier-length 2022-11-12 23:57:14 +01:00
wmayer
182aa2ac4c Gui: replace old-style with new-style connect 2022-11-12 21:57:26 +01:00