[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Plasma themed tabbox
From:       Martin =?utf-8?q?Gr=C3=A4=C3=9Flin?= <kde () martin-graesslin ! com>
Date:       2009-02-24 11:20:06
Message-ID: 200902241220.13607.kde () martin-graesslin ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


I worked on Plasma themeing the normal tabbox (without effects). So far 
everything seems to work ;-)

As this is my first work on anything related to QGraphicsView/Plasma I cc-ed 
Plasma devs. Please have a look at the patch and tell me what I have done 
wrong (probably thousands of things). Especially there is still a white border 
around the tabbox and I don't know how to get rid of it.

The old tabbox highlights the background of the active item. I decided to just 
change the font of the item (underline and bold) and apply an icon effect. I 
don't know if it is enough to indicate the currently selected item.

Minimized windows used to have a different color. Here I choose an italic font 
instead. Icon effect still the same.

Here some screenshots:
 * http://img7.imageshack.us/img7/4466/plasmatabbox.png
 * http://img25.imageshack.us/img25/9282/plasmadesktopbox.png

Regards
Martin

["tabbox.diff" (text/x-patch)]

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68ca2b2..0f727f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,7 +98,7 @@ qt4_add_dbus_adaptor( kwin_KDEINIT_SRCS org.kde.KWin.xml \
workspace.h KWin::Works  
 kde4_add_kdeinit_executable( kwin ${kwin_KDEINIT_SRCS})
 
-target_link_libraries(kdeinit_kwin ${KDE4_KDEUI_LIBS} kephal kdecorations \
kwineffects ${X11_LIBRARIES}) +target_link_libraries(kdeinit_kwin ${KDE4_KDEUI_LIBS} \
${KDE4_PLASMA_LIBS} kephal kdecorations kwineffects ${X11_LIBRARIES})  
 if(OPENGL_FOUND)
   target_link_libraries(kdeinit_kwin ${OPENGL_gl_LIBRARY})
diff --git a/tabbox.cpp b/tabbox.cpp
index 5d1a173..3b094b5 100644
--- a/tabbox.cpp
+++ b/tabbox.cpp
@@ -4,6 +4,7 @@
 
 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
+Copyright (C) 2009 Martin Gräßlin <kde@martin-graesslin.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -55,17 +56,21 @@ namespace KWin
 extern QPixmap* kwin_get_menu_pix_hack();
 
 TabBox::TabBox( Workspace *ws )
-    : QFrame( 0, Qt::X11BypassWindowManagerHint )
+    : QGraphicsView()
     , wspace(ws)
     , client(0)
     , display_refcount( 0 )
     {
-    setFrameStyle(QFrame::StyledPanel);
-    setFrameShadow(QFrame::Raised);
-    setBackgroundRole(QPalette::Base);
-    setLineWidth(3);
-    setMidLineWidth(3);
-    setContentsMargins( 3, 3, 3, 3 );
+    scene = new QGraphicsScene( this );
+    setWindowFlags( Qt::X11BypassWindowManagerHint );
+    setScene( scene );
+    setFrameStyle( QFrame::NoFrame );
+    viewport()->setAutoFillBackground( false );
+    setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
+    setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
+    m_frame.setImagePath( "widgets/background" );
+    m_frame.setCacheAllRenderedFrames( true );
+    m_frame.setEnabledBorders( Plasma::FrameSvg::AllBorders );
 
     showMiniIcon = false;
 
@@ -208,9 +213,12 @@ void TabBox::reset( bool partial_reset )
 
         // calculate maximum caption width
         cw = fontMetrics().width(no_tasks)+20;
+        QFont f = font();
+        f.setBold( true );
+        QFontMetrics fm = QFontMetrics( f );
         for (ClientList::ConstIterator it = clients.constBegin(); it != \
clients.constEnd(); ++it)  {
-          cw = fontMetrics().width( (*it)->caption() );
+          cw = fm.width( (*it)->caption() );
           if ( cw > wmax ) wmax = cw;
           }
 
@@ -278,18 +286,82 @@ void TabBox::reset( bool partial_reset )
         }
 
     // height, width for the popup
-    h += 2 * frameWidth();
-    w = 2*frameWidth() + 5*2 + ( showMiniIcon ? 16 : 32 ) + 8 + wmax; // \
5*2=margins, ()=icon, 8=space between icon+text +    qreal left, top, right, bottom;
+    m_frame.getMargins( left, top, right, bottom );
+    h += top + bottom;
+    w = left + right + 5*2 + ( showMiniIcon ? 16 : 32 ) + 8 + wmax; // 5*2=margins, \
()=icon, 8=space between icon+text  w = qBound( r.width()/3 , w, r.width() * 4 / 5 );
 
-    setGeometry( (r.width()-w)/2 + r.x(),
+    setGeometry((r.width()-w)/2 + r.x(),
                  (r.height()-h)/2+ r.y(),
                  w, h );
+    scene->setSceneRect( -left, -top, w+left+right, h+top+bottom );
+    m_frame.resizeFrame( QRect( 0, 0, w , h ).size() );
+    setMask( m_frame.mask() );
+
+    if( partial_reset )
+        initScene();
 
     if( effects )
         static_cast<EffectsHandlerImpl*>(effects)->tabBoxUpdated();
     }
 
+void TabBox::initScene()
+    {
+    scene->clear();
+    qreal left, top, right, bottom;
+    m_frame.getMargins( left, top, right, bottom );
+
+    if( mode() == TabBoxWindowsMode )
+        {
+        if( clients.count() == 0 )
+            {
+            QFont f = font();
+            f.setBold( true );
+            f.setPointSize( 14 );
+
+            QGraphicsTextItem* item = scene->addText( no_tasks, f );
+            item->setDefaultTextColor( Plasma::Theme::defaultTheme()->color( \
Plasma::Theme::TextColor ) ); +            item->adjustSize();
+            item->setPos( width()*0.5 - QFontMetrics(f).width( item->toPlainText() \
)*0.5, +                height()*0.5 - QFontMetrics(f).height()*0.5 );
+            }
+        else
+            {
+            // add clients to scene
+            int index = 0;
+            foreach( Client* client, clients )
+                {
+                TabBoxWindowItem* item = new TabBoxWindowItem( client, this );
+                item->setHeight( lineHeight );
+                item->setWidth( width() - left - right );
+                item->setShowMiniIcons( showMiniIcon );
+                item->setPos( left, top + lineHeight * index );
+                scene->addItem( item );
+                index++;
+                }
+            }
+        }
+    else
+        { // TabBoxDesktopMode || TabBoxDesktopListMode
+        int y = top;
+
+        QRect r = workspace()->screenGeometry( workspace()->activeScreen());
+        foreach (int it, desktops)
+            {
+            TabBoxDesktopItem* item = new TabBoxDesktopItem( it, this );
+            item->setHeight( lineHeight );
+            item->setWidth( width() - left - right );
+            item->setPos( left, top + lineHeight * (it-1) );
+            scene->addItem( item );
+            // next desktop
+            y += lineHeight;
+            if ( y >= r.height() )
+                break;
+            }
+        }
+    }
+
 
 /*!
   Shows the next or previous item, depending on \a next
@@ -431,181 +503,11 @@ void TabBox::hideEvent( QHideEvent* )
     {
     }
 
-/*!
-  Paints the tab box
- */
-void TabBox::paintEvent( QPaintEvent* e )
+void TabBox::drawBackground( QPainter* painter, const QRectF& rect )
     {
-    QFrame::paintEvent( e );
-
-    QPainter p( this );
-    QRect r( contentsRect());
-
-    QPixmap* menu_pix = kwin_get_menu_pix_hack();
-
-    int iconWidth = showMiniIcon ? 16 : 32;
-    int x = r.x();
-    int y = r.y();
-
-    if ( mode () == TabBoxWindowsMode )
-        {
-        if ( !currentClient() )
-            {
-            QFont f = font();
-            f.setBold( true );
-            f.setPointSize( 14 );
-
-            p.setFont(f);
-            p.drawText( r, Qt::AlignCenter, no_tasks);
-            }
-        else
-            {
-            for (ClientList::ConstIterator it = clients.constBegin(); it != \
                clients.constEnd(); ++it)
-              {
-              if ( workspace()->hasClient( *it ) )  // safety
-                  {
-                  // draw highlight background
-                  if ( (*it) == currentClient() )
-                    p.fillRect(x, y, r.width(), lineHeight, palette().brush( \
                QPalette::Active, QPalette::Highlight ));
-
-                  // draw icon
-                  QPixmap icon;
-                  if ( showMiniIcon )
-                    {
-                    if ( !(*it)->miniIcon().isNull() )
-                      icon = (*it)->miniIcon();
-                    }
-                  else
-                    if ( !(*it)->icon().isNull() )
-                      icon = (*it)->icon();
-                    else if ( menu_pix )
-                      icon = *menu_pix;
-                
-                  if( !icon.isNull())
-                    {
-                    if( (*it)->isMinimized())
-                        KIconEffect::semiTransparent( icon );
-                    p.drawPixmap( x+5, y + (lineHeight - iconWidth)/2, icon );
-                    }
-
-                  // generate text to display
-                  QString s;
-
-                  if ( !(*it)->isOnDesktop(workspace()->currentDesktop()) )
-                    s = workspace()->desktopName((*it)->desktop()) + ": ";
-
-                  if ( (*it)->isMinimized() )
-                    s += '(' + (*it)->caption() + ')';
-                  else
-                    s += (*it)->caption();
-
-                  s = fontMetrics().elidedText( s, Qt::ElideMiddle, r.width() - 5 - \
                iconWidth - 8 );
-
-                  // draw text
-                  if ( (*it) == currentClient() )
-                    p.setPen(palette().color( QPalette::Active, \
                QPalette::HighlightedText ));
-                  else if( (*it)->isMinimized())
-                    {
-                    QColor c1 = palette().color( QPalette::Active, QPalette::Text );
-                    QColor c2 = palette().color( QPalette::Active, \
                QPalette::Background );
-                    // from kicker's TaskContainer::blendColors()
-                    int r1, g1, b1;
-                    int r2, g2, b2;
-
-                    c1.getRgb( &r1, &g1, &b1 );
-                    c2.getRgb( &r2, &g2, &b2 );
-
-                    r1 += (int) ( .5 * ( r2 - r1 ) );
-                    g1 += (int) ( .5 * ( g2 - g1 ) );
-                    b1 += (int) ( .5 * ( b2 - b1 ) );
-
-                    p.setPen(QColor( r1, g1, b1 ));
-                    }
-                  else
-                    p.setPen(palette().color( QPalette::Active, QPalette::Text ));
-
-                  p.drawText(x+5 + iconWidth + 8, y, r.width() - 5 - iconWidth - 8, \
                lineHeight,
-                              Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine, \
                s);
-
-                  y += lineHeight;
-                  }
-              if ( y >= r.height() ) break;
-              }
-            }
-        }
-    else
-        { // TabBoxDesktopMode || TabBoxDesktopListMode
-        int iconHeight = iconWidth;
-
-        // get widest desktop name/number
-        QFont f(font());
-        f.setBold(true);
-        f.setPixelSize(iconHeight - 4);  // pixel, not point because I need to know \
                the pixels
-        QFontMetrics fm(f);
-
-        int wmax = 0;
-        foreach (int it, desktops)
-            {
-            wmax = qMax(wmax, fontMetrics().width(workspace()->desktopName(it)));
-
-            // calculate max width of desktop-number text
-            QString num = QString::number(it);
-            iconWidth = qMax(iconWidth - 4, fm.boundingRect(num).width()) + 4;
-            }
-
-        foreach (int it, desktops)
-            {
-            // draw highlight background
-            if ( it == desk )  // current desktop
-              p.fillRect(x, y, r.width(), lineHeight, palette().brush( \
                QPalette::Active, QPalette::Highlight ));
-
-            p.save();
-
-            // draw "icon" (here: number of desktop)
-            p.fillRect(x+5, y+2, iconWidth, iconHeight, palette().brush( \
                QPalette::Active, QPalette::Base ));
-            p.setPen(palette().color( QPalette::Active, QPalette::Text ));
-            p.drawRect(x+5, y+2, iconWidth, iconHeight);
-
-            // draw desktop-number
-            p.setFont(f);
-            QString num = QString::number(it);
-            p.drawText(x+5, y+2, iconWidth, iconHeight, Qt::AlignCenter, num);
-
-            p.restore();
-
-            // draw desktop name text
-            if ( it == desk )
-              p.setPen(palette().color( QPalette::Active, QPalette::HighlightedText \
                ));
-            else
-              p.setPen(palette().color( QPalette::Active, QPalette::Text ));
-
-            p.drawText(x+5 + iconWidth + 8, y, r.width() - 5 - iconWidth - 8, \
                lineHeight,
-                       Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine,
-                       workspace()->desktopName(it));
-
-            // show mini icons from that desktop aligned to each other
-            int x1 = x + 5 + iconWidth + 8 + wmax + 5;
-
-            ClientList list;
-            createClientList(list, it, 0, false);
-            // clients are in reversed stacking order
-            for ( int i = list.size() - 1; i>=0; i-- )
-              {
-              if ( !list.at( i )->miniIcon().isNull() )
-                {
-                if ( x1+18 >= x+r.width() )  // only show full icons
-                  break;
-
-                p.drawPixmap( x1, y + (lineHeight - 16)/2, list.at(  i )->miniIcon() \
                );
-                x1 += 18;
-                }
-              }
-
-            // next desktop
-            y += lineHeight;
-            if ( y >= r.height() ) break;
-            }
-        }
+    qreal left, top, right, bottom;
+    m_frame.getMargins( left, top, right, bottom );
+    m_frame.paintFrame( painter, rect.adjusted( -left, -top, right, bottom ) );
     }
 
 
@@ -747,6 +649,215 @@ void TabBox::handleMouseEvent( XEvent* e )
     }
 
 //*******************************
