Added tabbar scrolling support when the selected button cannot fit in the tabbar.
Changed the way that the tabbar is getting drawn in order to support a scrollbar in the future. Now the buttons in the tabbar are all getting drawn in an off-screen private pixmap, called the buttonBar, and the buttonBar is getting scrolled as needed and painted to the widget at once.
Added two more source files, the genericfuncs.cpp and genericfuncs.h, with generic functions for easy pixmap manipulation while drawing the off-screen buttons.
The newly added functions are the following:
const QPixmap drawPixmapOnPixmap(int x, int y, const QPixmap& pixmapUnder, const QPixmap& pixmapOver) const QPixmap drawTextOnPixmap(int x, int y, int w, int h, int flags, const QFont& font, const QColor& textColor, const QString& text, const QPixmap& pixmap) const QPixmap genHorizontallyTiledPixmap(const QPixmap& pixmap, uint repeatTimes) const QPixmap appendPixmapToPixmapHorizontally(const QPixmap& pixmap1, const QPixmap& pixmap2)
This diff is related to the bug 339139, and I tried to implement the feature according to Eike's comment (https://bugs.kde.org/show_bug.cgi?id=339139#c3).
Tried to keep the changes to the minimum for this initial commit, and things can actually now be improved when compared to the past. For example, since the buttonBar is a global private variable now, we do not have to re-draw it from scratch everytime the paintEvent function is called. Only when a new button is added or removed, or when the user selects a different session (and therefore, another tabbar button has to be highlighted).
I am also working on a skin-able scrollbar at the moment (slowly).