|
@@ -66,7 +66,7 @@ function UIMiniWindow:maximize(dontSave)
|
66
|
66
|
signalcall(self.onMaximize, self)
|
67
|
67
|
end
|
68
|
68
|
|
69
|
|
-function UIMiniWindow:onSetup()
|
|
69
|
+function UIMiniWindow:setup()
|
70
|
70
|
self:getChildById('closeButton').onClick =
|
71
|
71
|
function()
|
72
|
72
|
self:close()
|
|
@@ -126,16 +126,11 @@ function UIMiniWindow:onSetup()
|
126
|
126
|
end
|
127
|
127
|
end
|
128
|
128
|
|
129
|
|
- if newParent and newParent:getClassName() == 'UIMiniWindowContainer' and self:isVisible() then
|
130
|
|
- newParent:fitAll(self)
|
131
|
|
- end
|
|
129
|
+ self:fitOnParent()
|
132
|
130
|
end
|
133
|
131
|
|
134
|
132
|
function UIMiniWindow:onVisibilityChange(visible)
|
135
|
|
- local parent = self:getParent()
|
136
|
|
- if visible and parent and parent:getClassName() == 'UIMiniWindowContainer' then
|
137
|
|
- parent:fitAll(self)
|
138
|
|
- end
|
|
133
|
+ self:fitOnParent()
|
139
|
134
|
end
|
140
|
135
|
|
141
|
136
|
function UIMiniWindow:onDragEnter(mousePos)
|
|
@@ -227,11 +222,7 @@ end
|
227
|
222
|
|
228
|
223
|
function UIMiniWindow:onHeightChange(height)
|
229
|
224
|
self:setSettings({height = height})
|
230
|
|
-
|
231
|
|
- local parent = self:getParent()
|
232
|
|
- if self:isVisible() and parent and parent:getClassName() == 'UIMiniWindowContainer' then
|
233
|
|
- parent:fitAll(self)
|
234
|
|
- end
|
|
225
|
+ self:fitOnParent()
|
235
|
226
|
end
|
236
|
227
|
|
237
|
228
|
function UIMiniWindow:getSettings(name)
|
|
@@ -295,6 +286,24 @@ function UIMiniWindow:disableResize()
|
295
|
286
|
self:getChildById('bottomResizeBorder'):disable()
|
296
|
287
|
end
|
297
|
288
|
|
|
289
|
+function UIMiniWindow:fitOnParent()
|
|
290
|
+ local parent = self:getParent()
|
|
291
|
+ if self:isVisible() and parent and parent:getClassName() == 'UIMiniWindowContainer' then
|
|
292
|
+ parent:fitAll(self)
|
|
293
|
+ end
|
|
294
|
+end
|
|
295
|
+
|
|
296
|
+function UIMiniWindow:setParent(parent)
|
|
297
|
+ UIWidget.setParent(self, parent)
|
|
298
|
+ self:saveParent(parent)
|
|
299
|
+ self:fitOnParent()
|
|
300
|
+end
|
|
301
|
+
|
|
302
|
+function UIMiniWindow:setHeight(height)
|
|
303
|
+ UIWidget.setHeight(self, height)
|
|
304
|
+ signalcall(self.onHeightChange, self, height)
|
|
305
|
+end
|
|
306
|
+
|
298
|
307
|
function UIMiniWindow:setContentHeight(height)
|
299
|
308
|
local contentsPanel = self:getChildById('contentsPanel')
|
300
|
309
|
local minHeight = contentsPanel:getMarginTop() + contentsPanel:getMarginBottom() + contentsPanel:getPaddingTop() + contentsPanel:getPaddingBottom()
|
|
@@ -328,3 +337,8 @@ function UIMiniWindow:getMaximumHeight()
|
328
|
337
|
local resizeBorder = self:getChildById('bottomResizeBorder')
|
329
|
338
|
return resizeBorder:getMaximum()
|
330
|
339
|
end
|
|
340
|
+
|
|
341
|
+function UIMiniWindow:isResizeable()
|
|
342
|
+ local resizeBorder = self:getChildById('bottomResizeBorder')
|
|
343
|
+ return resizeBorder:isVisible() and resizeBorder:isEnabled()
|
|
344
|
+end
|