-
Notifications
You must be signed in to change notification settings - Fork 855
Rework toolbar design #5706
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
Rework toolbar design #5706
Conversation
Improved the toolbar dropdown button design
Take the left separator into account for popup alignment and prefer bottom left or top left alignment.
…e the popup is visible
…ment issue The remaining issue is when the window spans on two screens (even if it's only 1px)
When the VFX Graph window is docked (because then it's destroyed and recreated)
Also always keep the help dropdown enabled and moved the "back" button to the right of the attach buttons. Dropdown buttons are now grayed out when disabled
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. VFX Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
It appears that you made a non-draft PR! |
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.
Looking good! All the raised issues are fixed, couldn't find anything outstanding on the last QA pass. 🟢
Thanks for the great PR, new toolbar looking very elegant in VFX window!
|
||
if (!graphView.TryAttachTo(effectToAttach)) | ||
{ | ||
s_LastAttachedComponent = null; |
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.
The introduction of this static variable was done to fix a bug when "unmaximizing" the window. Because in that process the window is recreated and then losing the attachment.
graphView.UpdateIsSubgraph(); | ||
} | ||
|
||
public bool CanPopResource() |
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.
I introduced a "back" button when we entered a subgraph, this is to know if the button should be displayed or not
@@ -0,0 +1,197 @@ | |||
using System; |
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 is a reusable class to add dropdowns (a button and an arrow button to open a popup).
It's used three times in this PR
m_PopupClosedTimestamp = DateTime.UtcNow; | ||
} | ||
|
||
private void OnKeyUp(KeyUpEvent evt) |
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.
These last three methods were added to handle keyboard navigation (either with Tab or arrow keys). This was requested by UX designers
{ | ||
string path = string.Format("{0}/VFX/{1}.png", VisualEffectAssetEditorUtility.editorResourcesPath, text); | ||
return AssetDatabase.LoadAssetAtPath<Texture2D>(path); | ||
return EditorGUIUtility.LoadIcon(path); |
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 change has nothing to do with the PR, but while managing icons I discovered that our icons were blurred in the graph because only the low res (16px) versions were used. Now if relevant it uses the @2x version.
[NonSerialized] | ||
List<IconBadge> m_CompileBadges = new List<IconBadge>(); | ||
|
||
private void SetToolbarEnabled(bool enabled) |
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.
Even when no asset is opened we want the help button to stay available, so we don't disable the whole toolbar anymore
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.
A very few non blocking remarks. Approved
com.unity.visualeffectgraph/Editor/GraphView/VFXComponentBoard.cs
Outdated
Show resolved
Hide resolved
com.unity.visualeffectgraph/Editor/GraphView/Views/VFXCompileDropdownButton.cs
Show resolved
Hide resolved
…olbar-design-2' into vfx/feature/GVFXG-143-improve-toolbar-design-2
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.
No docs changes in this PR :)
Purpose of this PR
Jira
https://jira.unity3d.com/browse/GVFXG-143
Design docs
https://docs.google.com/document/d/1oG7-tKzlEDqQCRnw0KVsRqldVUyTY5gBfVuF-5tPx2Q/edit
https://docs.google.com/document/d/1VS4LKjZmfx40kutvb39h3sIL6UCSM9m92IxuluxGTeI/edit#
⚠This PR is a duplicate of this PR #5671 which I merged too soon by accident.
Before


After
Testing status
Tested on dark and light themes with 100% and 150% DPI screens
Comments to reviewers
Known bug: when DPI is different than 100% the drop down popups can be position at a "not ideal" position.
The bug is most probably on UIToolkit side. I warned the #dev-uitoolkit channel about it