Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Tree : Remove useless root item and hide description by default. #9697

Merged
merged 3 commits into from Jun 4, 2023

Conversation

PaddleStroke
Copy link
Contributor

@PaddleStroke PaddleStroke commented May 30, 2023

This PR solve this : https://forum.freecad.org/viewtopic.php?t=78555&sid=6c1c30d9b4ae46d34c3b0d929d6ab34e&start=10

It does 2 things :
A - Remove the useless "Application" root item.
B - Hide by default the seldomly used "Description" column. Also when it is hidden, the labels are now hidden too.
Below a comparaison picture : on the left after this PR, on the right before.
image

Thank you for creating a pull request to contribute to FreeCAD! Place an "X" in between the brackets below to "check off" to confirm that you have satisfied the requirement, or ask for help in the FreeCAD forum if there is something you don't understand.

  • Your Pull Request meets the requirements outlined in section 5 of CONTRIBUTING.md for a Valid PR

Please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 1.0 Changelog Forum Thread.


@github-actions github-actions bot added the Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD label May 30, 2023
@luzpaz luzpaz added the UI/UX label May 30, 2023
@luzpaz
Copy link
Contributor

luzpaz commented May 30, 2023

CC @MisterMakerNL (just a heads up since you started the forum thread)

@sliptonic
Copy link
Member

It's amazing how much better/cleaner that looks.
As a future enhancement, perhaps we could check if any items in the tree have a description (label2) and show the column. That would give the best of both world. People who use the label would see it, everyone else would have clean tree.

@xtemp09
Copy link
Contributor

xtemp09 commented May 30, 2023

I use the description column. =/

@PaddleStroke
Copy link
Contributor Author

Note this is only the default preference. So you can still enable the preference if you want to use it.
Having said that this HideColumn preference doesn't seem to be anywhere in the UI and needs to be entered in the parameter editor. So perhaps it would be best to add it to the Preferences dialog?

@sliptonic
Copy link
Member

I use the description column. =/

You're definitely in the minority. I did a google image search for "FreeCAD tree" and couldn't find a single example where someone was using it. Most people use descriptive names instead.

Not saying it doesn't have value, but really an unused feature.

@yorikvanhavre
Copy link
Member

I use it too. "Description" is a central item in IFC. But this solution is good to me, indeed the tree looks way less cluttered. Two observations, though:

  • Indeed users needing the column might want to restore it and won't know how. Why not add a context menu option to do that?
  • The changes in TreeParams.cpp are under a // Auto generated code (Tools/params_utils.py:203) comment. Isn't there a risk that they are overwritten if that script is executed? Shouldn't that script be updated too?

@PaddleStroke
Copy link
Contributor Author

The tree context menu seems to be a correct solution. Better than to add in preference page. I will have a look to find where the context menu is implemented.
I don't understand the logic of this auto generated code and this python script. Tools/params_utils.py:203 does not contain any reference to this hideColumn parameter. So I guess there's no modification needed in this.
So I checked and found two more places where default where set to false.

Can you please confirm if I'm missing something here ? I'm not sure how this hideColumn is supposed to be set in the first place and when this auto generated stuff is actually called.

@yorikvanhavre
Copy link
Member

I also don't understand what that script is needed for... @realthunder maybe you can help here?

@realthunder
Copy link
Collaborator

The HideColumn parameter is declared here. Change the second parameter to True. Check out the class document of TreeParam for instruction on code generation. If the change is brief like this one. You can manually change the code here and here.

@PaddleStroke
Copy link
Contributor Author

Thanks for your explanations @realthunder !
So I add the modification to the python file for the future as well as the manual modifications so that we don't need to generate the code.

So now I'm adding a submenu to add 'Tree settings' to the contextual menu of the tree. In this submenu I will add this 'show/hide description column'. And in the future we can put more settings in here, such at text size and icon size as you implemented in linkstage.

… used 'Description' colum.

On top of that the headers are now hidden if the description column is hidden.
@PaddleStroke
Copy link
Contributor Author

PaddleStroke commented Jun 2, 2023

That's it. I cleaned commits history, added the contextual menu and rebased. This is how it looks :
image

@sliptonic
Copy link
Member

This looks like high-value/low-risk. Can we merge this for 0.21?

@MisterMakerNL
Copy link
Contributor

Looks really nice! And it's prime screenspace we are saving!

@sliptonic sliptonic merged commit eacb389 into FreeCAD:master Jun 4, 2023
6 checks passed
@sliptonic sliptonic deleted the tree-headers branch June 30, 2023 16:30
@MisterMakerNL
Copy link
Contributor

Is this what is called a regression? Seems to be back in the windows build:
afbeelding
[code]
OS: Windows 10 build 19045
Word size of FreeCAD: 64-bit
Version: 0.21.0.33445 (Git)
Build type: Release
Branch: master
Hash: 21d5b19
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: Dutch/Netherlands (nl_NL)
Installed mods:

  • Assembly3 0.12.0
  • Behave-Dark-Colors 0.1.1
  • BIM 2021.12.0 (Disabled)
  • Dracula 0.0.4
  • ExtremeProDark 2.9.0
  • ExtremeProLight 1.6.0
  • FeedsAndSpeeds 0.5.0
  • FEM_FrontISTR 0.1.0
  • Freecad-Built-in-themes-beta 1.2.0
  • IconThemes
  • lattice2 1.0.0
  • Nodes 0.1.36
  • PieMenu 1.2.7
  • ProDarkThemePreferencePack 1.0.0
  • Render 2023.2.6
  • scanObjects
  • SelectorToolbar
  • sheetmetal 0.2.59
  • SP_Startup
  • ToolbarStyle
    [/code]

@adrianinsaval
Copy link
Member

perhaps you enabled the column by mistake?

@martinproks
Copy link

As @sliptonic wrote:

... As a future enhancement, perhaps we could check if any items in the tree have a description (label2) and show the column. That would give the best of both world...

I'm for this. I'm using Label2 for my comments too / ok I'm minority ;-)

Another note: The 2nd column is headlined as "Description", but the content is Label2. It could be confusing, especially with examples that adds property named "Description": Create a FeaturePython object part I / Adding properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants