Skip to content

Commit c2af43b

Browse files
author
haoguo
committed
update
1 parent 4194232 commit c2af43b

File tree

8 files changed

+159
-6
lines changed

8 files changed

+159
-6
lines changed

Assembly-CSharp.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<Compile Include="Assets\Scripts\Bridge.cs" />
6161
<Compile Include="Assets\Scripts\Components\Banner.cs" />
6262
<Compile Include="Assets\Scripts\Components\Breadcrumb.cs" />
63+
<Compile Include="Assets\Scripts\Components\Content.cs" />
6364
<Compile Include="Assets\Scripts\Components\EditButton.cs" />
6465
<Compile Include="Assets\Scripts\Components\Footer.cs" />
6566
<Compile Include="Assets\Scripts\Components\Header.cs" />
@@ -72,6 +73,7 @@
7273
<Compile Include="Assets\Scripts\Components\ModifiedInfo.cs" />
7374
<Compile Include="Assets\Scripts\Components\RelatedArticles.cs" />
7475
<Compile Include="Assets\Scripts\Components\SearchBar.cs" />
76+
<Compile Include="Assets\Scripts\Components\SearchFilter.cs" />
7577
<Compile Include="Assets\Scripts\DocCNApp.cs" />
7678
<Compile Include="Assets\Scripts\ExampleCanvas.cs" />
7779
<Compile Include="Assets\Scripts\Markdown\Token.cs" />

Assets/Scripts/Components/Content.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Collections.Generic;
2+
using Unity.UIWidgets.painting;
3+
using Unity.UIWidgets.ui;
4+
using Unity.UIWidgets.widgets;
5+
6+
namespace DocCN.Components
7+
{
8+
public class Content<T> : StatelessWidget where T : Widget
9+
{
10+
public Content(T child)
11+
{
12+
this.child = child;
13+
}
14+
15+
private readonly T child;
16+
17+
public override Widget build(BuildContext context)
18+
{
19+
return new Container(
20+
padding: EdgeInsets.only(top: 16f, right: 48f, bottom: 48f, left: 48f),
21+
color: new Color(0xfff2f1f2),
22+
child: child
23+
);
24+
}
25+
}
26+
}

Assets/Scripts/Components/Content.cs.meta

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

Assets/Scripts/Components/SearchBar.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
using System.Collections.Generic;
2+
using DocCN.Style;
23
using Unity.UIWidgets.foundation;
4+
using Unity.UIWidgets.material;
35
using Unity.UIWidgets.painting;
6+
using Unity.UIWidgets.rendering;
47
using Unity.UIWidgets.ui;
58
using Unity.UIWidgets.widgets;
69

@@ -17,16 +20,27 @@ public SearchBar() : base(new ObjectKey("search-bar"))
1720

