-
-
Notifications
You must be signed in to change notification settings - Fork 216
Implement StyleEditor (encompasses a Color Picker) #3329
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
Conversation
Instead of using the StyleSheet, one can now use the StyleEditor. The StyleEditor is a GUI that allows to style elements by their name and is coherent with the StyleSheet. Fixes gaphor#2136 Co-authored-by: Francisco Gouveia <francisco.t.gouveia@tecnico.ulisboa.pt>
This looks pretty good.
I think it's a good idea to keep the option for expansion open at least.
Is it easy to update elements in the. style sheet directly? It would be my preference since all styling is then in one place, but I can imagine it's requires a lot of processing to update.
I think you can just add one to A few suggestions: I would move the StyleEditor to |
I feel the same way, however with our approach when an element changes it's name or when it's removed or even when it's loaded from a file, our "backend" takes care of this and updates the element accordingly. If we were to simply write the changes into the StyleSheet then, whenever the user deleted an element or change it's name there would be useless lines in the StyleSheet. For the backend to track these changes in the StyleSheet would be computationally heavy. That's why we've created the export button, to allow user to look under the hood if he wants to. |
Co-authored-by: Francisco Gouveia <francisco.t.gouveia@tecnico.ulisboa.pt>
…agram Co-authored-by: João Correia <joao.marques.correia@tecnico.ulisboa.pt>
Hi @amolenaar , I think we've already addressed the requested changes. Could we request another review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @0lione, sorry for the late feedback.
Looks good. I think for now it's good to be specific on which elements have a custom styling.
I proposed some (mainly stylistic) changes. I have not been able to run the code yet.
Co-authored-by: João Correia <joao.marques.correia@tecnico.ulisboa.pt>
Co-authored-by: Francisco Gouveia <francisco.t.gouveia@tecnico.ulisboa.pt>
Hi @FranciscoTGouveia, what is remaining to get this merged? |
Hello @danyeaw! I think it is ready to be merged. In my understanding this could be a good substitute for the Style Sheet as it is, offering a graphical and user-friendly way of styling elements. However, this still has room for improvement (e.g. not all style options are available). With that said, I think that feedback from the community would be beneficial to know what path to follow regarding the Style Editor. |
Thanks @FranciscoTGouveia, would you mind please resolving the merge conflicts? |
Hi @danyeaw ! While resolving the conflicts I found out that the button for opening the Style Editor is not showing. As far as I can tell, this is related with the fact that the To fix this, I could just import the CC @amolenaar |
I was wondering if the I think we can move some logic up to the |
Style editor now works on one element, the focused one. The style is updated instantly, but it needs to be added to the style sheet in order to be persisted.
Reverting unneeded changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks so much @FranciscoTGouveia and @0lione! Thanks @amolenaar for the final update - integrating it with the style editor like this is really good idea as well.
@all-contributors please add @FranciscoTGouveia for code |
@FranciscoTGouveia already contributed before to code |
@all-contributors please add @0lione for code |
Instead of using the StyleSheet, one can now use the StyleEditor. The StyleEditor is a GUI that allows to style elements by their name and is coherent with the StyleSheet.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Right now, when we want to change the style of an Element we would need to go on the StyleSheet and reference it by it's name.
Many people aren't familiar with CSS and this can stand in their way while developing their diagrams.
Issue Number: #2136
What is the new behavior?
Instead of using the StyleSheet, one can now use the StyleEditor, a GUI that opens up from a button in the property pages. This allows a user to style their elements with visual cues and abstract themselves from the details of CSS and how it works under the hood.
Does this PR introduce a breaking change?
Working example
Screencast.from.2024-05-28.23-10-07.webm
Important notes
Implementation details to discuss
load
method of Presentation since some Items don't have names.Authors:
Francisco Gouveia: francisco.t.gouveia@tecnico.ulisboa.pt
João Correia: joao.marques.correia@tecnico.ulisboa.pt