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

EEZ Flow: Styles can be hierarchical/derived #257

Closed
2 tasks done
fietser28 opened this issue May 13, 2023 · 10 comments
Closed
2 tasks done

EEZ Flow: Styles can be hierarchical/derived #257

fietser28 opened this issue May 13, 2023 · 10 comments

Comments

@fietser28
Copy link
Collaborator

fietser28 commented May 13, 2023

Working with styles is pretty essential in EEZ Flow if the project get bigger. To make it more manageable I would like it to be possible to derive styles from each other in the UI (it doesn't have to be in the resulting code):

  • A style can be derived from another style so you only manage a small amount of differences and are not copying the style and making adjustments.
  • It would be nice if this is also shown visually in the style browser (tab).
@prasimix prasimix added this to the M15 milestone May 18, 2023
@prasimix prasimix changed the title EEZ Flow: Styles can be hierarchical/derived. EEZ Flow: Styles can be hierarchical/derived May 28, 2023
mvladic added a commit that referenced this issue Jun 10, 2023
@mvladic
Copy link
Contributor

mvladic commented Jun 10, 2023

Done.

Now, you can make hierarchy of styles by using drag and drop (similar to Widgets Structure panel):

image

mvladic added a commit that referenced this issue Jun 10, 2023
@fietser28
Copy link
Collaborator Author

If I drag and drop small_label_symbol under small_label:
image
image

Small label symbol only has a different font, the color is the same. It doesn't remove the changes not needed anymore (no problem, allows for manual verification) AND if I unmark the color of small label symbol then I would except the color to be inherited from small label, but it doesn't (I would call this a bug).

But: Now closing the project file and reopening:
image
It behaves as expected.

After this I tried it again with a different combination and was not able to reproduce...

mvladic added a commit that referenced this issue Jun 12, 2023
@mvladic
Copy link
Contributor

mvladic commented Jun 12, 2023

This problem can be easily reproduced:

lvgl_styles

@mvladic
Copy link
Contributor

mvladic commented Jun 12, 2023

This is fixed now.

@mvladic
Copy link
Contributor

mvladic commented Jun 12, 2023

... Small label symbol only has a different font, the color is the same. It doesn't remove the changes not needed anymore (no problem, allows for manual verification) ...

I'm not sure I want to automatically remove changes that are not needed anymore. Because, if you first move style at some position and if you change your mind and move somewhere else then it can loose modification. Maybe we should extend this menu:

image

With another option called "Remove Unnecessary Modifications".

@mvladic
Copy link
Contributor

mvladic commented Jun 12, 2023

Hm, we don't have this menu in style properties, only in widget style properties.

@fietser28
Copy link
Collaborator Author

fietser28 commented Jun 12, 2023

With automatically I mean: drag a style to become a 'child' style AND both these styles have a setting explicitly set to the same value it will remove this setting in the child style because it is already set in the parent child. Doing this automatically after the dragging doesn't seem like a good idea, but implement it like 'reset all modifications' but in the styles menu and calling it 'Remove redundant modifications' or 'Simplify style'.

I really like this enhancement as it is already implemented. It allows for good overview and cleanup of styles (in combination with the 'find all references' feature) without needing a 'big design up-front'.

@fietser28
Copy link
Collaborator Author

Hm, we don't have this menu in style properties, only in widget style properties.

I think this is exactly what is described above.

mvladic added a commit that referenced this issue Jun 13, 2023
@mvladic
Copy link
Contributor

mvladic commented Jun 13, 2023

I added "Remove Redundant Modifications" option in context menu for the style.

image

@fietser28
Copy link
Collaborator Author

Perfect now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants