Site Navigation Bar

David Faure dfaure at trolltech.com
Tue May 13 23:15:12 BST 2003


On Tuesday 13 May 2003 22:47, Marcus Camen wrote:
> This example illustrates how several LINK definitions may appear in the HEAD 
> section of a document. The current document is "Chapter2.html". The rel 
> attribute specifies the relationship of the linked document with the current 
> document. The values "Index", "Next", and "Prev" are explained in the section 
> on link types.
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>    "http://www.w3.org/TR/html4/strict.dtd">
> <HTML>
> <HEAD>
>   <TITLE>Chapter 2</TITLE>
>   <LINK rel="Index" href="../index.html">
>   <LINK rel="Next"  href="Chapter3.html">
>   <LINK rel="Prev"  href="Chapter1.html">
> </HEAD>
> 
> --- SNIP
> 
> And there are even more special tags for 'table of contents', 'authors', 
> 'copyright', 'related links', etc.

Ah I see, very nice.

> Hmmm...
> Browsing the KDE API docs would be really great if the HTML code would include 
> the HTML LINK tags...   ;-)

File a doxygen wishlist :)

> The navigation bar should only be visible if the webpage does include the
>   <!ATTRLIST LINK
> elements. In addition we need an option to show it never or always.

That's easy enough:
 Get hold of the mainwindow (topLevelWidget() for instance), and
 KToolBar * bar = static_cast<KToolBar *>( mw->child( "myToolBarName", "KToolBar" ) );
 bar->hide() or bar->show()
(That's pretty much what KonqMainWindow does about the bookmarkToolBar)

Careful with splitted views though, a view should only act on the toplevel
window if it's the current one, and switching between views should hide/show
it again (an event filter on the view, to filter for focusevent, from the plugin, should do it).

-- 
David FAURE, faure at kde.org, sponsored by TrollTech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html




More information about the kfm-devel mailing list