Skip to content

Commit 5050926

Browse files
committed
improve file list view
1 parent 49fc23f commit 5050926

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

src/stylesheet.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,7 @@ ol, ul {
191191
min-height: 0;
192192
flex-grow: 1;
193193
}
194+
195+
.text-link {
196+
text-decoration: none;
197+
}

src/ui/panel/DeadCodeView.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let make = (~dispatch, ~locations) => {
55
<div className="filebox">
66
{
77
if (List.length(locations) == 0)
8-
{<h2>{"No dead code found!" |> React.string}</h2>}
8+
{<p>{"No dead code found!" |> React.string}</p>}
99
else {
1010
<ul>
1111
{locations

src/ui/sidebar/gvFileList.re

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ open GoblintCil;
44
let make_func_list = (file, funcs, dispatch) => {
55
let on_click = (data, _) => Option.may(dispatch, data);
66

7-
<ul>
8-
{funcs
9-
|> List.mapi((i, func) => {
10-
<li key={string_of_int(i)}>
11-
<Link on_click callback_data={`DisplayFunc((func, file))}>
12-
{func |> React.string}
13-
</Link>
14-
</li>
15-
})
16-
|> React.list}
17-
</ul>;
7+
{funcs
8+
|> List.mapi((i, func) => {
9+
<li key={"inner" ++ string_of_int(i)} className="list-group-item px-5">
10+
<Link on_click callback_data={`DisplayFunc((func, file))} class_=["text-link"]>
11+
{func |> React.string}
12+
</Link>
13+
</li>
14+
})
15+
|> React.list};
1816
};
1917

2018
[@react.component]
@@ -29,17 +27,19 @@ let make = (~cil: Cil.file, ~dispatch) => {
2927

3028
let on_click = (data, _) => Option.may(dispatch, data);
3129

32-
<ul>
30+
<ul className="list-group">
3331
{files
3432
|> Hashtbl.keys
3533
|> Enum.uniq_by(String.equal)
3634
|> Enum.mapi((i, file) => {
37-
<li key={string_of_int(i)}>
38-
<Link on_click callback_data={`DisplayFile(file)}>
39-
{file |> React.string}
40-
</Link>
35+
<div key={string_of_int(i)}>
36+
<li className="list-group-item">
37+
<Link on_click callback_data={`DisplayFile(file)} class_=["text-link"]>
38+
{file |> React.string}
39+
</Link>
40+
</li>
4141
{make_func_list(file, Hashtbl.find_all(files, file), dispatch)}
42-
</li>
42+
</div>
4343
})
4444
|> List.of_enum
4545
|> React.list}

0 commit comments

Comments
 (0)