KStyles
Keramik::InactiveTabPainter Class Reference
#include <pixmaploader.h>

Public Member Functions | |
InactiveTabPainter (QStyleOptionTab::TabPosition mode, bool bottom) | |
virtual | ~InactiveTabPainter () |
Protected Member Functions | |
virtual int | tileName (unsigned int column, unsigned int row) const |
Detailed Description
Definition at line 317 of file pixmaploader.h.
Constructor & Destructor Documentation
InactiveTabPainter::InactiveTabPainter | ( | QStyleOptionTab::TabPosition | mode, | |
bool | bottom | |||
) |
Most fully, inactive tabs look like this: L C R / --- \ | === |
Where L,C, and R denote the tile positions. Of course, we don't want to draw all of the rounding for all the tabs.
We want the left-most tab to look like this:
L C / -- | ==
"Middle" tabs look like this:
L C | -- | ==
And the right most tab looks like this:
L C R | -- \ | == |
So we have to vary the number of columns, and for everything but left-most tab, the L tab gets the special separator tile.
Definition at line 520 of file pixmaploader.cpp.
virtual Keramik::InactiveTabPainter::~InactiveTabPainter | ( | ) | [inline, virtual] |
Definition at line 321 of file pixmaploader.h.
Member Function Documentation
int InactiveTabPainter::tileName | ( | unsigned int | , | |
unsigned int | ||||
) | const [protected, virtual] |
The idea behind all this stuff is that for performance reasons, we want to use only integers to refer to widgets.
So we give each widget a base ID that's divisible by 256, and have all the various tiles be referred to as that ID + some small number.
genembed generates and assigns the base widget IDs, and maps various pixmaps suffixes into the adjustment numbers; using that info it writes out the tables mapping the IDs to pixmaps, and keramikrc.h, which provides nice symbolic constants for base IDs.
When painting, however, we essentially represent the widget as a table, providing fixed/tiled/stretched modes for each column and row. So to draw the widget knowing its base ID, we need to know how many rows and columns there, what the scaling modes are, and how to get to each of the tiles -- i.e. the tiles' offset from the base ID.
The various painter subclasses simply fill in most of that info into the members here during their construction, and implement the virtual tileName to get the offsets.
Note that the IDs and offsets are separated since we can reuse the same code in many cases by splitting the widget identify from tile identity (as there are many different widgets that have the same or similar tile layout)
Reimplemented from Keramik::RectTilePainter.
Definition at line 573 of file pixmaploader.cpp.
The documentation for this class was generated from the following files: