Rename some HDrawer props for more clarity

This commit is contained in:
miruka 2019-12-10 14:19:25 -04:00
parent 29cf78fe18
commit 0578844eef
4 changed files with 14 additions and 14 deletions

View File

@ -30,25 +30,25 @@ Drawer {
property Item referenceSizeParent: parent
property int normalSize:
property int preferredSize:
horizontal ? referenceSizeParent.width : referenceSizeParent.height
property int minNormalSize: resizeAreaSize
property int maxNormalSize:
property int minimumSize: resizeAreaSize
property int maximumSize:
horizontal ?
referenceSizeParent.width - theme.minimumSupportedWidth :
referenceSizeParent.height - theme.minimumSupportedHeight
property bool collapse:
(horizontal ? window.width : window.height) < 400
property int collapseExpandSize:
property int peekSizeWhileCollapsed:
horizontal ? referenceSizeParent.width : referenceSizeParent.height
property int resizeAreaSize: theme.spacing / 2
readonly property int calculatedSize:
collapse ?
collapseExpandSize :
Math.max(minNormalSize, Math.min(normalSize, maxNormalSize))
peekSizeWhileCollapsed :
Math.max(minimumSize, Math.min(preferredSize, maximumSize))
readonly property int visibleSize: visible ? width * position : 0
@ -88,18 +88,18 @@ Drawer {
Qt.ArrowCursor
onPressed: canResize = true
onReleased: { canResize = false; userResized(drawer.normalSize) }
onReleased: {canResize = false; userResized(drawer.preferredSize)}
onMouseXChanged:
if (horizontal && canResize) {
drawer.normalSize =
drawer.preferredSize =
drawer.calculatedSize +
(drawer.edge === Qt.RightEdge ? -mouseX : mouseX)
}
onMouseYChanged:
if (vertical && canResize) {
drawer.normalSize =
drawer.preferredSize =
drawer.calculatedSize +
(drawer.edge === Qt.BottomEdge ? -mouseY : mouseY)
}

View File

@ -5,8 +5,8 @@ import "../../Base"
HDrawer {
id: roomSidePane
edge: Qt.RightEdge
normalSize: buttonRepeater.childrenImplicitWidth
minNormalSize:
preferredSize: buttonRepeater.childrenImplicitWidth
minimumSize:
buttonRepeater.count > 0 ? buttonRepeater.itemAt(0).implicitWidth : 0
background: HColumnLayout{

View File

@ -12,7 +12,7 @@ HDrawer {
y: vertical ? 0 : referenceSizeParent.height / 2 - height / 2
width: horizontal ? calculatedSize : Math.min(window.width, 720)
height: vertical ? calculatedSize : Math.min(window.height, 720)
normalSize: 400
preferredSize: 400
z: 9999
position: 0

View File

@ -6,8 +6,8 @@ import "../utils.js" as Utils
HDrawer {
id: sidePane
color: theme.sidePane.background
normalSize: window.uiState.sidePaneManualWidth || 300
minNormalSize: theme.controls.avatar.size + theme.spacing * 2
preferredSize: window.uiState.sidePaneManualWidth || 300
minimumSize: theme.controls.avatar.size + theme.spacing * 2
onUserResized: {
window.uiState.sidePaneManualWidth = newWidth