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.
40 lines
643 B
40 lines
643 B
|
8 years ago
|
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; //TODO test
|
||
|
|
_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;
|
||
|
|
}
|
||
|
|
}
|