mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
rework splitter implementation
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user