Improve SidePane auto-sizing and appearance

This commit is contained in:
miruka
2019-05-12 15:57:18 -04:00
parent 97c1dda4ba
commit f9a5902545
12 changed files with 62 additions and 23 deletions

View File

@@ -4,7 +4,7 @@ import "../Base"
Rectangle {
property var name: null
property var imageUrl: null
property int dimension: 36
property int dimension: HStyle.avatar.size
property bool hidden: false
width: dimension

View File

@@ -52,7 +52,7 @@ HScalingBox {
onClicked: buttonCallbacks[modelData.name](button)
Layout.fillWidth: true
Layout.preferredHeight: 32
Layout.preferredHeight: HStyle.avatar.size
}
}
}

View File

@@ -3,5 +3,22 @@ import QtQuick.Controls 1.4 as Controls1
//https://doc.qt.io/qt-5/qml-qtquick-controls-splitview.html
Controls1.SplitView {
handleDelegate: Item {}
id: splitView
property bool anyHovered: false
property bool anyPressed: false
property bool anyResizing: false
property bool canAutoSize: true
onAnyPressedChanged: canAutoSize = false
handleDelegate: Item {
readonly property bool hovered: styleData.hovered
readonly property bool pressed: styleData.pressed
readonly property bool resizing: styleData.resizing
onHoveredChanged: splitView.anyHovered = hovered
onPressedChanged: splitView.anyPressed = pressed
onResizingChanged: splitView.anyResizing = resizing
}
}

View File

@@ -115,6 +115,7 @@ QtObject {
}
readonly property QtObject avatar: QtObject {
property int size: 36
property int radius: style.radius
property color letter: "white"
@@ -130,4 +131,6 @@ QtObject {
property real saturation: 0.32
property real lightness: 0.3
}
property int bottomElementsHeight: 32
}