ImHex icon indicating copy to clipboard operation
ImHex copied to clipboard

[Feature] Color on struct when the struct is folded

Open leenzhu opened this issue 1 year ago • 5 comments

What feature would you like to see?

When we assign a color to a struct, and when the struct isn't expanded, we want the hex editor ignore the color of each field, and display all the field in the struct's color. And the patter data display the struct's color.

image

When we expand the struct, each filed would displayed with different color while draw an outline with the struct with the color of struct.

image

How will this feature be useful to you and others?

It would help us to have an overview of the file's layout before diving into the detailed fields.

Request Type

  • [ ] I can provide a PoC for this feature or am willing to work on it myself and submit a PR

Additional context?

No response

leenzhu avatar Nov 06 '23 07:11 leenzhu

Hey I generally like the idea! Need to see how easy it is to implement though

WerWolv avatar Nov 06 '23 15:11 WerWolv

and when the struct isn't expanded

Would you also prefer the field colors to be ignored when the Pattern data view is closed too?

Nemoumbra avatar Nov 06 '23 15:11 Nemoumbra

Hey I generally like the idea! Need to see how easy it is to implement though

Glade to hear that!

I have some idear about it:

  1. If users haven't assign a color to a struct, the struct has a random color.
  2. If users assign a color to a struct, the current behavior is that all the members inherit the color of the struct, we need to add an option to indicate that we wanna inhibit this behavior, so that each member of the struct could have different color.
  3. When the struct isn't expanded, let the color of struct take priority over the members.
  4. When the struct has been expanded, the color of members are given priority.

And further more, Sometimes we may still need the default color rendering even when the tree is collapsed, It would be better to add a check button to toggle the behavior of expanding.

Hope this would be helpfull, thanks.

leenzhu avatar Nov 07 '23 02:11 leenzhu

and when the struct isn't expanded

Would you also prefer the field colors to be ignored when the Pattern data view is closed too?

I think the color render behavior is depended on the state of the pattern data view tree.

So no matter the pattern data view is open or closed, it doesn't change the state of the tree.

leenzhu avatar Nov 07 '23 02:11 leenzhu

This looks semi-related to #1274.

C3pa avatar Jul 08 '24 20:07 C3pa