4
1
mirror of https://github.com/QuasarApp/Snake.git synced 2025-05-02 20:49:43 +00:00

36 lines
859 B
QML
Raw Normal View History

2019-08-08 19:11:17 +03:00
import QtQuick 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Controls 2.12
2019-08-09 13:37:44 +03:00
import QtQuick.Layouts 1.3
2019-08-08 19:11:17 +03:00
SideBar {
id: leftSideBar
anchors.left: parent.left;
anchors.top: parent.top;
anchors.bottom: parent.bottom;
2019-08-09 13:37:44 +03:00
closedWidth: closeButton.width + padding * 2;
2019-08-08 19:11:17 +03:00
openWidth: 10 * metrix.pt;
resizeHeight: false;
2019-08-09 13:37:44 +03:00
header:
RowLayout {
2019-08-08 19:11:17 +03:00
2019-08-09 13:37:44 +03:00
Button {
id: closeButton
text: leftSideBar.isOpened? "<" : ">"
2019-08-08 19:11:17 +03:00
2019-08-09 13:37:44 +03:00
Layout.preferredHeight: metrix.controlPtMaterial;
Layout.preferredWidth: metrix.controlPtMaterial;
2019-08-08 19:11:17 +03:00
2019-08-09 13:37:44 +03:00
Layout.alignment: Qt.AlignRight | Qt.AlignTop
onClicked: {
if (leftSideBar.isOpened)
leftSideBar.hide();
else
leftSideBar.show();
}
2019-08-08 19:11:17 +03:00
}
}
}