Commit Graph

289 Commits

Author SHA1 Message Date
bofdahof
e5b06ae736 Gui: apply std::ranges 2025-03-16 17:15:14 -05:00
Chris Hennes
7f1c43a335 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
df2c6637e6 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
a72a63232a 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
f647d4a1eb Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
Benjamin Nauck
dd6aa9f3c7 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
c7620fd916 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
37c47ef972 Prevent selection of an item in TreeWidget when user presses an eye icon
Closes #18922
2025-01-19 14:35:32 -05:00
wmayer
9cd919d0b9 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
752b5dcf68 [Gui] Tree, set FontSize on start of application 2024-12-13 11:58:24 -05:00
Vincent
acd2cc9f79 Gui: allow LineEdit to grow with text - fixes #17747 (#18099) 2024-12-09 10:38:54 -06:00
wmayer
499d192393 Core: Handle possible nested calls of TreeWidget::onUpdateStatus()
Fixes #17460
2024-10-24 23:11:37 -05:00
Furgo
06bc18fb0f Properly scale link overlays 2024-10-14 17:50:35 +02:00
Jiří Pinkava
ede67d4b24 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
c4bb689a85 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
5326173c5f Gui: Trim tree view column only if one column 2024-07-27 20:29:42 +02:00
PaddleStroke
47a506f82f Core: Tree: add canDragFromParents to reduce code duplicity. + Few small fixes 2024-07-15 17:53:02 +02:00
PaddleStroke
6088fdaa96 Assembly: Use canDragObjectToTarget in viewProviderAssembly 2024-07-15 17:53:02 +02:00
PaddleStroke
3e2bc7ad3d Core: Tree / ViewProvider : Add canDragObjectToTarget 2024-07-15 17:53:02 +02:00
PaddleStroke
c70654733f Core: Tree.cpp: few syntax fixes 2024-07-15 17:53:02 +02:00
Max Wilfinger
7d21d9edb8 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
Roy-043
308013fb97 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
4e4201f033 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
f294a5efc5 Gui: Silence unused variable 2024-06-22 08:29:27 +02:00
wmayer
f6e67a009d 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
99c30da736 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
5dad1ef528 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
974f57cf94 Core: Add Gui::Document::getTreeRootObjects() 2024-06-12 10:57:24 +02:00
Kuzemko Alexsandr
aca353d7c5 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
d12632f2ca Fix compiler warnings 2024-06-04 17:36:10 +02:00
Kacper Donat
b840e1c992 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
3d217feaa8 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
d24a60f538 Gray out hidden items regardless of the visibility icon setting 2024-06-02 14:22:45 +02:00
André Althaus
81c6d7401b 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
8588537bff Account for margin in visibility icon click check 2024-06-02 14:22:09 +02:00
mos
d12635246f [gui] code clean
.
2024-05-23 11:34:15 +02:00
André Althaus
a09dcd917a Gray out all columns in the tree if an item is invisible 2024-05-20 11:04:45 -05:00
PaddleStroke
344b125a07 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
219a2e0104 Fix #13107 (#13682)
Introduce a signal slot for tree item highlight change.
2024-05-13 10:42:57 -05:00
wmayer
d89bece39a 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
638cbd02ae 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
wmayer
8a1c3ead0f Gui: fix some linter warnings 2024-05-06 18:24:20 +02:00
farley
56b938e1de Update Tree.cpp
- Disable document activation when right-clicking
2024-05-06 17:57:15 +02:00
wmayer
4ea1ad58c8 PD: Fix crash when adding sketch to loft via tree view
The underlying problem is the method DocumentItem::updateItemSelection() where
the selection is altered. This may cause the destruction and recreation of the
DocumentObjectItems so that the passed pointer can become dangling.

The issue is fixed in two steps:
1. Add the method 'DocumentObjectItem *findItem(App::DocumentObject* obj, const std::string& subname) const'
   to safely re-access the item.
2. Add a boolean flag 'dirtyFlag' and the methods insertItem() and removeItem() to DocumentObjectData.
   This is needed to check when the iterator over the container becomes invalid.
2024-05-06 17:38:59 +02:00
wmayer
7cbb28ca53 Gui: fix computing status value and use enum to avoid magic numbers 2024-03-31 10:59:00 +02:00
ppphp
da7ee06d67 fix: c++20 deprecate [=] 2024-03-31 10:47:32 +02:00
Max Wilfinger
6ca8b2daae update hardcoded XPMs to .svg files. Updated .svg icons for clarity. 2024-03-30 11:25:13 +01:00
luzpaz
5839134e95 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
André Althaus
2224d87e6e Fix #12780: An additional visibility icon is shown for features in groups
The icons in the testStatus() function are taken by reference and modified
inside. This seems to be used for caching when the same item occurs
multiple times in the tree. This can be the case for groups.

The visibility icon was added without taking the cached icon into
consideration and so it was added a second time.
The code is now moved into the if statement checking for this case.
2024-03-11 12:23:04 -05:00
Florian Foinant-Willig
f633fa476a Introduce object freeze (#12580)
* Introduce object freeze

* do nothing at property change
2024-03-04 17:54:25 +01:00