Skip to content

Commit 9189636

Browse files
fix: fixed style for sample item
1 parent 3fb5c78 commit 9189636

File tree

6 files changed

+52
-5
lines changed

6 files changed

+52
-5
lines changed

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: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,19 @@ 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+
}
18+
19+
.sample-btn:hover Label,
20+
.sample-btn:hover VisualElement {
21+
-unity-background-image-tint-color: cornflowerblue;
22+
color: cornflowerblue;
23+
cursor: link;
1224
}
1325

1426
.top-panel {
@@ -17,7 +29,6 @@ SettingsBlock {
1729
}
1830

1931
.doc-panel {
20-
padding-left: 10px;
2132
flex-wrap: wrap;
2233
flex-direction: row;
2334
}
@@ -34,4 +45,10 @@ SettingsBlock {
3445

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

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+
}

com.stansassets.plugins-dev-kit/Editor/UIToolkit/DocumentationTab/DocumentationTabLight.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.

0 commit comments

Comments
 (0)