Metabar and weird templates

Konqueror with small Metabar panelThe other day I was playing with the Konqueror Metabar. The metabar is a handy little sidebar panel that gives you information on the selected file or directory, provides quick access links to the KDE "open with" and "actions" menus, file previews, and some other features. However, the default metabar theme in Kubuntu is kind of annoying in that, as this screen shot shows, when the panel is too small, long lines wrap over other lines and make the text basically unreadable.

So I tried building my own theme. Since the theme system is based on KHTML, you can build a theme using HTML, CSS, and JavaScript. It's just that it's weird HTML. Here's a sample of what the code for the "open with" panel looks like:
<div class="frame">
<div class="head"><a i18n image="run" class="title" onClick="this.blur();" hr
ef="function://toggle/open">Open With</a></div>
<li id="open" expanded="true" style="height:0px">
</li>
</div>

Note that the README for the Metabar code said not to change this markup.

My initial reaction to this was, naturally, "What the hell is this?!" Not only is this non-semantic, not only is it invalid, but it doesn't even make sense! Why the lone LI hanging out in the middle of the DIV? It's obviously where Metabar is injecting the KDE "open with" items, but why is it an LI? I would have thought a UL or another DIV would make more sense. What is Metabar injecting anyway?

I never did get a good layout. I couldn't seem to get the panels to correctly resize. All I really wanted was for them to expand to fit their contents. It should have been as simple as a "height: auto", but for some reason, it just didn't work. I'm not sure why - there didn't seem to be anything in the stylesheet that would interfere with that. Though it's hard to be sure without knowing exactly what the application is adding to the markup.

It might possibly have been something built-in to the binary. The default theme certainly seemed to be. The application's theme directory only contained one theme, and it wasn't the Kubuntu one. I guess I'll have to go to the source to figure out that one. Presumably Metabar is in one of the KDE add-on packages. I just have to figure out which one.

You can reply to this entry by leaving a comment below. This entry accepts Pingbacks from other blogs. You can follow comments on this entry by subscribing to the RSS feed.

Add your comments #

A comment body is required. No HTML code allowed. URLs starting with http:// or ftp:// will be automatically converted to hyperlinks.