Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.

Commit

Permalink
skip-bump: Load Stylesheet manually for 2019.4
Browse files Browse the repository at this point in the history
  • Loading branch information
connffuused committed Nov 24, 2021
1 parent 1a92207 commit ce10c06
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
9 changes: 5 additions & 4 deletions Editor/UI Toolkit/Layouts/ReferenceViewer.uxml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
<Style src="project://database/Packages/com.calci.assetlens/Editor/UI%20Toolkit/Stylesheets/ReferenceViewer.uss?fileID=7433441132597879392&amp;guid=3638da1b0ab74674b9b4a67d928927af&amp;type=3#ReferenceViewer" />
<Style src="project://database/Packages/com.calci.assetlens/Editor/UI%20Toolkit/Components/SwitchToggle.uss?fileID=7433441132597879392&amp;guid=7c390d666cc3d3b40a39b9b26febbbd2&amp;type=3#SwitchToggle" />
<Style src="project://database/Packages/com.calci.assetlens/Editor/UI%20Toolkit/Components/TopBar.uss?fileID=7433441132597879392&amp;guid=980ba0d854994fb438f65d175798dbac&amp;type=3#TopBar" />
<!-- <Style src="project://database/Packages/com.calci.assetlens/Editor/UI%20Toolkit/Stylesheets/ReferenceViewer.uss?fileID=7433441132597879392&amp;guid=3638da1b0ab74674b9b4a67d928927af&amp;type=3#ReferenceViewer" />-->
<!-- <Style src="project://database/Packages/com.calci.assetlens/Editor/UI%20Toolkit/Components/SwitchToggle.uss?fileID=7433441132597879392&amp;guid=7c390d666cc3d3b40a39b9b26febbbd2&amp;type=3#SwitchToggle" />-->
<!-- <Style src="project://database/Packages/com.calci.assetlens/Editor/UI%20Toolkit/Components/TopBar.uss?fileID=7433441132597879392&amp;guid=980ba0d854994fb438f65d175798dbac&amp;type=3#TopBar" />-->
<ui:VisualElement name="root" class="root">
<ui:VisualElement name="top" style="flex-direction: row;">
<ui:VisualElement name="ci" style="min-width: 50%; padding-top: 4px; padding-bottom: 4px;">
Expand All @@ -14,7 +14,8 @@
</ui:VisualElement>
<ui:VisualElement name="selection-container" class="selection-container">
<uie:ObjectField name="selection-field" label="Selected" allow-scene-objects="false" />
<ui:HelpBox name="no-selection-helpbox" text="no-selection-helpbox" message-type="Info" />
<ui:VisualElement name="help-box-container"/>
<!-- <ui:HelpBox name="no-selection-helpbox" text="no-selection-helpbox" message-type="Info" />-->
<ui:VisualElement name="selection-info" class="dark-container">
<ui:Label text="version-info" display-tooltip-when-elided="true" name="version-info" />
<ui:Label text="modification-info" display-tooltip-when-elided="true" name="modification-info" />
Expand Down
13 changes: 12 additions & 1 deletion Editor/UI/EditorWindow/ReferenceViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ internal sealed class ReferenceViewer : AssetLensEditorWindow
protected override void Constructor()
{
LoadLayout("ReferenceViewer");
LoadStylesheet("ReferenceViewer");

string path = FileSystem.ComponentDirectory + "TopBar.uss";
StyleSheet styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>(path);
root.styleSheets.Add(styleSheet);

path = FileSystem.ComponentDirectory + "Header.uss";
styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>(path);
root.styleSheets.Add(styleSheet);

QueryElements();
InitElements();
Expand Down Expand Up @@ -96,7 +105,9 @@ private void QueryElements()
used_by_label = root.Q<Label>("used-by-label");

#if UNITY_2020_1_OR_NEWER
no_selection = root.Q<HelpBox>("no-selection-helpbox");
// no_selection = root.Q<HelpBox>("no-selection-helpbox");
no_selection = new HelpBox();
root.Q<VisualElement>("help-box-container").Add(no_selection);
#endif
additional_info = root.Q<VisualElement>("selection-info");

Expand Down

0 comments on commit ce10c06

Please sign in to comment.