rework splitter implementation

This commit is contained in:
Eduardo Bart
2012-03-23 00:06:00 -03:00
parent 79a1d66f3f
commit b301aa1a2b
4 changed files with 51 additions and 56 deletions

View File

@@ -16,6 +16,33 @@ UIWidget
anchors.fill: parent
anchors.top: topMenu.bottom
GameMapPanel
id: gameMapPanel
anchors.left: gameLeftPanel.right
anchors.right: gameRightPanel.left
anchors.top: parent.top
anchors.bottom: gameBottomPanel.top
focusable: false
UISplitter
id: mapSplitter
anchors.left: gameLeftPanel.right
anchors.right: gameRightPanel.left
anchors.bottom: parent.bottom
relative-margin: bottom
margin-bottom: 172
height: 4
margin-top: -2
background: red
@canUpdateMargin: function(self, newMargin) return math.min(math.max(newMargin, 100), self:getParent():getHeight() - 300) end
GameBottomPanel
id: gameBottomPanel
anchors.left: gameLeftPanel.right
anchors.right: gameRightPanel.left
anchors.top: mapSplitter.top
anchors.bottom: parent.bottom
GameSidePanel
id: gameRightPanel
width: 190
@@ -32,32 +59,6 @@ UIWidget
anchors.top: parent.top
anchors.bottom: parent.bottom
GameBottomPanel
id: gameBottomPanel
height: 170
anchors.left: gameLeftPanel.right
anchors.right: gameRightPanel.left
anchors.bottom: parent.bottom
@onGeometryChange: self:getParent():getChildById('mapSplitter'):setGrow(self:getHeight() > 100)
GameMapPanel
id: gameMapPanel
anchors.left: gameLeftPanel.right
anchors.right: gameRightPanel.left
anchors.top: parent.top
anchors.bottom: gameBottomPanel.top
focusable: false
@onGeometryChange: self:getParent():getChildById('mapSplitter'):setShrink(self:getHeight() > 300)
UISplitter
id: mapSplitter
anchors.left: gameBottomPanel.left
anchors.right: gameBottomPanel.right
anchors.top: gameBottomPanel.top
attached-to: gameBottomPanel
height: 4
margin-top: -2
UIWidget
id: mouseGrabber
focusable: false