API change as decided in tokamak

private slot is now in the pimpl

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=798090
This commit is contained in:
Alexis Ménard 2008-04-17 12:45:46 +00:00
parent ea9347e48f
commit cee1f3d1cb
2 changed files with 15 additions and 17 deletions

View File

@ -54,6 +54,15 @@ public:
* for example by resizing the dialogue.
*/
Plasma::PanelSvg *background;
void themeUpdated(Dialog * dialog)
{
const int topHeight = background->marginSize(Plasma::TopMargin);
const int leftWidth = background->marginSize(Plasma::LeftMargin);
const int rightWidth = background->marginSize(Plasma::RightMargin);
const int bottomHeight = background->marginSize(Plasma::BottomMargin);
dialog->setContentsMargins(leftWidth, topHeight, rightWidth, bottomHeight);
};
};
Dialog::Dialog( QWidget * parent, Qt::WindowFlags f )
@ -66,8 +75,8 @@ Dialog::Dialog( QWidget * parent, Qt::WindowFlags f )
connect(d->background, SIGNAL(repaintNeeded()), this, SLOT(update()));
connect(Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeUpdated()));
themeUpdated();
connect(Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeUpdated(this)));
d->themeUpdated(this);
}
Dialog::~Dialog()
@ -75,15 +84,6 @@ Dialog::~Dialog()
delete d;
}
void Dialog::themeUpdated()
{
const int topHeight = d->background->marginSize(Plasma::TopMargin);
const int leftWidth = d->background->marginSize(Plasma::LeftMargin);
const int rightWidth = d->background->marginSize(Plasma::RightMargin);
const int bottomHeight = d->background->marginSize(Plasma::BottomMargin);
setContentsMargins(leftWidth, topHeight, rightWidth, bottomHeight);
}
void Dialog::paintEvent(QPaintEvent *e)
{
QPainter p(this);

View File

@ -75,15 +75,13 @@ class PLASMA_EXPORT Dialog : public QWidget
void paintEvent(QPaintEvent *e);
void resizeEvent(QResizeEvent *e);
private Q_SLOTS:
/**
* React to theme changes
*/
void themeUpdated();
private:
class Private;
Private * const d;
/**
* React to theme changes
*/
Q_PRIVATE_SLOT(d,void themeUpdated(Dialog * dialog));
};
} // Plasma namespace