* Gui: Fix property checkbox regression
* Update PropertyItemDelegate.cpp
* Gui: property checkbox: toggle with enter when it has focus
* [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>
* Gui: Add common types to Add Property dialog
Add a preselection of commonly used types in the Add Property dialog.
The dialog supports now all properties that have an editor. This
doesn't necessarily mean that the editor is shown in the Add Property
dialog; some properties should not show their editor in the Add Property
dialog, such as vector and placement.
* Gui: Make Add Property dialog Qt 6 compatible
This change stops using a Qt 6.10 feature and makes it compatible with
all of Qt 6.
* Update src/Gui/Dialogs/DlgAddProperty.cpp
---------
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
- The initial commit to block shortcuts in text edit fields
(particularly for MacOS, where those shortcuts would activate FreeCAD
functionality rather than text edit functionality) made a wrong
assumption.
- It assumed that there were no text edit fields where we would want to
actually use application shortcuts. In retrospect, this was very
wrong, and I completely missed the macro editor.
- For now, it should be fine to change the field to only cover
'LineEdit'. I cannot imagine a case where you'd want to (e.g.) save
text/document from a LineEdit, but if anyone knows of one then please
let me know.
- This does mean there are some quirks. For example in the materials
editor, the description is a TextEdit field. Some text editing
shortcuts won't work in here now (similar to how they didn't before
the original commit that I made).
- I've since learned that freecad also has a text editor functionality,
I've tested that now Cmd+S works for save as it should.
* Gui: Handle exception in showValidExpression
If an exception is raised inside showValidExpression() because the
expression cannot be evaluated then handle the exception and show it as
invalid expression.
This fixes issue: https://github.com/FreeCAD/FreeCAD/issues/26501
---------
Co-authored-by: wwmayer <wmayer@freecad.org>
Add Z offset for arrowheads and explicitly enable depth testing for
constraint lines in SoDatumLabel. This ensures constraint lines render
below geometry (respecting zConstr level) while text and arrowheads
render on top for better visibility and selection.
Sometimes when user would switch from editing one sketch to edit to another sketch by double clicking on the new sketch, without living the previous sketch, it would then render the text of constraints backward. This was happening because the unsetEdit of the previous sketch was clearing the selection and adding the old sketch as selected. Then the new setEdit was failing to find the correct editing placement resulting in backward text.
Since some time we have new stylesheets based on style parameters. For
compatibility reasons however old stylesheets were left in the project -
this commit removes them by reapplying the theme if old stylesheet is
detected.
* Gui: Add hidden anchor object to the root for transparency
Image planes with transparency failed to render correctly in empty scenes
because OpenInventor's two-pass transparency rendering requires at least
one opaque object to properly initialize the depth buffer.
The fix adds a zero-scaled cube with no material node (making it use
OpenGL's default opaque material) to each image plane's scene graph.
This hidden object:
- Acts as a depth buffer anchor for transparent rendering
- Is invisible (scaled to 0,0,0)
- Has negligible performance impact
This matches the workaround already used in the rotation center indicator
and resolves the issue where image transparency only worked when the
rotation center, grid, or other opaque objects were visible.
* Gui: Exclude hidden anchor from bounding box calculations
Prevents the hidden anchor from affecting "fit all" and other bounding box
operations by wrapping it in `SoSkipBoundingGroup`.
* Gui: Prevent whole-object highlight when picked list is enabled
Removed the logic that forced `onTop=1` when `needPickedList()` is true
in View3DInventorSelection. This was causing the entire object to be
highlighted instead of just the selected sub-element when the "Picked
object list" option was enabled.
* Part: Remove `needPickedList` mat override to prevent rendering artifact
The `needPickedList` check in `SoBrepFaceSet` was triggering
unnecessary material override processing that caused face clipping
artifacts when the "Picked object list" option was enabled in Selection
View. This check has been removed as the picked list functionality works
independently of the rendering path.
Removed the logic that forced `onTop=1` when `needPickedList()` is true
in View3DInventorSelection. This was causing the entire object to be
highlighted instead of just the selected sub-element when the "Picked
object list" option was enabled.
Change `ViewProviderPart` to inherit from `ViewProviderGeometryObject`,
giving Part containers the Selectable property. This allows recursive
selectability checks to respect the entire container hierarchy.
- Add missing <title> element in <head> (required by XHTML Strict)
- Add <body> wrapper around content (required by XHTML)
- Add Content-Type meta tag for proper character encoding
- Fix indentation of buttons to be inside body element
Currently if user selects object with `Selectable=false` property which
is nested inside a Part container, for example `Part->Body->Pad`, parent
Part container will get highlighted in the 3D view, even though the user
clicked on a non-selectable child object.
Cause of that is that tree view's `getTopParent()` function resolves
nested objects selections to their top-level container. When a Pad
inside Part is selected, `SoFCUnifiedSelection` was only checking Part's
`isSelectable()` status, even though the target is `Pad`.
So the fix is to resolve subname to get the final target object and
checks its `isSelectable()` status before checking for highlighting.
* Core: Fix completer popup adjustment after 'Tab' pressing
Completer popup in Expression Editor is now positioned and sized after pressing 'Tab'. This was missing when feature was added.
* Core: Extend completer popup list to up 20 elements or up to screen edge
Completer popup will now show up to 20 elements or will be limited to screen edge; if limited < 3 rows, popup will be displayed over cursor.
* Core: Fix completer wrapping on secondary screens
* Core: Fix completer positioning when includes long entries
* Core: Fix linter complaints
- Any action part of the application menu will trigger based on shortcut
when a native file dialog is open
- Another way to fix this is to switch out the application menu, but
afaict it requires writing native objective-c code. I think that's too
much complexity just to get cmd+c/cmd+v in these file dialogs
- For now, just disable the actions so that select-all, rotate-left, etc
don't trigger when pressed in these dialogs
- I've implemented an RAII wrapper to disable this. It should take
pointers which should be fine because all of these dialog calls are
blocking (so in principle nothing can change underneath).
I'm quite sure this won't have any adverse effects on other platforms,
but will need help from other developers to test in case.
- It seems that on MacOS (vs other platforms), shortcuts for items in
the application menu are given 'ultimate' priority, and will even take
precedence over text inputs
- There is a mechanism in QT (I believe designed with mac in mind) to
try to 'block' these shortcuts and send it to the focus instead. It's
'Shortcut Override': https://wiki.qt.io/ShortcutOverride
- Initially I was going to only apply this check when it's a Command
that overrides a known line-editing shortcut, but I figure it's
simpler to just always apply it when editing text. I can't really
imagine a user wanting to use an application shortcut while editing
text, but if there's some compelling use-case for this then let me know
and I'll add a further filter.
I'm quite optimistic that this won't have any ill-effects on other
platforms, but I'll need help from others to test this.