+// TabBoxWindowItem
+//*******************************
+
+TabBoxWindowItem::TabBoxWindowItem( Client* client, TabBox* parent )
+    : QGraphicsItem()
+    , m_client( client )
+    , m_parent( parent )
+    , m_width( 0 )
+    , m_height( 0 )
+    , m_showMiniIcons( false )
+    {
+    }
+
+TabBoxWindowItem::~TabBoxWindowItem()
+    {
+    }
+
+QRectF TabBoxWindowItem::boundingRect() const
+    {
+    return QRectF( 0, 0, m_height, m_width );
+    }
+
+void TabBoxWindowItem::setHeight( int height )
+    {
+    m_height = height;
+    }
+
+void TabBoxWindowItem::setWidth( int width )
+    {
+    m_width = width;
+    }
+
+void TabBoxWindowItem::setShowMiniIcons( bool showMiniIcons )
+    {
+    m_showMiniIcons = showMiniIcons;
+    }
+
+void TabBoxWindowItem::paint( QPainter* painter, const QStyleOptionGraphicsItem*, \
QWidget* ) +    {
+    // draw icon
+    int iconWidth = m_showMiniIcons ? 16 : 32;
+    int x = 0;
+    QPixmap* menu_pix = kwin_get_menu_pix_hack();
+    QPixmap icon;
+    if ( m_showMiniIcons )
+        {
+        if ( !m_client->miniIcon().isNull() )
+            icon = m_client->miniIcon();
+        }
+    else
+        {
+        if ( !m_client->icon().isNull() )
+            icon = m_client->icon();
+        else if ( menu_pix )
+            icon = *menu_pix;
+        }
+
+    if( !icon.isNull())
+        {
+        if( m_client->isMinimized())
+            KIconEffect::semiTransparent( icon );
+        if( m_client == m_parent->currentClient() )
+            {
+            KIconEffect *effect = KIconLoader::global()->iconEffect();
+            icon = effect->apply( icon, KIconLoader::Desktop, \
KIconLoader::ActiveState ); +            }
+        painter->drawPixmap( x+5, (m_height - iconWidth)/2, icon );
+        }
+
+    // generate text to display
+    QString s;
+
+    if ( !m_client->isOnDesktop(m_parent->workspace()->currentDesktop()) )
+    s = m_parent->workspace()->desktopName(m_client->desktop()) + ": ";
+
+    if ( m_client->isMinimized() )
+    s += '(' + m_client->caption() + ')';
+    else
+    s += m_client->caption();
+
+    QRect r = m_parent->workspace()->screenGeometry( \
m_parent->workspace()->activeScreen()); +    s = painter->fontMetrics().elidedText( \
s, Qt::ElideMiddle, r.width() - 5 - iconWidth - 8 ); +    painter->setPen( \
Plasma::Theme::defaultTheme()->color( Plasma::Theme::TextColor ) ); +    bool \
underline = false; +    bool bold = false;
+    bool italic = false;
+    if( m_client == m_parent->currentClient() )
+        {
+        underline = true;
+        bold = true;
+        }
+    if( m_client->isMinimized() )
+        italic = true;
+    QFont font = painter->font();
+    font.setUnderline( underline );
+    font.setBold( bold );
+    font.setItalic( italic );
+    painter->setFont( font );
+    painter->drawText( x+5 + iconWidth + 8, 0, r.width() - 5 - iconWidth - 8, \
m_height, +                              Qt::AlignLeft | Qt::AlignVCenter | \
Qt::TextSingleLine, s ); +    }
+
+//*******************************
+// TabBoxDesktopItem
+//*******************************
+
+TabBoxDesktopItem::TabBoxDesktopItem( int desktop, TabBox* parent )
+    : QGraphicsItem()
+    , m_desktop( desktop )
+    , m_parent( parent )
+    , m_width( 0 )
+    , m_height( 0 )
+    {
+    }
+
+TabBoxDesktopItem::~TabBoxDesktopItem()
+    {
+    }
+
+QRectF TabBoxDesktopItem::boundingRect() const
+    {
+    return QRectF( 0, 0, m_height, m_width );
+    }
+
+void TabBoxDesktopItem::setHeight( int height )
+    {
+    m_height = height;
+    }
+
+void TabBoxDesktopItem::setWidth( int width )
+    {
+    m_width = width;
+    }
+
+void TabBoxDesktopItem::paint( QPainter* painter, const QStyleOptionGraphicsItem*, \
QWidget* ) +    {
+    int iconWidth = 32;
+    int iconHeight = iconWidth;
+    int x = 0;
+    int y = 0;
+
+    // get widest desktop name/number
+    QFont f = painter->font();
+    f.setBold(true);
+    f.setPixelSize(iconHeight - 4);  // pixel, not point because I need to know the \
pixels +    QFontMetrics fm = QFontMetrics( f );
+
+    QString num = QString::number( m_desktop );
+    iconWidth = qMax(iconWidth - 4, fm.boundingRect(num).width()) + 4;
+
+    // draw "icon" (here: number of desktop)
+    painter->save();
+    QBrush brush;
+    if( m_desktop == m_parent->currentDesktop() )
+        brush = m_parent->palette().brush( QPalette::Active, QPalette::Highlight );
+    else
+        brush = m_parent->palette().brush( QPalette::Active, QPalette::Base );
+    painter->fillRect(x+5, y+2, iconWidth, iconHeight, brush );
+    painter->setPen(m_parent->palette().color( QPalette::Active, QPalette::Text ));
+    painter->drawRect(x+5, y+2, iconWidth, iconHeight);
+
+    // draw desktop-number
+    painter->setFont(f);
+    painter->drawText(x+5, y+2, iconWidth, iconHeight, Qt::AlignCenter, num);
+
+    painter->restore();
+
+    // draw desktop name text
+    bool underline = false;
+    bool bold = false;
+    if( m_desktop == m_parent->currentDesktop() )
+        {
+        underline = true;
+        bold = true;
+        }
+    QFont font = painter->font();
+    font.setUnderline( underline );
+    font.setBold( bold );
+    painter->setFont( font );
+    fm = QFontMetrics( font );
+    int wmax = fm.width( m_parent->workspace()->desktopName( m_desktop ));
+
+    painter->setPen( Plasma::Theme::defaultTheme()->color( Plasma::Theme::TextColor \
) ); +    QRect r = m_parent->workspace()->screenGeometry( \
m_parent->workspace()->activeScreen()); +    painter->drawText(x+5 + iconWidth + 8, \
y, r.width() - 5 - iconWidth - 8, m_height, +                    Qt::AlignLeft | \
Qt::AlignVCenter | Qt::TextSingleLine, +                    \
m_parent->workspace()->desktopName( m_desktop )); +
+    // show mini icons from that desktop aligned to each other
+    int x1 = x + 5 + iconWidth + 8 + wmax + 5;
+
+    ClientList list;
+    m_parent->createClientList(list, m_desktop, 0, false);
+    // clients are in reversed stacking order
+    for ( int i = list.size() - 1; i>=0; i-- )
+        {
+        if ( !list.at( i )->miniIcon().isNull() )
+            {
+            if ( x1+18 >= m_width )  // only show full icons
+                break;
+
+            painter->drawPixmap( x1, y + (m_height - 16)/2, list.at(  i \
)->miniIcon() ); +            x1 += 18;
+            }
+        }
+    }
+
+
+//*******************************
 // Workspace
 //*******************************
 
