Fixed #12 #28 #51 issues

This commit is contained in:
Henrique Santiago
2012-08-17 18:36:53 -03:00
parent a91b7ed6be
commit 4d2bd54f6b
17 changed files with 108 additions and 38 deletions

View File

@@ -138,6 +138,24 @@ function UIMiniWindow:onDragEnter(mousePos)
return true
end
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
if self.movedWidget then
self.setMovedChildMargin(0)
self.movedWidget = nil
self.setMovedChildMargin = nil
self.movedIndex = nil
end
local parent = self:getParent()
if parent then
if parent:getClassName() == 'UIMiniWindowContainer' then
parent:saveChildren()
else
self:saveParentPosition(parent:getId(), self:getPosition())
end
end
end
function UIMiniWindow:onDragMove(mousePos, mouseMoved)
local oldMousePosY = mousePos.y - mouseMoved.y
local children = rootWidget:recursiveGetChildrenByMarginPos(mousePos)
@@ -188,24 +206,6 @@ function UIMiniWindow:onMousePress()
end
end
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
if self.movedWidget then
self.setMovedChildMargin(0)
self.movedWidget = nil
self.setMovedChildMargin = nil
self.movedIndex = nil
end
local parent = self:getParent()
if parent then
if parent:getClassName() == 'UIMiniWindowContainer' then
parent:saveChildren()
else
self:saveParentPosition(parent:getId(), self:getPosition())
end
end
end
function UIMiniWindow:onFocusChange(focused)
-- miniwindows only raises when its outside MiniWindowContainers
if not focused then return end
@@ -253,3 +253,13 @@ end
function UIMiniWindow:disableResize()
self:getChildById('bottomResizeBorder'):disable()
end
function UIMiniWindow:setMinimumHeight(height)
local resizeBorder = self:getChildById('bottomResizeBorder')
resizeBorder:setMinimum(height)
end
function UIMiniWindow:setMaximumHeight(height)
local resizeBorder = self:getChildById('bottomResizeBorder')
resizeBorder:setMaximum(height)
end

View File

@@ -8,6 +8,10 @@ function UIWindow.create()
return window
end
function UIWindow:getClassName()
return 'UIWindow'
end
function UIWindow:onKeyDown(keyCode, keyboardModifiers)
if keyboardModifiers == KeyboardNoModifier then
if keyCode == KeyEnter then