Recent

Author Topic: Object Inspector - Start with nodes collapsed?  (Read 393 times)

Cascade

  • Jr. Member
  • **
  • Posts: 86
Object Inspector - Start with nodes collapsed?
« on: April 22, 2026, 12:42:36 pm »
When I select or open a form in the Form Designer, the Object Inspector defaults to showing the entire tree hierarchy expanded.  I find this makes it difficult for me to find the bit of the form I'm interested in, especially if there are complex components with many nodes, such as SynEdit, present on the form.  There can be a lot to scroll through.

Is there an option to have the Object Inspector default to 'all nodes collapsed' initially, so that I can then expand just the part I'm currently working on?  I haven't spotted anything in the right-click context menu, but maybe there's a keyboard shortcut I'm unaware of?

I guess the ideal might be: when I select a component on the form, just that part of the Object Inspector tree expands, and all other nodes auto-collapse.  That way the Object Inspector always stays focused on the task at hand.  At least in my head that sounds like a good idea...

dsiders

  • Hero Member
  • *****
  • Posts: 1613
Re: Object Inspector - Start with nodes collapsed?
« Reply #1 on: April 22, 2026, 03:52:39 pm »
When I select or open a form in the Form Designer, the Object Inspector defaults to showing the entire tree hierarchy expanded.  I find this makes it difficult for me to find the bit of the form I'm interested in, especially if there are complex components with many nodes, such as SynEdit, present on the form.  There can be a lot to scroll through.

Is there an option to have the Object Inspector default to 'all nodes collapsed' initially, so that I can then expand just the part I'm currently working on?  I haven't spotted anything in the right-click context menu, but maybe there's a keyboard shortcut I'm unaware of?

You should mention which version of Lazarus you're using. Changes happen between versions. I'm currently using the main branch (4.99)... so that's what my comments will reflect.

I assume you're referring to the Component Tree and not the Name/Value part of the Object Inspector - because the Name/Value part of the Object Inspector is collapsed by default on startup.

In the Component Tree, the "+" or "-" keys be used to Expand or Collapse the focused tree node (just like using cursor keys). There is no expand all or collapse all option - not even on the context menu. There is also no IDE Option to control the initial expanded or collapsed state. You could submit a feature request for either (or both) of those items.

I guess the ideal might be: when I select a component on the form, just that part of the Object Inspector tree expands, and all other nodes auto-collapse.  That way the Object Inspector always stays focused on the task at hand.  At least in my head that sounds like a good idea...

The current version already expands (if needed) and highlights a tree node when the component is selected on the form designer. It doesn't auto-collapse anything though.

Cascade

  • Jr. Member
  • **
  • Posts: 86
Re: Object Inspector - Start with nodes collapsed?
« Reply #2 on: April 22, 2026, 07:06:35 pm »
Hi dsiders - thanks for confirming I've not missed something obvious.  I'm using 4.99 too.  Yes, you're correct, I'm describing the Component Tree part of the Object Inspector.  I might submit a feature request (or dive into the code and see what I can come up with - or both :))

Cascade

  • Jr. Member
  • **
  • Posts: 86
Re: Object Inspector - Start with nodes collapsed?
« Reply #3 on: April 23, 2026, 11:23:31 am »
I've created a Lazarus feature request here:  Issue #42246

...and linked it back to this topic.  It includes a temporary hack for a 'Collapse All' Context Menu item:

« Last Edit: April 23, 2026, 11:25:48 am by Cascade »

 

TinyPortal © 2005-2018