Commit Graph

418 Commits

Author SHA1 Message Date
forbes
5883ac8a0d fix(gui): resolve PartDesign toolbars and breadcrumb when editing body inside assembly
Some checks failed
Build and Test / build (pull_request) Has been cancelled
When double-clicking a PartDesign Body inside an Assembly, the editing
context resolver failed to show PartDesign toolbars or a proper
breadcrumb. Three root causes:

1. Priority preemption: assembly.edit (priority 90) always matched
   because the Assembly VP remained in edit mode, blocking all
   PartDesign contexts (priorities 30-40).

2. Wrong active-object key: PartDesign matchers only queried the
   "part" active object, but ViewProviderBody::toggleActiveBody()
   sets "part" to the containing App::Part (which is the Assembly
   itself). The Body is set under "pdbody", which was never queried.

3. Missing refresh trigger: ActiveObjectList::setObject() fires
   Document::signalActivatedViewProvider, but EditingContextResolver
   had no connection to it, so setActiveObject("pdbody", body) never
   triggered a context re-resolve.

Changes:
- Forward signalActivatedViewProvider from Gui::Document to
  Gui::Application (same pattern as signalInEdit/signalResetEdit)
- Connect EditingContextResolver to the new application-level signal
- Add getActivePdBodyObject() helper querying the "pdbody" key
- Add partdesign.in_assembly context (priority 95) that matches when
  a Body is active pdbody while an Assembly is in edit
- Update partdesign.body and partdesign.feature matchers to check
  pdbody before falling back to the part key
- Add Assembly > Body breadcrumb with Blue > Mauve coloring
- Update label resolution to prefer pdbody name
2026-02-21 09:43:51 -06:00
forbes
5a212160c1 cherry-pick #16: origin commands - Commit/Pull/Push (679aaec6d4) 2026-02-13 14:08:12 -06:00
forbes
9e031ef021 cherry-pick #12: origin abstraction layer (7535a48ec4)
Application.cpp/ApplicationPy.cpp: register origin system.
Resolved add/add conflicts: kept Phase 1 versions of Kindred source files.
2026-02-13 14:07:36 -06:00
Kacper Donat
87b257546f Gui: Wrap strings with QStringLiteral 2025-12-19 13:14:25 -06:00
Kacper Donat
aefd2592a8 Gui: Respect both content size and minimum width for buttons
This is a hacky fix for https://github.com/FreeCAD/FreeCAD/issues/23607

