Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

File History Window #999

Merged
merged 27 commits into from
Feb 13, 2019
Merged

File History Window #999

merged 27 commits into from
Feb 13, 2019

Conversation

StanleyGoldman
Copy link
Contributor

Building upon work started in #948 by @sambonfire

2019-01-17_14-45-50

@sambonfire
Copy link
Contributor

holy crap this is looking awesome.

@StanleyGoldman
Copy link
Contributor Author

StanleyGoldman commented Jan 18, 2019

😄 Glad you like it.

@StanleyGoldman StanleyGoldman mentioned this pull request Jan 23, 2019
@StanleyGoldman
Copy link
Contributor Author

image

@donokuda: #961 (comment)

👋Adding a little more clarity to what I was thinking with my mock-up. For the most part, everything that is already built is kept as is (including having the file history appear as a separate window.)

The main thing was making the header feel more like the Unity inspector where we show the file's large icon in the header as well as the filename. Clicking the "Show in Project" button would highlight the file in the project pane (which is the current functionality of clicking the "GIT File history for [filepath]" link)

❓Something I'm not 100% sure about is whether it makes sense to show the full path or just the filename. The benefit for the full path is that it ensures that we're looking at the right file and where it's located. The downside is that we can run out of space quickly. Right now, I'm leaning towards showing just the file name since the "Show in Project" button could also be a compromise that's already built.

@StanleyGoldman
Copy link
Contributor Author

Some action shots

2019-02-12_11-30-53

2019-02-12_11-32-58

@donokuda
Copy link
Contributor

😍This is looking so good and thanks for posting a gif of it in action! The only thing I can pick out is that the "Show in Project" button gets bumped to outside of the interface:

screen shot 2019-02-12 at 9 52 49 am

I'm assuming that it has something to do with the FlexibleSpace() pushing the BeginVerticalGroup() to the side.

I took an attempt at re-writing the DoHeaderGUI() method with something that might fix the button issue, except I haven't tested it myself locally because it's been well over a year since I've touched the project:

private void DoHeaderGUI() {
  GUILayout.BeginHorizontal(Styles.HeaderBoxStyle);
  {
    var iconWidth = 32;
    var iconHeight = 32;

    GUILayout.Label(selectedIcon, GUILayout.Height(iconWidth), GUILayout.Width(iconHeight));
    GUILayout.Space(16);

    GUILayout.BeginVertical();
    {
      GUILayout.Label(selectedObjectAssetPath, Styles.FileHistoryLogTitleStyle);

      GUILayout.BeginHorizontal();
      {
        GUILayout.FlexibleSpace();

        if (GUILayout.Button("Show in Project"))
        {
            EditorGUIUtility.PingObject(selectedObject);
        }
      }
      GUILayout.EndHorizontal();
    }
    GUILayout.EndVertical();
  }
  GUILayout.EndHorizontal();
}

Would anyone be able to push a tweak for this? If not, I can take this on, but I'll need some time to get my environment set up again.

Co-authored-by: Don Okuda <don.okuda@gmail.com>
@StanleyGoldman
Copy link
Contributor Author

@donokuda as always you work miracles. I also made sure you get credit for that code.

2019-02-13_08-22-17

@StanleyGoldman StanleyGoldman requested a review from shana February 13, 2019 13:24
Copy link
Member

@shana shana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a couple of comments! 👍

@StanleyGoldman
Copy link
Contributor Author

@sambonfire let me know if there is anything you'd like to change about this before it goes in.

@meaghanlewis
Copy link
Contributor

This functionality looks good to me @StanleyGoldman 👍

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

Successfully merging this pull request may close these issues.

5 participants