From 686298e02397b4165fcbee4008e2cdcf137c1020 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 5 Jun 2021 23:36:08 +0200 Subject: Somewhat reenable the adaptive layout --- resources/qml/components/AdaptiveLayoutElement.qml | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 resources/qml/components/AdaptiveLayoutElement.qml (limited to 'resources/qml/components/AdaptiveLayoutElement.qml') 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; + }); + } +} -- cgit 1.5.1