Commit Graph

110 Commits

Author SHA1 Message Date
wmayer
a61baf0594 Core: Use ModuleIO in RecentFilesAction & RecentMacrosAction 2024-10-15 14:06:09 +02:00
Kacper Donat
953bed50d2 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
4d5a9fc86e Gui: Fix memory leak 2024-05-17 15:54:08 +02:00
Kacper Donat
52560ce650 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
75d43f8607 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
b00a4384bf 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
5d3de598e7 Core: Introduce Tab-Bar workbench selector 2024-04-01 10:35:53 -05:00
luzpaz
65cdbe3e89 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
34c85e26da 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
a9a25eae69 Gui: Do not add non-existing files to open recent menu 2023-11-13 14:03:36 -03:00
wmayer
948cbfccd9 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
52e1c7c33b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Paddle
34eb609415 Move all the preference pages to PreferencePages subfolder. 2023-08-08 11:12:48 +02:00
wmayer
ec73caa40e modernize C++: make unique 2023-08-07 19:51:30 -06:00
wmayer
7d0926d0b3 Qt6 port:
Fix deprecation warnings with version 6.3 or 6.4
2023-08-04 21:23:14 -06:00
luzpaz
ec397d957a 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
03b9b5742f [skip-ci] Fix #9775 - incorrect pref. path on hint 2023-06-25 14:54:03 -04:00
Paddle
fd8f919564 Wb group fixes 2023-05-22 15:21:40 +02:00
Paddle
36e59562cf Core: WorkbenchComboBox and WorkbenchGroup simplification. 2023-05-22 10:13:13 +02:00
Paddle
dbd65e2b37 Pref: wb: change to disabled + ordered lists. 2023-03-31 14:12:27 +02:00
Paddle
3ef64e6849 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
255270b21f Preference: Replace the name LazyLoaded by Workbenches. 2023-03-28 11:59:32 +02:00
Paddle
801afd0eeb Preferences: Workbench : Replace the functions used to retrieve the list of enabled wb 2023-03-28 11:59:32 +02:00
Syres916
2a1438be59 [Gui] Fix display names of Recent Macros 2023-03-09 15:08:35 +01:00
Syres916
1ad4eef455 [Gui] Recent macros, improve wording of Hint msg 2023-03-03 20:29:38 -06:00
Syres916
858a1d23a3 [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
93f646ff25 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
498e774e68 Gui: fix removing item from recent files list 2023-02-16 00:06:33 +01:00
0penBrain
5429aeef3f Gui: ActionGroup also get its tooltip title updated 2022-11-21 04:06:20 +01:00
wmayer
5166ca54c0 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
aa0465e162 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
90ddd187f5 Gui: fix some clang-tidy warnings:
* readability-braces-around-statements
2022-11-13 17:42:08 +01:00
wmayer
25ee791786 Gui: [skip ci] fix some clang-tidy warnings:
* cppcoreguidelines-non-private-member-variables-in-classes
2022-11-13 17:16:03 +01:00
wmayer
e0bf6d48d5 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
7f104b077b Gui: fix readability-identifier-length 2022-11-12 23:57:14 +01:00
wmayer
e470bdc018 Gui: replace old-style with new-style connect 2022-11-12 21:57:26 +01:00
wmayer
3eaad09ed1 Gui: implement WorkbenchSwitcher class to encapsulate the parameter details 2022-11-11 22:53:02 +01:00
wmayer
e6a8533fa8 Gui: simplify code to handle workbench selector
+ replace three boolean parameters with a single string parameter
+ refactor DlgGeneralImp::saveSettings/loadSettings
+ handle visibility of corner widgets
2022-11-11 22:53:02 +01:00
wmayer
2e1feaa78e Gui: [skip ci] fix several warnings reported by GH actions 2022-11-11 22:53:02 +01:00
wmayer
5bf7199804 Gui: replace old-style connect() with new-style 2022-11-11 22:53:02 +01:00
wmayer
439a2c65cf Gui: don't use '_tooltip' as argument name because it's already used for a class member 2022-11-11 01:25:33 +01:00
wmayer
6e6e42f696 Gui: [skip ci] fix several warnings reported by GH actions 2022-11-10 23:52:29 +01:00
Zheng, Lei
2138189f8e Gui: do not remove ending puncuation when clean action title 2022-11-10 23:20:18 +01:00
Zheng, Lei
028c30e56d Gui: move CommandCompleter into its own source file 2022-11-10 23:20:18 +01:00
Zheng, Lei
0a37a85ea2 Minor code change according to suggestions 2022-11-10 23:20:18 +01:00
Zheng, Lei
063ad7a5f0 Gui: fix action title processing 2022-11-10 23:20:18 +01:00
Zheng, Lei
775452cbc0 Gui: add ShortcutManager to unify shortcut handling
Support longest key sequence match with user defined delay (configurable
through 'Customize -> Keyboard -> Key sequence delay').

Support user defined priority to resolve shortcut conflict through
'Customize -> Keyboard')

Add 'All' category in 'Customize -> Keyboard' to list all command and
showing their shortcuts

Unify macro command shortcut setting (BaseApp/Preferences/Shortcut).
2022-11-10 23:20:18 +01:00
Paddle
c87c4bbd9f Gui: Add setting enabling workbench selector to be on the menubar. Restart required. 2022-11-07 11:57:53 -05:00
wmayer
fac648fff5 Qt6 port:
* Explicitly include some missing headers
* Use 'static const char*' for XPM icon
* Skip template parameters for qMakePair
* Constructor of QFileInfo is marked as 'explicit' now
* QString::fromLatin1() also accepts a QByteArray
* QDateTime::fromTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::fromSecsSinceEpoch()
* QDateTime::toTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::toSecsSinceEpoch()
* QApplication::globalStrut() is deprecated. Don't use it any more.
* QWidget::isTopLevel() is deprecated, use QWidget::isWindow()
2022-11-02 15:16:41 +01:00
marioalexis
ff1b4eff05 Gui: Replace C cast 2022-09-18 11:06:51 -05:00