1821
internal class SearchBarState : State<SearchBar>
1922
{
23+
private static readonly BorderSide FILTER_BORDER_SIDE =
24+
new BorderSide(width: 2.0f, color: new Color(0xff424242));
25+
2026
public override Widget build(BuildContext context)
2127
{
2228
return new Container(
23-
padding: EdgeInsets.only(top: 8.0f, right: 48.0f, bottom: 8.0f, left: 56.0f),
29+
padding: EdgeInsets.only(top: 8.0f, right: 48.0f, bottom: 8.0f, left: 48.0f),
2430
color: new Color(0xff212121),
2531
child: new Row(
2632
children: new List<Widget>
2733
{
2834
new Container(
29-
width: 124.0f,
35+
width: 132.0f,
36+
height: 56.0f,
37+
decoration: new BoxDecoration(
38+
border: new Border(
39+
top: FILTER_BORDER_SIDE,
40+
left: FILTER_BORDER_SIDE,
41+
bottom: FILTER_BORDER_SIDE
42+
)
43+
),
3044
child: new Column(
3145
)
3246
),
@@ -36,6 +50,12 @@ public override Widget build(BuildContext context)
3650
color: new Color(0xff424242)
3751
)
3852
),
53+
new Container(
54+
width: 56.0f,
55+
height: 56.0f,
56+
color: new Color(0xff565656),
57+
child: null
58+
)
3959
}
4060
)
4161
);
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
using System.Collections.Generic;
2+
using Unity.UIWidgets.painting;
3+
using Unity.UIWidgets.rendering;
4+
using Unity.UIWidgets.ui;
5+
using Unity.UIWidgets.widgets;
6+
using TextStyle = Unity.UIWidgets.painting.TextStyle;
7+
8+
namespace DocCN.Components
9+
{
10+
public class SearchFilter : StatelessWidget
11+
{
12+
public override Widget build(BuildContext context)
13+
{
14+
return new Container(
15+
width: 380.0f,
16+
child: new Column(
17+
children: new List<Widget>
18+
{
19+
new Container(
20+
height: 56.0f,
21+
padding: EdgeInsets.only(left: 48f, right: 12f),
22+
margin: EdgeInsets.only(bottom: 4f),
23+
decoration: new BoxDecoration(
24+
color: new Color(0xffffffff),
25+
borderRadius: BorderRadius.circular(4.0f)
26+
),
27+
child: new Row(
28+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
29+
children: new List<Widget>
30+
{
31+
new Text(
32+
"搜索结果筛选",
33+
style: new TextStyle(
34+
fontSize: 16f,
35+
color: new Color(0xff212121),
36+
fontWeight: FontWeight.w700
37+
)
38+
),
39+
new Text(
40+
"清除所选",
41+
style: new TextStyle(
42+
fontSize: 14f,
43+
color: new Color(0xff00cccc)
44+
)
45+
)
46+
}
47+
)
48+
),
49+
new FilterItem()
50+
}
51+
)
52+
);
53+
}
54+
}
55+
56+
internal class FilterItem : StatelessWidget
57+
{
58+
public override Widget build(BuildContext context)
59+
{
60+
return new Container(
61+
margin: EdgeInsets.only(top: 8f),
62+
decoration: new BoxDecoration(
63+
new Color(0xffffffff),
64+
borderRadius: BorderRadius.circular(4f)
65+
),
66+
height: 48f,
67+
padding: EdgeInsets.only(left: 16f, right: 32f),
68+
child: new Row(
69+
children: new List<Widget>
70+
{
71+
new Container(
72+
height: 16f,
73+
width: 16f,
74+
margin: EdgeInsets.only(right: 16f)
75+
),
76+
new Expanded(
77+
child: new Text(
78+
"离线部署Unity",
79+
style: new TextStyle(
80+
color: new Color(0xff212121),
81+
fontSize: 16f
82+
)
83+
)
84+
),
85+
new Container(
86+
width: 16f,
87+
height: 16f,
88+
color: new Color(0xff00cccc)
89+
)
90+
}
91+
)
92+
);
93+
}
94+
}
95+
}

Assets/Scripts/Components/SearchFilter.cs.meta

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

Assets/Scripts/DocCNApp.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
using System.Collections.Generic;
2-
using DocCN.Components;
31
using DocCN.Page;
42
using Unity.UIWidgets.foundation;
5-
using Unity.UIWidgets.painting;
6-
using Unity.UIWidgets.rendering;
73
using Unity.UIWidgets.ui;
84
using Unity.UIWidgets.widgets;
95
using Resources = UnityEngine.Resources;

Assets/Scripts/Page/SearchPage.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ public override Widget build(BuildContext context)
1313
{
1414
new Header(),
1515
new SearchBar(),
16+
new Content<Row>(
17+
child: new Row(
18+
children: new List<Widget>
19+
{
20+
new SearchFilter(),
21+
}
22+
)
23+
),
1624
new Footer(),
1725
}
1826
);

0 commit comments

Comments
 (0)