Back to Table of Contentsgentoo - A Click-Ass Filemanager Go to Obsession Developments Homepage
  LICENSE   GUIDE   INTRO   USAGE CONFIG HISTORY CONTRIBUTING ACKS  

Styles

Introduction

As was mentioned on the file types page, each file type links to something called a style. What is a style, you ask? Well, a style is a named set of properties, where different properties control different aspects of how files associated (through the typing system) with the style are handled.

Currently, the only type of property actually implemented is the visual ones, which controls how files having the style are displayed in the pane lists. You can use a style's visual properties to define the colors and icons used when rendering the files. This allows for some serious niceness in the general look of gentoo, especially when coupled with Johan Hanson's wonderful icons. Go ahead and play!

The Style Hierarchy

One thing is important to realize about styles: they form a hierarchy, namely a singly-rooted N-tree. This means that no style exists by itself; all have a parent style above them in the tree. The only style which actually doesn't have a parent is, as could be expected from its name, the root one. The root style is special in more ways; it is always available (you cannot delete it!) for example. If this sounds horribly abstract and weird, perhaps this example picture can clear things up:

Style tree picture

This small tree, which is actually a cropped screenshot from the configuration window, shows the general idea of a tree hierarchy. You can see the Root style on top. Notice how all other styles sort of "hang" under the Root style; from any style you can trace a way back up to Root.

Also note how the tree is sorted alphabetically on each level. This makes it easier to locate a given subtree.

With a tree like this, generally only Root plus the "leaf" nodes (nodes without any children, such as "DEB Archive", "RPM Archive", "Config", "Directory", and so on) are actually bound to types. The other nodes, such as "Archive", "Image" and "Source", are not. Then you might wonder if they're not just being wasted? No, they're not! See below (on inheritance) for why.

Properties and the Use of Inheritance

So, what is the point of arranging the styles into a tree? Wouldn't it be just as convenient to use a less structured model, such as the plain list used by types?

Funny you should ask that! The answer is no, and for a very good reason: inheritance. Each style contains a number of named values, also called properties. Assigning a specific value to a property is optional. If you don't assign a value to a certain property in a style, that property copies the value from its parent! If the parent doesn't assign a value either, then that style's parent is checked, and so on. Eventually you'll reach the Root, and there the search will end, because Root always gives a value to all its properties. If you go ahead and define a local value, that value is said to override the one that would otherwise have been copied from a parent.

This kind of operation, where a value is found by searching down a branch of a family tree, is called inheritance. It is a very useful way of arranging things, and is widely used, for example in object-oriented programming (languages such as Smalltalk, C++ and Java all provide support for inheritance).

The point of inheritance in gentoo is that it reduces (or even removes completely) the need to specify the same property value twice. It also naturally supports grouping; look how all styles for various image formats have been grouped under the single parent style "Image", for example. If you want all image files to be displayed with a common background color, you can just assign that color once to the corresponding property in the "Image" style, and then all specific image format styles ("JPEG", "GIF" etc) will inherit it!

Visual Properties

One big group of properties control how files belonging to a style are displayed in the directory panes. These properties are (rather logically) called the visual properties. They are:

NameTypeExplanation
Unselected BackgroundColor This is the color used as the background on unselected rows. It is normally set once, in the Root style. Changing the unselected background color in child styles is not recommended, since it can make it harder to distinguish between unselected and selected rows. But then again, it's your configuration...
Unselected ForegroundColor This is the foreground (text) color of unselected rows. Generally black.
Unselected IconIcon This specifies the name of the icon to use (for the "Icon" column content) for unselected rows of this style. The name is the filename of a small pixmap, sans path. For more information about locating icons, see the misc page.
Sel