fix(StatusAppThreePanelLayout): limit right panel width to 300px

Also added handle in DemoApp as well as hiding text when in minimum
width for right and left panels
This commit is contained in:
Alexandra Betouni 2021-07-26 17:39:35 +03:00 committed by Michał Cieślak
parent 567dab012e
commit dec0083793
2 changed files with 12 additions and 0 deletions

View File

@ -408,6 +408,12 @@ Rectangle {
StatusAppThreePanelLayout {
id: root
handle: Rectangle {
implicitWidth: 5
color: SplitHandle.pressed ? Theme.palette.baseColor2
: (SplitHandle.hovered ? Qt.darker(Theme.palette.baseColor5, 1.1) : "transparent")
}
leftPanel: Item {
id: leftPanel
@ -567,12 +573,15 @@ Rectangle {
}
rightPanel: Item {
id: rightPanel
StatusBaseText {
id: titleText
anchors.top: parent.top
anchors.topMargin:16
anchors.left: parent.left
anchors.leftMargin: 16
opacity: (rightPanel.width > 50) ? 1.0 : 0.0
visible: (opacity > 0.1)
font.pixelSize: 15
text: qsTr("Members")
}
@ -601,6 +610,8 @@ Rectangle {
StatusBaseText {
height: parent.height
horizontalAlignment: Text.AlignHCenter
opacity: (rightPanel.width > 50) ? 1.0 : 0.0
visible: (opacity > 0.1)
font.pixelSize: 15
color: Theme.palette.directColor1
text: modelData

View File

@ -16,6 +16,7 @@ SplitView {
property bool showRightPanel
Control {
SplitView.minimumWidth: 300
SplitView.preferredWidth: 300
SplitView.fillHeight: true
contentItem: (!!leftPanel) ? leftPanel : null