summary refs log tree commit diff
path: root/resources/qml/components/AdaptiveLayoutElement.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-06-05 23:36:08 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-06-08 22:22:29 +0200
commit686298e02397b4165fcbee4008e2cdcf137c1020 (patch)
tree8f290f120dd846214206ea3fc7ad741cf17aea21 /resources/qml/components/AdaptiveLayoutElement.qml
parentFix html in completer (diff)
downloadnheko-686298e02397b4165fcbee4008e2cdcf137c1020.tar.xz
Somewhat reenable the adaptive layout
Diffstat (limited to 'resources/qml/components/AdaptiveLayoutElement.qml')
-rw-r--r--resources/qml/components/AdaptiveLayoutElement.qml26
1 files changed, 26 insertions, 0 deletions
diff --git a/resources/qml/components/AdaptiveLayoutElement.qml b/resources/qml/components/AdaptiveLayoutElement.qml
new file mode 100644

index 00000000..411f6c64 --- /dev/null +++ b/resources/qml/components/AdaptiveLayoutElement.qml
@@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2021 Nheko Contributors +// +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 + +Item { + property int minimumWidth: 100 + property int maximumWidth: 400 + property int collapsedWidth: 40 + property bool collapsible: true + property bool collapsed: width < minimumWidth + property int splitterWidth: 1 + property int preferredWidth: 100 + + Component.onCompleted: { + children[0].width = Qt.binding(() => { + return parent.singlePageMode ? parent.width : width - splitterWidth; + }); + children[0].height = Qt.binding(() => { + return parent.height; + }); + } +}