Skip to content

Commit ae4ff9d

Browse files
committed
Replace sync-on/off bitmap icon by pure CSS version
1 parent d943608 commit ae4ff9d

File tree

9 files changed

+98
-129
lines changed

9 files changed

+98
-129
lines changed

src/htmlgen.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,11 +1308,8 @@ void HtmlGenerator::writeTabData()
13081308
Doxygen::indexList->addStyleSheetFile("tabs.css");
13091309
QCString dname=Config_getString(HTML_OUTPUT);
13101310
ResourceMgr &mgr = ResourceMgr::instance();
1311-
//writeColoredImgData(dname,colored_tab_data);
13121311
mgr.copyResource("doxygen.svg",dname);
13131312
Doxygen::indexList->addImageFile("doxygen.svg");
1314-
mgr.copyResource("sync_on.luma",dname);
1315-
mgr.copyResource("sync_off.luma",dname);
13161313
}
13171314

13181315
void HtmlGenerator::writeSearchData(const QCString &dname)

src/res2cc_cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def convertToBytes(self,outputFile):
5555
@staticmethod
5656
def factory(directory,subdir,fname):
5757
ext = splitext(fname)[1]
58-
if ext=='.lum':
58+
if ext=='.lum': # TODO: remove this format
5959
return LumFile(directory,subdir,fname)
60-
if ext=='.luma':
60+
if ext=='.luma': # TODO: remove this format
6161
return LumaFile(directory,subdir,fname)
6262
if ext=='.css':
6363
return CSSFile(directory,subdir,fname)

templates/html/darkmode_settings.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@
9494
--nav-arrow-color: ##60;
9595
--nav-arrow-selected-color: ##80;
9696

97+
/* sync icon */
98+
--sync-icon-border-color: ##25;
99+
--sync-icon-background-color: ##10;
100+
--sync-icon-selected-background-color: ##20;
101+
--sync-icon-color: ##45;
102+
--sync-icon-selected-color: ##70;
103+
97104
/* table of contents */
98105
--toc-background-color: ##15;
99106
--toc-border-color: ##24;

templates/html/doxygen.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ h1.groupheader {
2525
}
2626