@@ -969,6 +1080,7 @@ bool Workspace::startKDEWalkThroughWindows()
     modalActionsSwitch( false );
     tab_box->setMode( TabBoxWindowsMode );
     tab_box->reset();
+    tab_box->initScene();
     return true;
     }
 
@@ -980,6 +1092,7 @@ bool Workspace::startWalkThroughDesktops( TabBoxMode mode )
     modalActionsSwitch( false );
     tab_box->setMode( mode );
     tab_box->reset();
+    tab_box->initScene();
     return true;
     }
 
diff --git a/tabbox.h b/tabbox.h
index f1045b2..f1552b9 100644
--- a/tabbox.h
+++ b/tabbox.h
@@ -4,6 +4,7 @@
 
 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
+Copyright (C) 2009 Martin Gräßlin <kde@martin-graesslin.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -24,6 +25,11 @@ along with this program.  If not, see \
<http://www.gnu.org/licenses/>.  
 #include <QFrame>
 #include <QTimer>
+#include <QGraphicsView>
+#include <QGraphicsScene>
+#include <QGraphicsItem>
+#include <Plasma/FrameSvg>
+#include <Plasma/Theme>
 #include "utils.h"
 
 
@@ -33,7 +39,7 @@ namespace KWin
 class Workspace;
 class Client;
 
