Content-Length: 408394 | pFad | http://github.com/doxygen/doxygen/commit/1fa0abee3b77e9a7c9edb23ce40beb3f1f6f0840

3C Use icons instead of words for search result types · doxygen/doxygen@1fa0abe · GitHub
Skip to content

Commit 1fa0abe

Browse files
committed
Use icons instead of words for search result types
1 parent d7601a9 commit 1fa0abe

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

src/htmlgen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@ static QCString substituteHtmlKeywords(const QCString &str,
420420
if (!serverBasedSearch)
421421
{
422422
searchCssJs += "<script type=\"text/javascript\" src=\"$relpath^search/searchdata.js\"></script>\n";
423+
} else {
424+
searchCssJs += "<link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0\" />";
423425
}
424426
searchCssJs += "<script type=\"text/javascript\" src=\"$relpath^search/search.js\"></script>\n";
425427

templates/html/extsearch.js

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,60 @@ function searchFor(query,page,count) {
7878
$.each(data.items, function(i,item){
7979
let prefix = tagMap[item.tag];
8080
if (prefix) prefix+='/'; else prefix='';
81+
82+
icon = "asterisk";
83+
84+
if (item.type == "dir")
85+
icon = "folder";
86+
else if (item.type == "package")
87+
icon = "folder_zip";
88+
else if (item.type == "namespace")
89+
icon = "clarify";
90+
91+
else if (item.type == "file")
92+
icon = "description";
93+
else if (item.type == "page")
94+
icon = "article";
95+
else if (item.type == "group")
96+
icon = "full_coverage";
97+
else if (item.type == "source")
98+
icon = "code";
99+
100+
else if (item.type == "function")
101+
icon = "data_object";
102+
else if (item.type == "variable")
103+
icon = "variables";
104+
else if (item.type == "property")
105+
icon = "list_alt";
106+
else if (item.type == "typedef")
107+
icon = "numbers";
108+
else if (item.type == "define")
109+
icon = "numbers";
110+
else if (item.type == "enum")
111+
icon = "data_array";
112+
else if (item.type == "enumvalue")
113+
icon = "data_array";
114+
115+
else if (item.type == "event")
116+
icon = "overview";
117+
else if (item.type == "related")
118+
icon = "read_more";
119+
else if (item.type == "friend")
120+
icon = "contact_page";
121+
else if (item.type == "slot")
122+
icon = "location_chip";
123+
else if (item.type == "signal")
124+
icon = "data_alert";
125+
81126
r+='<tr class="searchresult">'+
82127
'<td align="right">'+(data.first+i+1)+'.</td>'+
83-
'<td>'+escapeHtml(item.type)+'&#160;'+
84-
'<a href="'+escapeHtml(prefix+item.url)+
128+
'<td><a href="'+escapeHtml(prefix+item.url)+
85129
'">'+escapeHtml(item.name)+'</a>';
86130
if (item.type=="source") {
87131
const l=item.url.match(/[1-9][0-9]*$/);
88132
if (l) r+=' at line '+parseInt(l[0]);
89133
}
90-
r+='</td>';
134+
r+='<span class="material-symbols-outlined">'+icon+'</span></td>';
91135
for (let i=0;i<item.fragments.length;i++) {
92136
r+='<tr><td></td><td>'+item.fragments[i]+'</td></tr>';
93137
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/doxygen/doxygen/commit/1fa0abee3b77e9a7c9edb23ce40beb3f1f6f0840

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy