Browse Source
improved closed handling
Close now works for popups/dialogs with no view below
pull/2/head
Skycoder42
7 years ago
No known key found for this signature in database
GPG Key ID: 8E01AD9EF0578D2B
4 changed files with
12 additions and
7 deletions
-
src/imports/mvvmquick/DialogPresenter.qml
-
src/imports/mvvmquick/PopupPresenter.qml
-
src/imports/mvvmquick/PresentingStackView.qml
-
src/imports/mvvmquick/QtMvvmApp.qml
|
|
@ -56,6 +56,9 @@ QtObject { |
|
|
|
*/ |
|
|
|
property Item rootItem: null |
|
|
|
|
|
|
|
//TODO document |
|
|
|
readonly property bool empty: _popups.length == 0 |
|
|
|
|
|
|
|
/*! @brief The primary presenting method to present a dialog |
|
|
|
* |
|
|
|
* @param type:MessageConfig config The message configuration to create a dialog of |
|
|
|
|
|
@ -55,6 +55,9 @@ QtObject { |
|
|
|
*/ |
|
|
|
property Item rootItem: null |
|
|
|
|
|
|
|
//TODO document |
|
|
|
readonly property bool empty: _popups.length == 0 |
|
|
|
|
|
|
|
//! Internal property |
|
|
|
property var _popups: [] |
|
|
|
|
|
|
|
|
|
@ -113,15 +113,11 @@ StackView { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
if(_presenterStack.depth <= 1) |
|
|
|
return false; |
|
|
|
else { |
|
|
|
if(_presenterStack.safePop()) |
|
|
|
return true; |
|
|
|
else |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*! @brief Pop and delete a view |
|
|
|
* |
|
|
|
|
|
@ -172,6 +172,9 @@ ApplicationWindow { |
|
|
|
closed = _drawerLoader.item.closeAction(); |
|
|
|
if(!closed) |
|
|
|
closed = _rootStack.closeAction(); |
|
|
|
//if everything was closed -> still accept it |
|
|
|
if(closed && _rootDialogs.emtpy && _rootPopup.empty && _rootStack.empty) |
|
|
|
closed = false; |
|
|
|
return closed; |
|
|
|
} |
|
|
|
|
|
|
|