Migration of QtMvvm from github
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
690 B

import QtQuick 2.10
import QtQuick.Controls 2.3
Drawer {
id: _presentingDrawer
width: Math.min(300, parent.width - 24);
height: parent.height - y
property Item _mainChild: null
function toggle() {
if(visible)
close();
else
open();
}
function presentDrawerContent(item) {
if(_mainChild)
_mainChild.destroy();
item.parent = _presentingDrawer.contentItem; //TODO test
item.drawer = _presentingDrawer;
_mainChild = item;
return true;
}
function closeAction() {
if(_mainChild && typeof _mainChild.closeAction == "function") {
if(_mainChild.closeAction())
return true;
}
if(visible) {
close();
return true;
} else
return false;
}
}