Skip to content

Commit fb32a22

Browse files
authored
Merge pull request #7 from StansAssets/feature/sample-icon
fix: Update sample icon for IMGUISampleSceneUrl
2 parents 59c97a4 + c31f780 commit fb32a22

File tree

11 files changed

+287
-6
lines changed

11 files changed

+287
-6
lines changed
599 Bytes
Loading

com.stansassets.plugins-dev-kit/Editor/Art/Icons/Generic/sample_dark.png.meta

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
608 Bytes
Loading

com.stansassets.plugins-dev-kit/Editor/Art/Icons/Generic/sample_light.png.meta

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

com.stansassets.plugins-dev-kit/Editor/IMGUI/Controls/IMGUISampleSceneUrl.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using UnityEditor;
23
using UnityEditor.SceneManagement;
34
using UnityEngine;
45

@@ -13,7 +14,7 @@ public class IMGUISampleSceneUrl : IMGUIHyperLabel
1314
public IMGUISampleSceneUrl(string title, string scenePath)
1415
: base(new GUIContent(
1516
title,
16-
PluginsEditorSkin.GetGenericIcon("list_arrow_white.png") //TODO unity scene Icon
17+
PluginsEditorSkin.GetGenericIcon((EditorGUIUtility.isProSkin)? "sample_dark.png" : "sample_light.png")
1718
),
1819
SettingsWindowStyles.DescriptionLabelStyle)
1920
{

com.stansassets.plugins-dev-kit/Editor/UIToolkit/DocumentationTab/DocumentationTab.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class DocumentationTab : BaseTab
1515
[SerializeField]
1616
List<VisualElement> m_DocUrls = new List<VisualElement>();
1717
[SerializeField]
18-
List<Button> m_SampleUrls = new List<Button>();
18+
List<VisualElement> m_SampleUrls = new List<VisualElement>();
1919
[SerializeField]
2020
List<VisualElement> m_DocTop = new List<VisualElement>();
2121
[SerializeField]
@@ -65,9 +65,14 @@ VisualElement DocumentationItem(string nameItem, string link)
6565
return item;
6666
}
6767

68-
Button SampleItem(string nameItem, string link)
68+
VisualElement SampleItem(string nameItem, string link)
6969
{
70-
var item = new Button { text = $"{nameItem}" };
70+
var labelIcon = new Label();
71+
labelIcon.AddToClassList("sample-icon");
72+
var label = new Label { text = $"{nameItem}" };
73+
var item = new Button();
74+
item.Add(labelIcon);
75+
item.Add(label);
7176
item.clicked += () =>
7277
{
7378
EditorSceneManager.OpenScene(link);

com.stansassets.plugins-dev-kit/Editor/UIToolkit/DocumentationTab/DocumentationTab.uss

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,20 @@ SettingsBlock {
88
}
99

1010
.sample-btn {
11-
margin: 0 0 10px 15px;
11+
margin: 5px 5px 0 0;
12+
background-color: initial;
13+
border-width: 0;
14+
width: auto;
15+
flex-shrink: 0;
16+
flex-direction: row;
17+
flex-grow: 1;
18+
}
19+
20+
.sample-btn:hover Label,
21+
.sample-btn:hover VisualElement {
22+
-unity-background-image-tint-color: cornflowerblue;
23+
color: cornflowerblue;
24+
cursor: link;
1225
}
1326

1427
.top-panel {
@@ -17,7 +30,6 @@ SettingsBlock {
1730
}
1831

1932
.doc-panel {
20-
padding-left: 10px;
2133
flex-wrap: wrap;
2234
flex-direction: row;
2335
}
@@ -34,4 +46,10 @@ SettingsBlock {
3446

3547
.id-sample-text {
3648
margin-left: 0;
49+
}
50+
51+
.sample-icon {
52+
width: 15px;
53+
margin-right: 1px;
54+
background-image: url('../../Art/Icons/Generic/sample_dark.png');
3755
}

com.stansassets.plugins-dev-kit/Editor/UIToolkit/DocumentationTab/DocumentationTabDark.uss

Whitespace-only changes.

com.stansassets.plugins-dev-kit/Editor/UIToolkit/DocumentationTab/DocumentationTabDark.uss.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.sample-icon {
2+
background-image: url('../../Art/Icons/Generic/sample_light.png');
3+
}

0 commit comments

Comments
 (0)