comparison UI.lua @ 55:1b8c597dba44

added movement fading todo: sort out dock mouseover hitches
author Nenue
date Wed, 06 Jan 2016 07:37:17 -0500
parents c3166f700438
children 0a9a6740ea5d
comparison
equal deleted inserted replaced
54:25725b0c933c 55:1b8c597dba44
36 end 36 end
37 37
38 38
39 local function Console_Save(self) 39 local function Console_Save(self)
40 local db = D.channels[self.index] 40 local db = D.channels[self.index]
41 if self.x then
42 db.x = self.x
43 else
44 db.x = self:GetLeft() 41 db.x = self:GetLeft()
45 end
46
47 if self.y then
48 db.y = self.y
49 else
50 db.y = (self:GetTop() - GetScreenHeight()) 42 db.y = (self:GetTop() - GetScreenHeight())
51 end
52
53 if self.width then
54 db.width = self.width
55 else
56 db.width = self:GetWidth() 43 db.width = self:GetWidth()
57 end
58 44
59 if not self.minimized then 45 if not self.minimized then
60 if self.height then 46 db.height = self:GetHeight()
61 db.height = self.height
62 else
63 db.height = self:GetHeight()
64 end
65 self:SetHeight(db.height) 47 self:SetHeight(db.height)
66 end 48 end
67 49
68 db.dockedTo = self.dockedTo 50 db.dockedTo = self.dockedTo
69 db.docked = self.docked 51 db.docked = self.docked
120 local function Console_MouseDown(self, button, up) 102 local function Console_MouseDown(self, button, up)
121 if button == 'LeftButton' then 103 if button == 'LeftButton' then
122 if up then 104 if up then
123 self:StopMovingOrSizing() 105 self:StopMovingOrSizing()
124 self:ToFront() 106 self:ToFront()
125 self.x = nil
126 self.y = nil
127 self.width = nil
128 self.height = nil
129 self:Save() 107 self:Save()
130 elseif self.out.grip:IsMouseOver() then 108 elseif self.out.grip:IsMouseOver() then
131 self:StartSizing() 109 self:StartSizing()
132 else 110 else
133 self:StartMoving() 111 self:StartMoving()
333 channel:Minimize() 311 channel:Minimize()
334 else 312 else
335 channel:Maximize() 313 channel:Maximize()
336 end 314 end
337 315
338 if channel.enabled and db.enabled then -- hide or show last since Min/Max mess with visibility 316 if channel.enabled then -- hide or show last since Min/Max mess with visibility
339 --print('setchan(5a) enable') 317 --print('setchan(5a) enable')
340 channel:Show() 318 channel:Show()
341 channel:ToFront() 319 channel:ToFront()
342 else 320 else
343 --print('setchan(5a) disable') 321 --print('setchan(5a) disable')
344 channel:Hide() 322 channel:Hide()
345 end 323 end