Commit Graph

275 Commits

Author SHA1 Message Date
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
PaddleStroke
d74eb1439a Remove warning in Tree.cpp from 12293 2024-02-27 10:22:30 +01:00
Chris Hennes
d144e85a34 Merge pull request #12412 from FlachyJoe/suppressibleExt
Core: Create a SuppressibleExtension to provide the Suppressed property to all the WBs
2024-02-26 10:53:46 -06:00
Chris Hennes
717525c5be Merge pull request #12298 from NomAnor/visibility-icon
Add an icon to toggle the visibility of items in the tree view
2024-02-26 10:45:07 -06:00
PaddleStroke
ee0c55703f Core: Tree: Allow reordering in root and groups allowing it (parts, groups 2024-02-26 10:42:21 -06:00
André Althaus
5aacd52ed8 Add a new preference for the visibility icons
Add a preference to Display->UI that allows the user to choose if
the visibility icons are shown in the tree view.
2024-02-21 19:28:28 +01:00
André Althaus
15944bb079 Add a function to recalculate the icons for use when the visibility icon preference changes 2024-02-21 19:25:13 +01:00
André Althaus
47bbc1f6af Toggle visibility when clicking the visibility icon
If the visibility icon is enabled a mouse press on that part of the icon
toggles the visibility of the tree item.
2024-02-21 19:25:13 +01:00
André Althaus
e7665f523f Add visibility icon
Prepends the visibility icon to the normal icon if enabled and uses
the result as the new icon.
2024-02-21 19:25:12 +01:00
Florian Foinant-Willig
5a22009217 Add SuppressibleExtension 2024-02-21 16:19:32 +01:00
Paddle
cce2c24262 Core: tree: prevent object replacement when dragging 2024-01-22 10:53:47 -06:00
Paddle
2bf3639fb5 Core: PropertyEditor : save properly the size of the first column. 2024-01-19 10:49:33 +01:00
Paddle
3136bd6fcc Core: add property command, that shows property view. 2024-01-19 10:26:00 +01:00
Paddle
10de5a19d0 Core : Tree: Add 'Properties' action in contextual menu. Opens a property dialog. 2024-01-17 17:00:55 +01:00
André Caldas
560898907b Avoids using getNameInDocument() to test if DocumentObject is attached to a Document.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.

The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).

Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".

The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
2023-12-11 17:37:58 +01:00