Browse Source

UIMiniWindowContainer small improve (#938)

Change type of checking whether window have on drop possibility.

Reason:
Previously this parameter was checking by class name, so it blocking creating similar objects to miniwindow or inheritance from miniwindow object without changing sources. So it block creating modules with new UI objects working with miniwindowcontainer.
EgzoT 2 years ago
parent
commit
b58c438015

+ 1
- 0
modules/corelib/ui/uiminiwindow.lua View File

@@ -3,6 +3,7 @@ UIMiniWindow = extends(UIWindow, "UIMiniWindow")
3 3
 
4 4
 function UIMiniWindow.create()
5 5
   local miniwindow = UIMiniWindow.internalCreate()
6
+  miniwindow.UIMiniWindowContainer = true
6 7
   return miniwindow
7 8
 end
8 9
 

+ 1
- 1
modules/corelib/ui/uiminiwindowcontainer.lua View File

@@ -83,7 +83,7 @@ function UIMiniWindowContainer:fitAll(noRemoveChild)
83 83
 end
84 84
 
85 85
 function UIMiniWindowContainer:onDrop(widget, mousePos)
86
-  if widget:getClassName() == 'UIMiniWindow' then
86
+  if widget.UIMiniWindowContainer then
87 87
     local oldParent = widget:getParent()
88 88
     if oldParent == self then
89 89
       return true

Loading…
Cancel
Save