Fix namespacing in PageStack

This commit is contained in:
Sebastian Kügler 2013-02-20 01:34:57 +01:00
parent 614259cf69
commit af1ca41261
2 changed files with 17 additions and 17 deletions

View File

@ -44,7 +44,7 @@
// navigation model. Pages can be defined as QML items or components. // navigation model. Pages can be defined as QML items or components.
import QtQuick 2.0 import QtQuick 2.0
import "." 0.1 import "." 0.1 as PlasmaComponents
import "private/PageStack.js" as Engine import "private/PageStack.js" as Engine
/** /**
@ -76,7 +76,7 @@ Item {
* If toolbar is null, then no tools are shown even if a page does have * If toolbar is null, then no tools are shown even if a page does have
* tools. * tools.
*/ */
property ToolBar toolBar property Item toolBar
/** /**
* The page to be automatically loaded when this PageStack component gets * The page to be automatically loaded when this PageStack component gets
@ -176,7 +176,7 @@ Item {
// Called when the page stack visibility changes. // Called when the page stack visibility changes.
onVisibleChanged: { onVisibleChanged: {
if (currentPage) { if (currentPage) {
internal.setPageStatus(currentPage, visible ? PageStatus.Active : PageStatus.Inactive); internal.setPageStatus(currentPage, visible ? PlasmaComponents.PageStatus.Active : PlasmaComponents.PageStatus.Inactive);
if (visible) if (visible)
currentPage.visible = currentPage.parent.visible = true; currentPage.visible = currentPage.parent.visible = true;
} }
@ -218,10 +218,10 @@ Item {
{ {
if (page != null) { if (page != null) {
if (page.status !== undefined) { if (page.status !== undefined) {
if (status == PageStatus.Active && page.status == PageStatus.Inactive) if (status == PlasmaComponents.PageStatus.Active && page.status == PlasmaComponents.PageStatus.Inactive)
page.status = PageStatus.Activating; page.status = PlasmaComponents.PageStatus.Activating;
else if (status == PageStatus.Inactive && page.status == PageStatus.Active) else if (status == PlasmaComponents.PageStatus.Inactive && page.status == PlasmaComponents.PageStatus.Active)
page.status = PageStatus.Deactivating; page.status = PlasmaComponents.PageStatus.Deactivating;
page.status = status; page.status = status;
} }
@ -304,7 +304,7 @@ Item {
setState(""); setState("");
page.visible = true; page.visible = true;
if (root.visible && immediate) if (root.visible && immediate)
internal.setPageStatus(page, PageStatus.Active); internal.setPageStatus(page, PlasmaComponents.PageStatus.Active);
} }
// Performs a push exit transition. // Performs a push exit transition.
@ -315,7 +315,7 @@ Item {
else else
setState(immediate ? "Hidden" : "Left"); setState(immediate ? "Hidden" : "Left");
if (root.visible && immediate) if (root.visible && immediate)
internal.setPageStatus(page, PageStatus.Inactive); internal.setPageStatus(page, PlasmaComponents.PageStatus.Inactive);
if (replace) { if (replace) {
if (immediate) if (immediate)
cleanup(); cleanup();
@ -332,7 +332,7 @@ Item {
setState(""); setState("");
page.visible = true; page.visible = true;
if (root.visible && immediate) if (root.visible && immediate)
internal.setPageStatus(page, PageStatus.Active); internal.setPageStatus(page, PlasmaComponents.PageStatus.Active);
} }
// Performs a pop exit transition. // Performs a pop exit transition.
@ -344,7 +344,7 @@ Item {
setState(immediate ? "Hidden" : "Right"); setState(immediate ? "Hidden" : "Right");
if (root.visible && immediate) if (root.visible && immediate)
internal.setPageStatus(page, PageStatus.Inactive); internal.setPageStatus(page, PlasmaComponents.PageStatus.Inactive);
if (immediate) if (immediate)
cleanup(); cleanup();
else else
@ -357,7 +357,7 @@ Item {
transitionAnimationRunning = true; transitionAnimationRunning = true;
internal.ongoingTransitionCount++; internal.ongoingTransitionCount++;
if (root.visible) { if (root.visible) {
internal.setPageStatus(page, (state == "") ? PageStatus.Activating : PageStatus.Deactivating); internal.setPageStatus(page, (state == "") ? PlasmaComponents.PageStatus.Activating : PlasmaComponents.PageStatus.Deactivating);
} }
} }
@ -367,7 +367,7 @@ Item {
if (state != "") if (state != "")
state = "Hidden"; state = "Hidden";
if (root.visible) if (root.visible)
internal.setPageStatus(page, (state == "") ? PageStatus.Active : PageStatus.Inactive); internal.setPageStatus(page, (state == "") ? PlasmaComponents.PageStatus.Active : PlasmaComponents.PageStatus.Inactive);
internal.ongoingTransitionCount--; internal.ongoingTransitionCount--;
transitionAnimationRunning = false; transitionAnimationRunning = false;
@ -519,8 +519,8 @@ Item {
function cleanup() function cleanup()
{ {
if (page != null) { if (page != null) {
if (page.status == PageStatus.Active) { if (page.status == PlasmaComponents.PageStatus.Active) {
internal.setPageStatus(page, PageStatus.Inactive) internal.setPageStatus(page, PlasmaComponents.PageStatus.Inactive)
} }
if (owner != container) { if (owner != container) {
// container is not the owner of the page - re-parent back to original owner // container is not the owner of the page - re-parent back to original owner

View File

@ -212,8 +212,8 @@ function pop(page, immediate) {
// Checks if the orientation changes between oldPage and newPage // Checks if the orientation changes between oldPage and newPage
function orientationChanges(oldPage, newPage) { function orientationChanges(oldPage, newPage) {
return newPage.orientationLock != PageOrientation.Automatic return newPage.orientationLock != PlasmaComponents.PageOrientation.Automatic
&& newPage.orientationLock != PageOrientation.LockPrevious && newPage.orientationLock != PlasmaComponents.PageOrientation.LockPrevious
&& newPage.orientationLock != oldPage.orientationLock && newPage.orientationLock != oldPage.orientationLock
} }