|
|
|
@ -81,7 +81,6 @@ Panel.ATTRS {
|
|
|
|
|
resize_min = DEFAULT_NIL,
|
|
|
|
|
on_resize_begin = DEFAULT_NIL,
|
|
|
|
|
on_resize_end = DEFAULT_NIL,
|
|
|
|
|
pinnable = false,
|
|
|
|
|
autoarrange_subviews = false, -- whether to automatically lay out subviews
|
|
|
|
|
autoarrange_gap = 0, -- how many blank lines to insert between widgets
|
|
|
|
|
}
|
|
|
|
@ -272,21 +271,21 @@ local function Panel_on_double_click(self)
|
|
|
|
|
Panel_update_frame(self, frame, true)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function panel_is_on_pin(self)
|
|
|
|
|
local function panel_mouse_is_on_pause_icon(self)
|
|
|
|
|
local frame_rect = self.frame_rect
|
|
|
|
|
local x,y = dscreen.getMousePos()
|
|
|
|
|
return (x == frame_rect.x2-2 or x == frame_rect.x2-1)
|
|
|
|
|
and (y == frame_rect.y1-1 or y == frame_rect.y1)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function panel_is_pinnable(self)
|
|
|
|
|
return self.pinnable and self.parent_view and self.parent_view.togglePinned
|
|
|
|
|
local function panel_has_pause_icon(self)
|
|
|
|
|
return self.parent_view and self.parent_view.force_pause
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Panel:getMouseFramePos()
|
|
|
|
|
local x,y = Panel.super.getMouseFramePos(self)
|
|
|
|
|
if x then return x, y end
|
|
|
|
|
if panel_is_pinnable(self) and panel_is_on_pin(self) then
|
|
|
|
|
if panel_has_pause_icon(self) and panel_mouse_is_on_pause_icon(self) then
|
|
|
|
|
local frame_rect = self.frame_rect
|
|
|
|
|
return frame_rect.width - 3, 0
|
|
|
|
|
end
|
|
|
|
@ -320,12 +319,6 @@ function Panel:onInput(keys)
|
|
|
|
|
end
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
if panel_is_pinnable(self) and keys._MOUSE_L_DOWN then
|
|
|
|
|
if panel_is_on_pin(self) then
|
|
|
|
|
self.parent_view:togglePinned()
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if Panel.super.onInput(self, keys) then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
@ -532,7 +525,6 @@ Window.ATTRS {
|
|
|
|
|
frame_background = gui.CLEAR_PEN,
|
|
|
|
|
frame_inset = 1,
|
|
|
|
|
draggable = true,
|
|
|
|
|
pinnable = true,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-------------------
|
|
|
|
|