Commit Graph

6394 Commits

Author SHA1 Message Date
Benjamin Nauck
69eea91c8f Merge pull request #21749 from kadet1090/qss-aware-checkbox-property-panel 2025-06-04 12:31:49 +02:00
Chris Hennes
272c3034b4 Merge pull request #21659 from 3x380V/gui_fixes
Gui: random fixes
2025-06-03 19:23:21 -05:00
Kacper Donat
aafc7c1ba6 Gui: Ensure width and height of QAbstractView checkboxes 2025-06-03 23:43:39 +02:00
wmayer
83f4029277 Gui: Implement validator for ExpressionLineEdit
As requested in issue 21426 a leading '=' shouldn't be allowed in the edit field. The validator now explicitly disallows a leading
'=' in the text. In the future the validator can be extended.

This fixes issue 21426
2025-06-03 16:11:48 -05:00
Kacper Donat
0d14ad4936 Gui: Make checkbox in the property view QSS aware 2025-06-03 23:07:23 +02:00
Alfredo Monclus
9fabeae75c Gui: Property editor use a checkbox instead of a combobox for booleans (#21555)
* Gui: property-editor add property copy context menu

* Gui: Property editor checkbox brighter border

* Gui: Property editor refactor optimize

* Gui: Property editor checkbox react to first click and add label

* Gui: Property editor remove auto-inserted include

* Gui: property-checkbox fix not painting the grid
2025-06-03 21:05:30 +02:00
Brad Eric Hollister
4dff82f7a3 proposed fix for https://https://github.com/FreeCAD/FreeCAD/issues/20856github.com/FreeCAD/FreeCAD/issues/20856. NOTE: AddonManager and Telemetry addon ui files are in separate repos 2025-06-03 09:37:22 +02:00
julian1
f5db34501c fix #10514
Update src/Gui/PreferencePages/DlgSettingsEditor.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

Update src/Gui/PreferencePages/DlgSettingsEditor.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-06-03 00:12:58 -05:00
tetektoza
9b40afea7a Sketcher: Do not allow mouse interruption while entering dimension (#20925)
* Sketcher: Do not allow mouse interruption while entering dimensions

So, currently user has an option to enter dimensions to different
Sketcher elements like circle, line, or hexagon, whatever else. But, if
they move mouse during entering of those parameters, they are gone.

This is because we are currently allowing for constant
`QAbstractSpinBox` value change during mouse move, it stops changing
ONLY AFTER value is being set (user enters number and presses ENTER
or TAB).

So, this patch introduces one more state for `EditableDatumLabel` which
is `hasFinishedEditing` which is being triggered by ENTER or TAB key,
and still keeping old `isSet` state, which disallows mouse movement
disruption and dynamically updates the edited element on viewport.
This means, that all objects now wait for `hasFinishedEditing` state to
actually finish editing.

* Sketcher: Avoid out of boundary access by checking onViewParameters size

* Sketcher: Add missing Qt headers for CI

* Sketcher: Allow using TAB to switch between labels without accepting

* Sketcher: Change to or statement, so enter will accept both labels

* Sketcher: Apply review comments

* used casting directly in if statement and auto to keep linter happy
* added comments for flags used for describing EditableDatumLabel states
2025-06-02 22:18:42 +02:00
Chris Hennes
d13993d37c Merge pull request #21679 from 3x380V/fix_20859
Gui: Fix TreeWidget::addDependentToSelection
2025-06-02 11:26:20 -05:00
Chris Hennes
8805528e39 Merge pull request #21712 from yorikvanhavre/translations
Translations
2025-06-02 09:31:21 -05:00
Alfredo Monclus
cfb31e6850 Gui: Property editor combobox fix not popping up if the user canceled (#21688)
* Gui: Property editor combobox fix not popping up if the user canceled the popup and then try to open it again

fixes #21675

* Update src/Gui/propertyeditor/PropertyItemDelegate.cpp

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-06-02 10:40:08 +00:00
matthiasdanner
187f1b647f Sketcher: Fix Arrow Direction of Angle Arrows (#21645)
* Fix Arrow Direction of Angle Arrows

* Fix huge Space of angle box in negative angles

* Swap the direction vectors for the arrows
2025-06-02 12:22:24 +02:00
Yorik van Havre
94144ecd99 Translations: Merged crowdin translations 2025-06-02 11:48:26 +02:00
Yorik van Havre
bba4a7b990 Translations: updated ts files 2025-06-02 11:07:28 +02:00
wmayer
1307a53608 Gui: Fix TreeWidget::addDependentToSelection
Avoid stack overflow for cyclic dependencies.

This fixes issue 20859
2025-05-31 19:41:50 +02:00
Ladislav Michl
9574703b9c Revert "[Gui] Fix "Select dependent objects" with cycles"
This reverts commit 01effaaab0.
2025-05-31 19:39:11 +02:00
tarman3
239a05b242 command to open folder with macros 2025-05-30 20:02:58 +02:00
wmayer
40f29fe318 Gui: Show date & time in locale specific format 2025-05-30 18:04:33 +02:00
wmayer
d681c54338 Gui: Improve DlgAddPropertyVarSet
* Give user a hint about the reason of an invalid name. Fixes issue 21111
* Fix isTypeValid() to check for valid property type
2025-05-30 18:04:33 +02:00
wmayer
19925ac1be Gui: In DockWindowItems::addDockWidget replace the booleans with the enum class DockWindowOptions 2025-05-30 18:04:33 +02:00
wmayer
29274c1f35 Gui: Improve auto-saving
Handle possibly raised exceptions in RecoveryRunnable::run().
Since the run() method is executed within the context of a worker
thread all exceptions must be handled before returning to Qt
Concurrent as otherwise the application will be terminated.

For testing purposes load the corrupted project file from this forum
thread https://forum.freecad.org/viewtopic.php?p=823608#p823608
and wait for the auto-saving.
2025-05-30 18:04:33 +02:00
wmayer
8b1df6f00f Gui: Move define HAS_QTBUG_129596 to separate header file 2025-05-30 18:04:33 +02:00
wmayer
a6234f2ee3 Gui: Fix crash in ~PythonBaseWorkbench with Python 3.12 2025-05-30 18:04:33 +02:00
wmayer
f5bfc10c81 Gui: avoid code duplication in PythonEditor 2025-05-30 18:04:33 +02:00
wmayer
5d11b2938f Gui: Replace calls of FCMD_SET_EDIT with Gui::cmdSetEdit 2025-05-30 18:04:33 +02:00
wmayer
ce6641cb81 Gui: Handle exception when trying to start editing an object 2025-05-30 18:04:33 +02:00
wmayer
d6a62e4fa4 Gui: Fix crash in Command::keySequenceToAccel
If FreeCAD is loaded without GUI it isn't allowed to access the
QKeySequence class as it will cause a crash. So, it checks
beforehand if QApplication::instance() is null.

This fixes issue 16407
2025-05-30 18:04:33 +02:00
wmayer
0efd60b654 Gui: Improve document recovery
When checking for recovery files also check for validity of the
actual project file. In case it's broken but has a never date
then still process the recovery file.

This is done to reduce the chance of data loss as described in
issue 18044
2025-05-30 18:04:33 +02:00
wmayer
cafd4a4fc3 Gui: Use QDialogButtonBox in DlgExpressionInput
This way the order of buttons is more consistent than using
separate QPushButtons.

This fixes issue 19902
2025-05-30 18:04:33 +02:00
wmayer
8de63825cf Gui: Fix stackoverflow when loading corrupted file
If an object has a link to itself it may cause a stackoverflow
in several cases:
* If the method claimChildren3D() returns a list containing the
  object of the view provider then Document::handleChildren3D()
  will add a SoGroup to itself as a child. This will result into
  a stackoverflow as soon as an action traverses the scene.
* If the method claimChildren() returns a list containing the
  object of the view provider then DocumentItem::createNewItem()
  causes an infinite loop with DocumentItem::populateItem()

Solution:
* Inside Document::handleChildren3D() avoid to add a SoGroup to itself
* In this specific case fix ViewProviderCoordinateSystem::claimChildren()
  to avoid a cyclic dependency

Hint: Since PR 18126 FreeCAD is vulnerable for this problem.

This fixes issue 19682
2025-05-30 18:04:33 +02:00
wmayer
ca49788ab6 Gui: Fix crash when trying to transform link object
This is a regression caused by PR 17564.

ViewProviderDragger has the member 'forwardedViewProvider' that is used
to handle the editing by the parent object. This means that inside
ViewProviderLink::startEditing 'transformDragger' can be null but this
isn't checked so that accessing the member causes a segmentation fault
or a failing assert in debug mode, respectively.

Solution:
Make sure that transformDragger is not null before accessing it.

This fixes 19542.
2025-05-30 18:04:33 +02:00
wmayer
be40c28912 Gui: Fix command StdCmdProperties
The command is only able to show the property view in case it's
invisible. But it fails to raise the widget. And if in the preferences
'Combined' mode is set it fails completely.

Solution:
The method DockWindowManager::activate already does everything what's
needed. Now the command only must be changed to access the right
docked widget.
2025-05-30 18:04:33 +02:00
wmayer
fd9c10c1c0 Gui: Make AccelLineEdit a subclass of QKeySequenceEdit
The class QKeySequenceEdit already implements the relevant
functionality and properly handles shortcuts using the Shift key.

This fixes issue 19320
2025-05-30 18:04:33 +02:00
wmayer
de14c1e067 Gui: Do not round color values set in property editor
Do not use the number of decimals from the user settings to pass
the material to the property as this will cause some unexpected
rounding effects.

This fixes issue 19048
2025-05-30 14:21:53 +02:00
wmayer
820c06fe03 Gui: Fix DlgPreferencesImp::minimumDialogWidth() to return a reasonable width
The current implementation always returns a width that is too small
so that a scrollbar is shown. Especially on the General page this is
unfortunate as some important controls are truncated or completely
hidden.

Another problem of this implementation is that when loading a not
yet loaded workbench in the 'Available workbenches' page then the
computed size will be by far too high leading to a dialog that all
the sudden covers most of the screen.

Solution:
The correct width is the sum of:
width of the tree view + width of the biggest page + spacing of the layout
This fixes both of the above problems.
2025-05-30 14:21:53 +02:00
wmayer
1926c1f1b9 Gui: Fix several methods in Workbench to list all items
* Fix Workbench::listToolbars() to also return custom toolbars or added by a manipulator
* Fix Workbench::getToolbarItems() to also return custom toolbars or added by a manipulator
* Fix Workbench::listMenus() to also return menus added by a manipulator

Fixes issue 18647
2025-05-30 14:21:53 +02:00
wmayer
31bbd50fb0 Gui: Adjust transform dragger after undo/redo
When performing undo/redo after tansforming an object it flips back
to its original position but the dragger does not.

This commit set the dragger's placement to the object placement.

Fixes issue 18914
2025-05-30 14:21:53 +02:00
wmayer
9bf621657b Gui: Fix undo/redo behaviour in transformation tool
If the user clicks on undo while the transformation dialog is
open the currently active transaction will be closed.
From now on any change of the placement won't be recorded any
more so that e.g. canceling the dialog or an undo after
accepting the dialog leads to unexpected behaviour.

To fix the issue two new virtual methods onUndo() and onRedo()
are added to TaskDialog and reimplemented in TaskTransformDialog.
These functions make sure to open a new transaction.

This fixes issue 19152
2025-05-30 14:21:53 +02:00
wmayer
9e1d85ebd2 Gui: Use Py::SmartPtr instead of raw pointer
Using the raw pointer may result into a crash in case the Python
object is accessed by the interpreter after the NavigationStyle
has been destroyed.
2025-05-30 14:21:53 +02: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
Alfredo Monclus
4e387e3ff3 Gui: property-editor open the combo directly and apply after selection
Previously you had to make 4 clicks to apply a combo
1 to enter edit, 1 to open the combo, 1 to select, and 1 to defocus and apply

with this commit only 2 clicks:
1 to open the combo and 1 to select
2025-05-29 22:41:37 +02:00
Alfredo Monclus
e7882427e7 Gui: property-editor add property copy context menu 2025-05-29 22:40:59 +02:00
Alfredo Monclus
cb290a2396 Gui: property-editor fix text not showing due to stylesheets 2025-05-29 15:01:11 +02:00
Benjamin Nauck
eb51a5d784 Merge pull request #21379 from alfrix/set_style
Gui: Set QStyle to Fusion if not set
2025-05-26 22:13:31 +02:00
Syres916
ef4c33fee4 [Gui] InputField correct icon visibility logic on opening a pre-completed task panel 2025-05-26 17:54:39 +02:00
Kacper Donat
d5a091bf0c Merge pull request #21571 from alfrix/property_editor_2
Gui: property editor do not enter edit mode if the property is read-only
2025-05-26 17:20:06 +02:00
Alfredo Monclus
1bb05bf987 Gui: property-editor make readonly cells look disabled 2025-05-26 07:13:44 -06:00
Alfredo Monclus
8be84f2a9f Gui: property editor do not enter edit mode if the property is read-only 2025-05-25 06:25:09 -06:00
Roy-043
819b1b9218 Typo in ViewProviderGeometryObject.cpp (#21517)
appearrance -> appearance
2025-05-22 11:04:10 +02:00