Commit Graph

298 Commits

Author SHA1 Message Date
Ladislav Michl
9683cf1e4f Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
df3c324b7d Gui: use contains() and isEmpty() instead of count() where possible 2025-05-03 22:19:51 +02:00
Kacper Donat
ef357aa07a Gui: Use freecad_cast whenever possible 2025-04-26 14:23:25 +02:00
Pieter Hijma
c16935dce4 [Gui] Fix "Select dependent objects" with cycles
Doing "Add dependent objects to selection" in the context menu of an
object that has cyclic dependencies triggered an infinite recursive
loop.  This has been solved by using the function to get an outlist
recursively.
2025-04-22 17:23:38 -03:00
Chris Hennes
e2c2017df5 Merge pull request #20649 from pieterhijma/viewprovider-toggle-visibility
[Core] Allow setting visibility toggling in the ViewProvider
2025-04-14 10:45:14 -05:00
Kacper Donat
77e40b9747 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
9d97d1c895 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
Pieter Hijma
0d5481e448 [Core] Add visibility toggling to ViewProvider
With this extension of the API, view providers can indicate whether
document objects should be able to be toggled for visibility.  There is
both a C++ and Python interface, idiomatic for FreeCAD code.
2025-04-05 15:57:09 +02:00
captain0xff
887cbd0e1a remove some code setting pixel density ratio for pixmaps
update
2025-04-03 19:55:27 +05:30
bofdahof
cb5caf6765 Gui: apply std::ranges 2025-03-16 17:15:14 -05:00
Chris Hennes
1a2070c36f Merge pull request #19636 from kadet1090/color-in-base
Base: Move App::Color to Base
2025-03-02 16:36:40 -06:00
Kaung Zin Hein
0b2610f1af Gui: "Open File Location/Reveal in Finder" in Tree view (#19805)
* Add: barebone openFileLocation on linux
* Feat: Add handling for different types of os
* Fix: Use preprocessors
* Fix: directive typo

---------

Signed-off-by: Kaung Zin Hein <83657429+Zen-cronic@users.noreply.github.com>
2025-02-24 10:15:28 -06:00
Kacper Donat
13fbab9e42 Base: Move App::Color to Base
Every basic data type is stored in Base module, color is standing out as
one that does not. Moving it to Base opens possibilities to integrate it
better with the rest of FreeCAD.
2025-02-17 21:10:26 +01:00
Benjamin Bræstrup Sayoc
8d2d0a47f4 Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
Benjamin Nauck
6f535f19fb Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
xtemp09
96f7a2804e Fix arrow navigation in TreeWidget
Closes #10488. This commit removes the code fragment that "swallowed"
the key press events.
2025-01-24 06:51:52 -06:00
xtemp09
a07d18ca7f Prevent selection of an item in TreeWidget when user presses an eye icon
Closes #18922
2025-01-19 14:35:32 -05:00
wmayer
98fdb40546 Gui: Fix copying elements in the tree view by holding CTRL key
In older versions it was possible to copy elements with drag and drop by holding the CTRL key. Since v0.20 or v0.21 this wasn't possible any
more so that elements are always moved.

Note: Copying is only allowed for elements that have a parent object.
2024-12-23 12:21:12 -05:00
Syres916
8e4e53dbae [Gui] Tree, set FontSize on start of application 2024-12-13 11:58:24 -05:00
Vincent
9ba6bc30fb Gui: allow LineEdit to grow with text - fixes #17747 (#18099) 2024-12-09 10:38:54 -06:00
wmayer
b46453648b Core: Handle possible nested calls of TreeWidget::onUpdateStatus()
Fixes #17460
2024-10-24 23:11:37 -05:00
Furgo
e9bbc75f60 Properly scale link overlays 2024-10-14 17:50:35 +02:00
Jiří Pinkava
a9d3a8eb6c GUI: Fix tree visibility click when a tree item gets collapsed
The tree can change shape during handling the mousePressEvent() event,
because some part of the tree can be (un)folded. This might lead to
shift of the three (up or down). The position of items in tree change
relatively to the position of mouse (which stays in place).
If the visibility click is handled after mousePressEvent, the shift in
position can lead to cursor beeing over visibility icon and the click
is handled like if the visibility icon vas clicked, which is unexpected.

Handling the visibility click first fixes this. The setAccepted(true),
was removed, it is left to the subroutine to set it.
2024-09-13 13:24:42 -05:00
MisterMaker
e6863d0d15 Stylesheet fixes part IV - A new hope (to be done for 1.0) (#15586)
* Qcolor dialog fixes

* Fix for white hoover on tabbar

* Changes active color and selected feature color

* update same colors in cfg

* fix for tab pan in material editor

* some fixes

mostly theme accent colors fixes.

* fixed text edit being cut off

https://github.com/FreeCAD/FreeCAD/issues/15603

* extend arrow fix

https://github.com/FreeCAD/FreeCAD/issues/15616

* checkboxes links qpushbuttons etc.

Fixed https://github.com/FreeCAD/FreeCAD/issues/15610#event-13642470770
and hopefully also
https://github.com/FreeCAD/FreeCAD/issues/15136#issuecomment-2254156398

* fixed selection-text color in the preference menu also White is white.

* forgot checkbox spacing for light

* colors update

fix for https://github.com/FreeCAD/FreeCAD/issues/15660#event-13670498420
and
https://github.com/FreeCAD/FreeCAD/issues/15620#issuecomment-2251144435

* Delete CMakeSettings.json

* get out of here

* title a tat higher

* change rubberband from white to blue to make it work with white background.

* setting the colors.

* tree colors
2024-07-29 17:31:17 -05:00
Kacper Donat
4aabd47dcd Gui: Trim tree view column only if one column 2024-07-27 20:29:42 +02:00
PaddleStroke
4769926120 Core: Tree: add canDragFromParents to reduce code duplicity. + Few small fixes 2024-07-15 17:53:02 +02:00
PaddleStroke
e6fb9f0185 Assembly: Use canDragObjectToTarget in viewProviderAssembly 2024-07-15 17:53:02 +02:00
PaddleStroke
e71351cf7d Core: Tree / ViewProvider : Add canDragObjectToTarget 2024-07-15 17:53:02 +02:00
PaddleStroke
febe4dbd8c Core: Tree.cpp: few syntax fixes 2024-07-15 17:53:02 +02:00
Max Wilfinger
8ff5a1f688 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
Roy-043
c596c8e17c Gui: Tree.cpp make some gui texts more consistent
The gui texts for "Show description" and "Show internal name" were inconsistent.

"Show description column" -> "Show description"

"Show an extra tree view column for item description. -> "Show a description column for items."
2024-06-24 11:29:05 -05:00
PaddleStroke
d8db937901 Core: Tree: Remove !vp->canDragAndDropObject(obj) that made no sense. And remove the auto switching to 'CopyAction' 2024-06-24 10:42:49 -05:00
Chris Hennes
f11af4f2a5 Gui: Silence unused variable 2024-06-22 08:29:27 +02:00
wmayer
127f935711 Fix several compiler warnings
* -Wmaybe-uninitialized
* -Wunused-parameter
* -Wunused-variable
* -Wnonnull
* -Wstringop-truncation
* -Wstringop-overflow
2024-06-19 21:14:23 -05:00
Chris Hennes
587cd884e8 Merge pull request #14388 from Ondsel-Development/core_rootObjects
Core: Add Gui::Document::getTreeRootObjects() Fixes #14373
2024-06-17 11:04:18 -05:00
Chris Hennes
f82ba8b47e Merge pull request #14393 from NomAnor/visibility-icon
Change visibility icon default to enabled and tweak visuals
2024-06-17 10:36:35 -05:00
PaddleStroke
fb32579498 Core: Add Gui::Document::getTreeRootObjects() 2024-06-12 10:57:24 +02:00
Kuzemko Alexsandr
4d5eb39762 Displaying internal names in the tree view (#14237)
* Displaying internal names in the tree view

* Change "Hide extra column" to "Hide Description"

---------

Co-authored-by: Kuzma30 <kuzemkoa@gmail.com>
2024-06-10 11:31:04 -05:00
wmayer
511e1198f6 Fix compiler warnings 2024-06-04 17:36:10 +02:00
Kacper Donat
b7ff904144 Gui: Fix document tree background rendering with overlay (Qt6)
This aims to fix rendering of tree view items in Qt6. While I don't
belive that this is a good way to fix this, I am worried that it is the
only way to do ir.

BC BREAK: This change introduces artificial QTreeView widget that can be
targeted using QSS and can be used in the delegate for painting background of
items. `QTreeView::item` would now be used to render background for the
whole row, while each cell can be targeted using `#DocumentTreeItems`
selector.

More details on implementation:
https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604

Fixes: #13760
2024-06-03 11:28:02 -05:00
André Althaus
60ec5db4b3 Fix visibility icon for link elements
The visibility of link elements must be set with setElementVisible.
This will first try to use that API otherwise it falls back to setting
the Visibility property.
2024-06-03 11:12:57 -05:00
André Althaus
198c29b816 Gray out hidden items regardless of the visibility icon setting 2024-06-02 14:22:45 +02:00
André Althaus
9c9f1b0a5d Increase space between visibility icon and normal icon
Adds PM_LayoutHorizontalSpacing betweenthe visibility icon and the normal icon.
2024-06-02 14:22:41 +02:00
André Althaus
f733c87902 Account for margin in visibility icon click check 2024-06-02 14:22:09 +02:00
mos
a8d093280e [gui] code clean
.
2024-05-23 11:34:15 +02:00
André Althaus
fb4fe28c39 Gray out all columns in the tree if an item is invisible 2024-05-20 11:04:45 -05:00
PaddleStroke
5f4dd814ea Core: Add getRootObjectsIgnoreLinks and fix bugs in tree.cpp and AssemblyObject.cpp, CommandInsertLink.py, UtilsAssembly.py 2024-05-13 17:58:34 +02:00
Florian Foinant-Willig
1398ab67e4 Fix #13107 (#13682)
Introduce a signal slot for tree item highlight change.
2024-05-13 10:42:57 -05:00
wmayer
a2037c9dc4 Gui: Replace TreeRank property with a simple int
This fixes that copied & pasted objects are not added at the end of the tree view.
See https://forum.freecad.org/viewtopic.php?p=755532#p755532
2024-05-06 18:24:20 +02:00
wmayer
7eeb3a43cc Gui: Do not reset placement when reordering top-level objects
This fixes #13690: Reordering top level objects destroys the Placement
2024-05-06 18:24:20 +02:00