2727
h2.groupheader {
28-
box-shadow: 8px 0 var(--page-background-color),
28+
box-shadow: 12px 0 var(--page-background-color),
2929
-12px 0 var(--page-background-color),
30-
8px 1px var(--group-header-separator-color),
30+
12px 1px var(--group-header-separator-color),
3131
-12px 1px var(--group-header-separator-color);
3232
color: var(--group-header-color);
3333
font-size: 150%;
@@ -39,9 +39,9 @@ h2.groupheader {
3939
}
4040

4141
td h2.groupheader {
42-
box-shadow: 9px 0 var(--page-background-color),
42+
box-shadow: 13px 0 var(--page-background-color),
4343
-13px 0 var(--page-background-color),
44-
9px 1px var(--group-header-separator-color),
44+
13px 1px var(--group-header-separator-color),
4545
-13px 1px var(--group-header-separator-color);
4646
}
4747

@@ -494,9 +494,9 @@ div.classindex span.ai {
494494
}
495495

496496
div.groupHeader {
497-
box-shadow: 9px 0 var(--page-background-color),
497+
box-shadow: 13px 0 var(--page-background-color),
498498
-13px 0 var(--page-background-color),
499-
9px 1px var(--group-header-separator-color),
499+
13px 1px var(--group-header-separator-color),
500500
-13px 1px var(--group-header-separator-color);
501501
color: var(--group-header-color);
502502
font-size: 110%;
@@ -521,7 +521,7 @@ body {
521521
div.contents {
522522
margin-top: 10px;
523523
margin-left: 12px;
524-
margin-right: 8px;
524+
margin-right: 12px;
525525
}
526526

527527
p.formulaDsp {
@@ -647,9 +647,9 @@ hr {
647647
margin-top: 16px;
648648
margin-bottom: 16px;
649649
height: 1px;
650-
box-shadow: 9px 0 var(--page-background-color),
650+
box-shadow: 13px 0 var(--page-background-color),
651651
-13px 0 var(--page-background-color),
652-
9px 1px var(--group-header-separator-color),
652+
13px 1px var(--group-header-separator-color),
653653
-13px 1px var(--group-header-separator-color);
654654
}
655655

templates/html/lightmode_settings.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@
9898
--nav-arrow-color: ##C0;
9999
--nav-arrow-selected-color: ##A0;
100100
101+
/* sync icon */
102+
--sync-icon-border-color: ##CC;
103+
--sync-icon-background-color: ##FA;
104+
--sync-icon-selected-background-color: ##F0;
105+
--sync-icon-color: ##CC;
106+
--sync-icon-selected-color: ##80;
107+
101108
/* table of contents */
102109
--toc-background-color: ##F6;
103110
--toc-border-color: ##DD;

templates/html/navtree.css

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,84 @@
149149

150150
#nav-sync {
151151
position:absolute;
152-
top:5px;
153-
right:24px;
152+
top:0px;
153+
right:0px;
154154
z-index:0;
155155
}
156156

157157
#nav-sync img {
158158
opacity:0.3;
159159
}
160160

161-
#nav-sync img:hover {
162-
opacity:0.9;
161+
div.nav-sync-icon {
162+
position: relative;
163+
width: 24px;
164+
height: 17px;
165+
left: -6px;
166+
top: -1px;
167+
opacity: 0.7;
168+
display: inline-block;
169+
background-color: var(--sync-icon-background-color);
170+
border: 1px solid var(--sync-icon-border-color);
171+
box-sizing: content-box;
172+
}
173+
174+
div.nav-sync-icon:hover {
175+
background-color: var(--sync-icon-selected-background-color);
176+
opacity: 1.0;
177+
}
178+
179+
div.nav-sync-icon.active:after {
180+
content: '';
181+
background-color: var(--sync-icon-background-color);
182+
border-top: 2px solid var(--sync-icon-color);
183+
position: absolute;
184+
width: 16px;
185+
height: 0px;
186+
top: 7px;
187+
left: 4px;
188+
}
189+
190+
div.nav-sync-icon.active:hover:after {
191+
border-top: 2px solid var(--sync-icon-selected-color);
192+
}
193+
194+
span.sync-icon-left {
195+
position: absolute;
196+
padding: 0;
197+
margin: 0;
198+
top: 3px;
199+
left: 4px;
200+
display: inline-block;
201+
width: 8px;
202+
height: 8px;
203+
border-left: 2px solid var(--sync-icon-color);
204+
border-top: 2px solid var(--sync-icon-color);
205+
transform: rotate(-45deg);
206+
}
207+
208+
span.sync-icon-right {
209+
position: absolute;
210+
padding: 0;
211+
margin: 0;
212+
top: 3px;
213+
left: 10px;
214+
display: inline-block;
215+
width: 8px;
216+
height: 8px;
217+
border-right: 2px solid var(--sync-icon-color);
218+
border-bottom: 2px solid var(--sync-icon-color);
219+
transform: rotate(-45deg);
220+
}
221+
222+
div.nav-sync-icon:hover span.sync-icon-left {
223+
border-left: 2px solid var(--sync-icon-selected-color);
224+
border-top: 2px solid var(--sync-icon-selected-color);
225+
}
226+
227+
div.nav-sync-icon:hover span.sync-icon-right {
228+
border-right: 2px solid var(--sync-icon-selected-color);
229+
border-bottom: 2px solid var(--sync-icon-selected-color);
163230
}
164231

165232
#nav-path ul {

templates/html/navtree.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ function initNavTree(toroot,relpath) {
292292
if ($('#nav-tree-contents .item:first').hasClass('selected')) {
293293
topOffset+=25;
294294
}
295-
$('#nav-sync').css('top',topOffset+'px');
296295
showRoot();
297296
}
298297

@@ -386,11 +385,11 @@ function initNavTree(toroot,relpath) {
386385
}
387386

388387
const showSyncOff = function(n,relpath) {
389-
n.html('<img src="'+relpath+'sync_off.png" title="'+SYNCOFFMSG+'"/>');
388+
n.html('<div class="nav-sync-icon" title="'+SYNCOFFMSG+'"><span class="sync-icon-left"></span><span class="sync-icon-right"></span></div>');
390389
}
391390

392391
const showSyncOn = function(n,relpath) {
393-
n.html('<img src="'+relpath+'sync_on.png" title="'+SYNCONMSG+'"/>');
392+
n.html('<div class="nav-sync-icon active" title="'+SYNCONMSG+'"/><span class="sync-icon-left"></span><span class="sync-icon-right"></span></div>');
394393
}
395394

396395
const o = {

templates/html/sync_off.luma

Lines changed: 0 additions & 54 deletions
This file was deleted.

templates/html/sync_on.luma

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)