HDrawer: provide real visible size prop→fix issues

This commit is contained in:
miruka 2019-12-09 13:52:02 -04:00
parent 6627c6341a
commit 2e780d7c6a
3 changed files with 6 additions and 2 deletions

View File

@ -50,6 +50,8 @@ Drawer {
collapseExpandSize : collapseExpandSize :
Math.max(minNormalSize, Math.min(normalSize, maxNormalSize)) Math.max(minNormalSize, Math.min(normalSize, maxNormalSize))
readonly property int visibleSize: visible ? width * position : 0
readonly property bool horizontal: readonly property bool horizontal:
edge === Qt.LeftEdge || edge === Qt.RightEdge edge === Qt.LeftEdge || edge === Qt.RightEdge

View File

@ -21,6 +21,8 @@ Item {
modelSources[["Room", userId]] || [], "room_id", roomId modelSources[["Room", userId]] || [], "room_id", roomId
) || "waiting" ) || "waiting"
readonly property alias roomSidePane: roomSidePane
onRoomInfoChanged: { onRoomInfoChanged: {
if (roomInfo.left) { if (roomInfo.left) {
@ -37,7 +39,7 @@ Item {
HLoader { HLoader {
anchors.rightMargin: roomSidePane.width * roomSidePane.position anchors.rightMargin: roomSidePane.visibleWidth
anchors.fill: parent anchors.fill: parent
visible: ! roomSidePane.hidden || anchors.rightMargin < width visible: ! roomSidePane.hidden || anchors.rightMargin < width

View File

@ -61,7 +61,7 @@ Item {
HLoader { HLoader {
id: pageLoader id: pageLoader
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: sidePane.width * sidePane.position anchors.leftMargin: sidePane.visibleSize
visible: ! sidePane.hidden || anchors.leftMargin < width visible: ! sidePane.hidden || anchors.leftMargin < width
// onSourceChanged: if (sidePane.collapse) sidePane.close() // onSourceChanged: if (sidePane.collapse) sidePane.close()