664 QRectF to = contentGeometry(orientation); |
664 QRectF to = contentGeometry(orientation); |
665 |
665 |
666 HsWidgetPresentationData presentation; |
666 HsWidgetPresentationData presentation; |
667 presentation.orientation = orientation; |
667 presentation.orientation = orientation; |
668 |
668 |
|
669 HsPageVisual *pageVisual = visual(); |
669 HsWidgetHostVisual *visual(0); |
670 HsWidgetHostVisual *visual(0); |
670 #ifdef HSWIDGETORGANIZER_ALGORITHM |
671 #ifdef HSWIDGETORGANIZER_ALGORITHM |
671 QList<HsWidgetHost*> newWidgets; |
672 QList<HsWidgetHost*> newWidgets; |
672 #endif //HSWIDGETORGANIZER_ALGORITHM |
673 #endif //HSWIDGETORGANIZER_ALGORITHM |
673 foreach (HsWidgetHost *widget, mWidgets) { |
674 foreach (HsWidgetHost *widget, mWidgets) { |
674 visual = widget->visual(); |
675 visual = widget->visual(); |
675 if (!widget->getPresentation(presentation)) { |
676 if ( pageVisual->isAncestorOf(visual)) { |
|
677 if (!widget->getPresentation(presentation)) { |
676 #ifndef HSWIDGETORGANIZER_ALGORITHM |
678 #ifndef HSWIDGETORGANIZER_ALGORITHM |
677 QList<QRectF> geometries = converter->convert( |
679 QList<QRectF> geometries = converter->convert( |
678 from, QList<QRectF>() << visual->geometry(), to); |
680 from, QList<QRectF>() << visual->geometry(), to); |
679 visual->setGeometry(geometries.first()); |
681 visual->setGeometry(geometries.first()); |
680 widget->savePresentation(); |
682 widget->savePresentation(); |
681 #else //HSWIDGETORGANIZER_ALGORITHM |
683 #else //HSWIDGETORGANIZER_ALGORITHM |
682 newWidgets << widget; |
684 newWidgets << widget; |
683 #endif //HSWIDGETORGANIZER_ALGORITHM |
685 #endif //HSWIDGETORGANIZER_ALGORITHM |
684 } else { |
686 } else { |
685 QRectF adjustWidgetPosition; |
687 QRectF adjustWidgetPosition; |
686 adjustWidgetPosition = visual->geometry(); |
688 adjustWidgetPosition = visual->geometry(); |
687 adjustWidgetPosition.moveTopLeft(presentation.pos()); |
689 adjustWidgetPosition.moveTopLeft(presentation.pos()); |
688 visual->setPos(adjustedWidgetPosition(adjustWidgetPosition)); |
690 visual->setPos(adjustedWidgetPosition(adjustWidgetPosition)); |
689 visual->setZValue(presentation.zValue); |
691 visual->setZValue(presentation.zValue); |
690 widget->savePresentation(); //Needed to follow pageMargin dynamic change |
692 widget->savePresentation(); //Needed to follow pageMargin dynamic change |
|
693 } |
691 } |
694 } |
692 } |
695 } |
693 |
696 |
694 #ifdef HSWIDGETORGANIZER_ALGORITHM |
697 #ifdef HSWIDGETORGANIZER_ALGORITHM |
695 // sort new widgets in order |
698 // sort new widgets in order |