-class TabBox : public QFrame
+class TabBox : public QGraphicsView
     {
     Q_OBJECT
     public:
@@ -53,6 +59,7 @@ class TabBox : public QFrame
         TabBoxMode mode() const;
 
         void reset( bool partial_reset = false );
+        void initScene();
         void nextPrev( bool next = true);
 
         void delayedShow();
@@ -67,6 +74,7 @@ class TabBox : public QFrame
         Workspace* workspace() const;
 
         void reconfigure();
+        void createClientList(ClientList &list, int desktop /*-1 = all*/, Client \
*start, bool chain);  
     public slots:
         void show();
@@ -74,10 +82,9 @@ class TabBox : public QFrame
     protected:
         void showEvent( QShowEvent* );
         void hideEvent( QHideEvent* );
-        void paintEvent( QPaintEvent* );
+        virtual void drawBackground( QPainter * painter, const QRectF & rect );
 
     private:
-        void createClientList(ClientList &list, int desktop /*-1 = all*/, Client \
                *start, bool chain);
         void createDesktopList(QList< int > &list, int start, SortOrder order);
 
     private:
@@ -94,6 +101,44 @@ class TabBox : public QFrame
         int lineHeight;
         bool showMiniIcon;
         bool options_traverse_all;
+
+        QGraphicsScene* scene;
+        Plasma::FrameSvg m_frame;
+    };
+
+class TabBoxWindowItem : public QGraphicsItem
+    {
+    public:
+        TabBoxWindowItem( Client* client, TabBox* parent );
+        ~TabBoxWindowItem();
+        virtual QRectF boundingRect() const;
+        virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem*, \
QWidget* ); +        void setWidth( int width );
+        void setHeight( int height );
+        void setShowMiniIcons( bool showMiniIcons );
+
+    private:
+        Client* m_client;
+        TabBox* m_parent;
+        int m_width;
+        int m_height;
+        bool m_showMiniIcons;
+    };
+
+class TabBoxDesktopItem : public QGraphicsItem
+    {
+    public:
+        TabBoxDesktopItem( int desktop, TabBox* parent );
+        ~TabBoxDesktopItem();
+        virtual QRectF boundingRect() const;
+        virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem*, \
QWidget* ); +        void setWidth( int width );
+        void setHeight( int height );
+    private:
+        int m_desktop;
+        TabBox* m_parent;
+        int m_width;
+        int m_height;
     };
 
 


["signature.asc" (application/pgp-signature)]

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic