Skip to content

Conversation

julienamsellem
Copy link
Contributor

@julienamsellem julienamsellem commented Sep 17, 2021

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
old-toolbar
After
new-toolbar


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

Improved the toolbar dropdown button design
Take the left separator into account for popup alignment and prefer bottom left or top left alignment.
…ment issue

The remaining issue is when the window spans on two screens (even if it's only 1px)
@github-actions
Copy link

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.
Link to Yamato: https://yamato.cds.internal.unity3d.com/jobs/902-Graphics
Search for your PR branch using the sidebar on the left, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

VFX
/.yamato%252Fall-vfx.yml%2523PR_VFX_trunk

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.

@github-actions
Copy link

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page).
See the PR template for more information.
Thank you!

Copy link

@VitaVFX VitaVFX left a 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!

Test Doc

@VitaVFX VitaVFX changed the title Vfx/feature/gvfxg 143 improve toolbar design 2 Rework toolbar design Sep 17, 2021

if (!graphView.TryAttachTo(effectToAttach))
{
s_LastAttachedComponent = null;
Copy link
Contributor Author

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()
Copy link
Contributor Author

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;
Copy link
Contributor Author

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)
Copy link
Contributor Author

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);
Copy link
Contributor Author

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)
Copy link
Contributor Author

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

Copy link
Contributor

@iTris666 iTris666 left a 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

Copy link
Contributor

@Vic-Cooper Vic-Cooper left a 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 :)

@julienamsellem julienamsellem merged commit fd214da into master Sep 22, 2021
@julienamsellem julienamsellem deleted the vfx/feature/GVFXG-143-improve-toolbar-design-2 branch September 22, 2021 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants