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:
parent
ea9347e48f
commit
cee1f3d1cb
22
dialog.cpp
22
dialog.cpp
@ -54,6 +54,15 @@ public:
|
|||||||
* for example by resizing the dialogue.
|
* for example by resizing the dialogue.
|
||||||
*/
|
*/
|
||||||
Plasma::PanelSvg *background;
|
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 )
|
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(d->background, SIGNAL(repaintNeeded()), this, SLOT(update()));
|
||||||
|
|
||||||
connect(Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeUpdated()));
|
connect(Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeUpdated(this)));
|
||||||
themeUpdated();
|
d->themeUpdated(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog::~Dialog()
|
Dialog::~Dialog()
|
||||||
@ -75,15 +84,6 @@ Dialog::~Dialog()
|
|||||||
delete d;
|
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)
|
void Dialog::paintEvent(QPaintEvent *e)
|
||||||
{
|
{
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
|
10
dialog.h
10
dialog.h
@ -75,15 +75,13 @@ class PLASMA_EXPORT Dialog : public QWidget
|
|||||||
void paintEvent(QPaintEvent *e);
|
void paintEvent(QPaintEvent *e);
|
||||||
void resizeEvent(QResizeEvent *e);
|
void resizeEvent(QResizeEvent *e);
|
||||||
|
|
||||||
private Q_SLOTS:
|
|
||||||
/**
|
|
||||||
* React to theme changes
|
|
||||||
*/
|
|
||||||
void themeUpdated();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Private;
|
class Private;
|
||||||
Private * const d;
|
Private * const d;
|
||||||
|
/**
|
||||||
|
* React to theme changes
|
||||||
|
*/
|
||||||
|
Q_PRIVATE_SLOT(d,void themeUpdated(Dialog * dialog));
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Plasma namespace
|
} // Plasma namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user