* consolidate the popup config group name by putting a convenience method in PopupAppletPrivate to fetch it
* move the check for the view lower in updateDialogPosition so that even if we don't have a view, we at least do the sizing, if not the positioning (which is all the view is needed for) svn path=/trunk/KDE/kdelibs/; revision=1047715
This commit is contained in:
parent
def1a43dc1
commit
27a02128a5
@ -646,13 +646,18 @@ void PopupAppletPrivate::clearPopupLostFocus()
|
||||
popupLostFocus = false;
|
||||
}
|
||||
|
||||
KConfigGroup PopupAppletPrivate::popupConfigGroup()
|
||||
{
|
||||
KConfigGroup *mainGroup = static_cast<Applet*>(q)->d->mainConfigGroup();
|
||||
return KConfigGroup(mainGroup, "PopupApplet");
|
||||
}
|
||||
|
||||
void PopupAppletPrivate::dialogSizeChanged()
|
||||
{
|
||||
//Reposition the dialog
|
||||
Plasma::Dialog *dialog = dialogPtr.data();
|
||||
if (dialog) {
|
||||
KConfigGroup *mainGroup = static_cast<Applet*>(q)->d->mainConfigGroup();
|
||||
KConfigGroup sizeGroup(mainGroup, "PopupApplet");
|
||||
KConfigGroup sizeGroup = popupConfigGroup();
|
||||
sizeGroup.writeEntry("DialogHeight", dialog->height());
|
||||
sizeGroup.writeEntry("DialogWidth", dialog->width());
|
||||
|
||||
@ -675,14 +680,7 @@ void PopupAppletPrivate::updateDialogPosition()
|
||||
return;
|
||||
}
|
||||
|
||||
QGraphicsView *view = q->view();
|
||||
|
||||
if (!view) {
|
||||
return;
|
||||
}
|
||||
|
||||
KConfigGroup *mainGroup = static_cast<Applet*>(q)->d->mainConfigGroup();
|
||||
KConfigGroup sizeGroup(mainGroup, "PopupApplet");
|
||||
KConfigGroup sizeGroup = popupConfigGroup();
|
||||
|
||||
Corona *corona = qobject_cast<Corona *>(q->scene());
|
||||
Q_ASSERT(corona);
|
||||
@ -711,6 +709,11 @@ void PopupAppletPrivate::updateDialogPosition()
|
||||
dialog->resize(saved);
|
||||
}
|
||||
|
||||
QGraphicsView *view = q->view();
|
||||
if (!view) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSize s = dialog->size();
|
||||
QPoint pos = view->mapFromScene(q->scenePos());
|
||||
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
void updateDialogPosition();
|
||||
void popupConstraintsEvent(Plasma::Constraints constraints);
|
||||
void checkExtenderAppearance(Plasma::FormFactor f);
|
||||
KConfigGroup popupConfigGroup();
|
||||
|
||||
PopupApplet *q;
|
||||
Plasma::IconWidget *icon;
|
||||
|
Loading…
x
Reference in New Issue
Block a user