Basically after widget is shown or polished we enforce it's minimum size to at
least cover the minimum size hint - something that QSS ignores if min-width is
specified.
2025-12-15 10:17:34 -06:00
PaddleStroke
7c2dac1278 GUI: Fix broken build - splitbutton (#25892) 2025-12-02 20:24:57 -06:00
Chris Hennes
cbd9414684 Merge pull request #25713 from kadet1090/split-button
Gui: Use SplitButton for config migration modal
2025-12-01 10:52:19 -06:00
PaddleStroke
b249b9daeb Core: Close partially opened document when doc is closed. (#25659) 2025-11-30 23:33:43 -06:00
Kacper Donat
c500408a6d Gui: Add SplitButton widget
This adds SplitButton widget that has one primary action and possibly
more secondary ones accessible via menu.
2025-11-28 10:15:04 +01:00
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Kacper Donat
a09de19764 Gui: Fix order of stylesheet applying 2025-10-20 09:26:22 -05:00
captain0xff
8496d25279 Gui: fix null handling logic in Application::setEditDocument 2025-10-16 12:54:20 -05:00
Sami Liedes
0a50bad4c0 Gui: Request 24-bit color depth if available
In some configurations, Qt apparently defaults to giving the "first
acceptable" buffer format. This often ends up being RGB565, which
gives us little color resolution.

Request 8-bit RGB samples to fix this.

This tends to happen easiest with
`QT_WAYLAND_DISABLE_WINDOWDECORATION=1` and `QT_QPA_PLATFORM=wayland`.
2025-10-06 10:48:30 -05:00
Sami Liedes
b3e8ed7814 Gui/Application, QuarterWidget: request OpenGL compatibility profile (#23768)
On Wayland with Qt, the default OpenGL context often ends up being
OpenGL ES. ES is a stricter API based on the "core" profile and lacks
many legacy functions (e.g. glEnd). FreeCAD relies on some of these
functions, which work under Mesa’s permissive stack but fail outright
with NVIDIA’s proprietary drivers, resulting in a blank 3D view.

Fix this by explicitly requesting a desktop OpenGL compatibility
profile both before QApplication creation and in QuarterWidget. This
ensures the presence of the legacy entry points required by Coin/SoQt.

(NB: both requests appear to be necessary; a single change was not
sufficient in testing.)
2025-09-29 19:22:29 -05:00
Bas Ruigrok
df2df0905d Don't inform Coin to use EGL for Coin 4.0.6+
Coin figures it out automatically starting from 4.0.6. Only for Coin 4.0.4 and 4.0.5 it is needed to explicitly tell Coin to use EGL.
2025-09-28 18:57:18 -05: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
Pieter Hijma
f0a9b5ea01 Part: Add deprecation warning for import/export 2025-09-12 16:30:25 -05:00
Kacper Donat
78a579804c Gui: Fix reloading of themes 2025-08-28 17:14:55 -05:00
Kacper Donat
fd502ce94f Gui: Try to load Theme Parameters from file
This creates logic that tries to load user parameters from file as the
priority and pushes back older mechanism to lower layer. Older way of
loading theme parameters should be preserved until we release first 1.1
RC.
2025-08-25 00:47:55 +02:00
Max Wilfinger
ecf02b7878 Gui: Update UI strings for consistency
Closes: #22135
2025-08-04 20:14:45 +02:00
PaddleStroke
a8b655d602 Assembly: Use icon overlay for unconnected joints instead of annoying warning. (#22662)
* Core: FeaturePython : Add getOverlayIcons to python interface

* Assembly: unconnected joints icon overlay Fix #22643

* Update src/Mod/Assembly/Gui/ViewProviderAssembly.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update AssemblyObject.cpp

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

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

* Update ViewProviderFeaturePython.h

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

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

* Update ViewProviderFeaturePython.h

* Update JointObject.py

* Update ViewProviderFeaturePython.h

* Update ViewProviderFeaturePython.cpp

* Update Application.cpp

* Update ViewProviderFeaturePython.cpp

* Update ViewProviderFeaturePython.h

* Update ViewProviderAssembly.cpp

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-07-26 22:35:24 +02:00
Kacper Donat
a32594faea Gui: Add ThemeTokenManager class to contain theme parameters
This class aims to implement Design Token idea into FreeCAD themes. It
allows themes to use generic variables with generic values so we could
use one qss theme and change the style based on values from preference
packs.
2025-07-07 00:07:31 +02:00
Kacper Donat
38ec685f2d CAM: Fix origin indicator for Job
This commit fixes how origin (coordinate system) indicator looks. Before
it showed as disc, and now it shows as point which is more approperiate
given the context.
2025-07-05 18:46:01 +02:00
Bas Ruigrok
60aa5ff373 Inform Coin to use EGL when on Wayland (#21917)
* Inform Coin to use EGL when on Wayland

* Only check for Wayland on Linux and BSD
2025-06-30 11:12:02 -05:00
wmayer
8b1df6f00f Gui: Move define HAS_QTBUG_129596 to separate header file 2025-05-30 18:04:33 +02:00
Kacper Donat
9baeb6e9e6 Gui: Add support for hints in status bar 2025-05-21 17:42:45 +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
Chris Hennes
9b1467cef3 Merge pull request #20540 from 3x380V/cleanup-schemas-management
Simplify UnitsSchemas management
2025-05-05 10:43:27 -05:00
Benjamin Nauck
a882289995 Gui: use contains() and isEmpty() instead of count() where possible 2025-05-03 22:19:51 +02:00
João Neves
0d38b2f7c5 Core: Fixed a bug where an empty document disappears (#20554)
* Core: Fixed a bug where an empty document disappears

Created a flag named autoCreated to distinguish an autoCreated
document created in the startup from a manually document.
Implemented a setter and a getter for this new flag.
Added a codition that verifies if a document is autoCreated
when opening another document to close it in the correct case.
Implemented unit tests for theses cases. Fixes #19868.

Signed-off-by: João Neves <joao.antonio.neves@tecnico.ulisboa.pt>

* Tests: Fix failing auto-created document tests

Signed-off-by: João Neves <joao.antonio.neves@tecnico.ulisboa.pt>

* Tests: moved created tests to the existing Document test framework.

Signed-off-by: João Neves <joao.antonio.neves@tecnico.ulisboa.pt>

---------

Signed-off-by: João Neves <joao.antonio.neves@tecnico.ulisboa.pt>
2025-04-28 10:46:52 -05:00
bofdahof
1155f0d752 Base: simplify UnitsSchemas management
Fixes: Maintaining schemas is difficult and error-prone

- Facilitate easy schemas add, remove, change, etc.
- Remove 14 files containing approx 2,190 lines of if/else code and data
- Place data in one file (UnitsSchemasData.h) using a normalized structure (including special functions)
- Isolate and simplify data operations (code)
- Remove schemas enum to keep data independent of code
- Separate responsibilities: Specifications, data, schemas, schema
- Add schema data 'isDefault'
- Add schema data name
- Prefer algorithms to raw loops
- Add schemas unit tests
- Tweak quantity unit tests
2025-04-27 00:45:54 +02:00
Alex Tran
989a06ea63 App: Running FreeCAD in verbose mode information to reflect Gui -> Help -> About Dialog info (#20487) 2025-04-16 08:29:07 +02:00
Kacper Donat
b300c80b90 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Kacper Donat
35a9673a75 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
Chris Hennes
dced463dc6 Merge pull request #19428 from tritao/base-tracy-profiler
Base: Add Tracy frame profiling support.
2025-03-14 04:12:05 +00:00
Joao Matos
7ae14d6bd5 Base: Add build support and instrumentation for the Tracy profiler. 2025-03-14 03:41:30 +00:00
Chris Hennes
be8b92182c Merge pull request #19921 from mosfet80/QT_CLEAN
REMOVE old QT<= 5.14 code
2025-03-11 20:54:59 +00:00
Joao Matos
9bcdd2d44c Rename DocumentCreateFlags to DocumentInitFlags. 2025-03-07 20:54:16 +00:00
Joao Matos
1c2ac570f8 Convert DocumentCreateFlags instances to use designated initializer list. 2025-03-07 20:42:51 +00:00
Andrea
da66720d3a REMOVE old QT<= 5.14 code
Ubuntu 22.04  use qt 1.15.3.
In the code is still used qt code <5.10.
A cleanup was done by removing qT code version used in ubuntu 18.04.
2025-03-05 09:32:06 +01:00
Syres916
46b2ec526b [Gui] Trigger the same checks for Drag & Drop files as File > Open 2025-03-04 20:45:15 -06:00
Benjamin Bræstrup Sayoc
f647d4a1eb Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
tritao
123569823e App: Provide temporary document creation flag to Python App.loadDocument. 2025-02-03 18:01:18 +01:00
Benjamin Nauck
344b655f16 Move where icons in menus attribute is set
Without this, icons are not visible on macOS
2024-12-20 11:55:21 -05:00
wmayer
a8f2ddb038 Gui: Move Python functions from Application to ApplicationPy
This reduces build time when adding new Python functions because only one file must be compiled.
Handles also many linter warnings.
2024-12-20 11:50:07 -05:00
Chris Hennes
b160f1afc0 Merge pull request #18244 from wwmayer/space_mouse_runtime
Gui: Add runtime check to choose between modern and legacy space mous…
2024-12-09 11:36:17 -05:00
wmayer
3884e2c34a Gui: Add runtime check to choose between modern and legacy space mouse devices 2024-12-03 18:54:21 +01:00
PaddleStroke
b7f1a0c150 ViewProviderOrigin: Renamed to ViewProviderCoordinateSystem 2024-11-27 12:15:53 +01:00
PaddleStroke
19702dcb21 Core: Add App::LocalCoordinateSystem.
Most of App::Origin is moved into this sub class of App::Origin.
Add App::Point. Change graphics of the planes/axis.
Remove scale-by-content behavior and make it fixed size on screen.
2024-11-26 17:36:02 +01:00