From 3a008feb23a3a4ffc279d0905953b46a6fc8299d Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sun, 17 Aug 2008 15:34:46 +0000 Subject: [PATCH] revert a bit of stuff that wasn't supposed to be committed in the first place svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=848389 --- widgets/tabbar.cpp | 35 ----------------------------------- widgets/tabbar.h | 5 ----- 2 files changed, 40 deletions(-) diff --git a/widgets/tabbar.cpp b/widgets/tabbar.cpp index 2e79648b0..5d9203ab8 100644 --- a/widgets/tabbar.cpp +++ b/widgets/tabbar.cpp @@ -29,8 +29,6 @@ #include #include -#include -#include #include "private/nativetabbar_p.h" @@ -55,13 +53,11 @@ public: { } - void syncBorders(); void slidingCompleted(QGraphicsItem *item); void shapeChanged(const QTabBar::Shape shape); TabBar *q; NativeTabBar *tabBar; - PanelSvg *background; QList pages; QGraphicsLinearLayout *mainLayout; QGraphicsLinearLayout *tabBarLayout; @@ -73,15 +69,6 @@ public: int newPageAnimId; }; -void TabBarPrivate::syncBorders() -{ - //set margins from the normal element - qreal left, top, right, bottom; - - background->getMargins(left, top, right, bottom); - - q->setContentsMargins(left, top, right, bottom); -} void TabBarPrivate::slidingCompleted(QGraphicsItem *item) { @@ -145,13 +132,6 @@ TabBar::TabBar(QGraphicsWidget *parent) d->tabBarLayout->addItem(tabProxy); d->tabBarLayout->addStretch(); - //background painting stuff - d->background = new Plasma::PanelSvg(this); - d->background->setImagePath("widgets/frame"); - d->background->setElementPrefix("sunken"); - - connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), SLOT(syncBorders())); - connect(d->tabBar, SIGNAL(currentChanged(int)), this, SLOT(setCurrentIndex(int))); connect(d->tabBar, SIGNAL(shapeChanged(QTabBar::Shape)), this, SLOT(shapeChanged(QTabBar::Shape))); connect(Plasma::Animator::self(), SIGNAL(movementFinished(QGraphicsItem*)), this, SLOT(slidingCompleted(QGraphicsItem*))); @@ -336,21 +316,6 @@ QTabBar *TabBar::nativeWidget() const return d->tabBar; } -void TabBar::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget *widget) -{ - Q_UNUSED(option) - Q_UNUSED(widget) - - d->background->paintPanel(painter, QPoint(contentsRect().left(), contentsRect().top() + nativeWidget()->height()/1.5)); -} - -void TabBar::resizeEvent(QGraphicsSceneResizeEvent *event) -{ - d->background->resizePanel(event->newSize() - QSize(0, nativeWidget()->height()/2)); -} - void TabBar::wheelEvent(QGraphicsSceneWheelEvent * event) { //FIXME: probably this would make more sense in NativeTabBar, but it works only here diff --git a/widgets/tabbar.h b/widgets/tabbar.h index 673632b5b..5462b844f 100644 --- a/widgets/tabbar.h +++ b/widgets/tabbar.h @@ -187,16 +187,11 @@ Q_SIGNALS: void currentChanged(int index); protected: - void paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget *widget); - void resizeEvent(QGraphicsSceneResizeEvent *event); void wheelEvent(QGraphicsSceneWheelEvent *event); private: TabBarPrivate * const d; - Q_PRIVATE_SLOT(d, void syncBorders()) Q_PRIVATE_SLOT(d, void slidingCompleted(QGraphicsItem *item)) Q_PRIVATE_SLOT(d, void shapeChanged(const QTabBar::Shape shape)) };