* 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;
|
popupLostFocus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KConfigGroup PopupAppletPrivate::popupConfigGroup()
|
||||||
|
{
|
||||||
|
KConfigGroup *mainGroup = static_cast<Applet*>(q)->d->mainConfigGroup();
|
||||||
|
return KConfigGroup(mainGroup, "PopupApplet");
|
||||||
|
}
|
||||||
|
|
||||||
void PopupAppletPrivate::dialogSizeChanged()
|
void PopupAppletPrivate::dialogSizeChanged()
|
||||||
{
|
{
|
||||||
//Reposition the dialog
|
//Reposition the dialog
|
||||||
Plasma::Dialog *dialog = dialogPtr.data();
|
Plasma::Dialog *dialog = dialogPtr.data();
|
||||||
if (dialog) {
|
if (dialog) {
|
||||||
KConfigGroup *mainGroup = static_cast<Applet*>(q)->d->mainConfigGroup();
|
KConfigGroup sizeGroup = popupConfigGroup();
|
||||||
KConfigGroup sizeGroup(mainGroup, "PopupApplet");
|
|
||||||
sizeGroup.writeEntry("DialogHeight", dialog->height());
|
sizeGroup.writeEntry("DialogHeight", dialog->height());
|
||||||
sizeGroup.writeEntry("DialogWidth", dialog->width());
|
sizeGroup.writeEntry("DialogWidth", dialog->width());
|
||||||
|
|
||||||
@ -675,14 +680,7 @@ void PopupAppletPrivate::updateDialogPosition()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsView *view = q->view();
|
KConfigGroup sizeGroup = popupConfigGroup();
|
||||||
|
|
||||||
if (!view) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
KConfigGroup *mainGroup = static_cast<Applet*>(q)->d->mainConfigGroup();
|
|
||||||
KConfigGroup sizeGroup(mainGroup, "PopupApplet");
|
|
||||||
|
|
||||||
Corona *corona = qobject_cast<Corona *>(q->scene());
|
Corona *corona = qobject_cast<Corona *>(q->scene());
|
||||||
Q_ASSERT(corona);
|
Q_ASSERT(corona);
|
||||||
@ -711,6 +709,11 @@ void PopupAppletPrivate::updateDialogPosition()
|
|||||||
dialog->resize(saved);
|
dialog->resize(saved);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QGraphicsView *view = q->view();
|
||||||
|
if (!view) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QSize s = dialog->size();
|
QSize s = dialog->size();
|
||||||
QPoint pos = view->mapFromScene(q->scenePos());
|
QPoint pos = view->mapFromScene(q->scenePos());
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ public:
|
|||||||
void updateDialogPosition();
|
void updateDialogPosition();
|
||||||
void popupConstraintsEvent(Plasma::Constraints constraints);
|
void popupConstraintsEvent(Plasma::Constraints constraints);
|
||||||
void checkExtenderAppearance(Plasma::FormFactor f);
|
void checkExtenderAppearance(Plasma::FormFactor f);
|
||||||
|
KConfigGroup popupConfigGroup();
|
||||||
|
|
||||||
PopupApplet *q;
|
PopupApplet *q;
|
||||||
Plasma::IconWidget *icon;
|
Plasma::IconWidget *icon;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user