From 956a7fb004e72923f737e387d053812f99b7bda2 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Thu, 2 Jan 2014 15:36:05 +0100 Subject: Improved performance of rendering large index pages, by replacing images in the tables by spans --- src/doxygen.css | 80 +++++++++++++++++++++++++++++++++++-- src/dynsections.js | 54 ++++++++++++------------- src/ftvhelp.cpp | 115 +++++++++++++++-------------------------------------- src/ftvhelp.h | 2 +- 4 files changed, 136 insertions(+), 115 deletions(-) diff --git a/src/doxygen.css b/src/doxygen.css index 3c981f3..2f4bf70 100644 --- a/src/doxygen.css +++ b/src/doxygen.css @@ -670,12 +670,12 @@ span.mlabel { /* @end */ -/* these are for tree view when not used as main index */ +/* these are for tree view inside a (index) page */ div.directory { margin: 10px 0px; - border-top: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; + border-top: 1px solid ##AA; + border-bottom: 1px solid ##AA; width: 100%; } @@ -734,6 +734,80 @@ div.directory { color: ##50; } +.arrow { + color: ##AA; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: ##88; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('ftv2folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('ftv2folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('ftv2doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + div.dynheader { margin-top: 8px; -webkit-touch-callout: none; diff --git a/src/dynsections.js b/src/dynsections.js index ed092c7..85e1836 100644 --- a/src/dynsections.js +++ b/src/dynsections.js @@ -24,19 +24,20 @@ function updateStripes() $('table.directory tr'). removeClass('even').filter(':visible:even').addClass('even'); } + function toggleLevel(level) { - $('table.directory tr').each(function(){ + $('table.directory tr').each(function() { var l = this.id.split('_').length-1; var i = $('#img'+this.id.substring(3)); var a = $('#arr'+this.id.substring(3)); if (lparent) + int indent=0; + FTVNode *p = n->parent; + while (p) { indent++; p=p->parent; } + if (n->isDir) { - generateIndent(t,n->parent,level+1,opened); + QCString dir = opened ? "▼" : "►"; + t << " " + << "" << dir + << ""; } - // from the root up to node n do... - if (level==0) // item before a dir or document + else { - if (n->isLast) - { - if (n->isDir) - { - t << ""; - } - else - { - t << ""; - } - } - else - { - if (n->isDir) - { - t << ""; - } - else - { - t << ""; - } - } - } - else // item at another level - { - if (n->isLast) - { - t << ""; - } - else - { - t << ""; - } + t << " "; } } @@ -912,7 +875,7 @@ void FTVHelp::generateTree(FTextStream &t, const QList &nl,int level,in index++; t << ">"; bool nodeOpened = level+1isDir) { if (n->def && n->def->definitionType()==Definition::TypeGroup) @@ -925,29 +888,19 @@ void FTVHelp::generateTree(FTextStream &t, const QList &nl,int level,in } else if (n->def && n->def->definitionType()==Definition::TypeNamespace) { - t << ""; + t << "N"; } else if (n->def && n->def->definitionType()==Definition::TypeClass) { - t << ""; + t << "C"; } else { - t << ""; + t << " "; } generateLink(t,n); t << ""; @@ -983,21 +936,15 @@ void FTVHelp::generateTree(FTextStream &t, const QList &nl,int level,in } else if (n->def && n->def->definitionType()==Definition::TypeNamespace) { - t << ""; + t << "N"; } else if (n->def && n->def->definitionType()==Definition::TypeClass) { - t << ""; + t << "C"; } else { - t << ""; + t << ""; } if (srcRef) { diff --git a/src/ftvhelp.h b/src/ftvhelp.h index 9794d8b..b37314e 100644 --- a/src/ftvhelp.h +++ b/src/ftvhelp.h @@ -64,7 +64,7 @@ class FTVHelp : public IndexIntf //bool generateJSTree(FTextStream &tidx,FTextStream &t,const QList &nl,int level,bool &first); //bool generateJSTreeTopLevel(FTextStream &tidx,FTextStream &t,const QList &nl,int level,bool &first); QCString generateIndentLabel(FTVNode *n,int level); - void generateIndent(FTextStream &t,FTVNode *n,int level,bool opened); + void generateIndent(FTextStream &t,FTVNode *n,bool opened); void generateLink(FTextStream &t,FTVNode *n); //void generateJSLink(FTextStream &t,FTVNode *n); QList *m_indentNodes; -- cgit v0.12