From f39eb42889bf4a68122205dabe16485b18385b61 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 23 Jan 2023 19:34:48 -0800 Subject: [PATCH] remove references to pinnable --- docs/dev/Lua API.rst | 7 +------ library/lua/gui/widgets.lua | 16 ++++------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index a832639e6..eb05db0a1 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -4392,11 +4392,6 @@ Has attributes: hitting :kbd:`Esc` (while resizing with the mouse or keyboard), or by calling ``Panel:setKeyboardResizeEnabled(false)`` (while resizing with the keyboard). -* ``pinnable = bool`` (default: ``false``) - - Determines whether the panel will draw a pin icon in its frame. See - `ZScreen class`_ for details. - * ``autoarrange_subviews = bool`` (default: ``false``) * ``autoarrange_gap = int`` (default: ``0``) @@ -4458,7 +4453,7 @@ Window class ------------ Subclass of Panel; sets Panel attributes to useful defaults for a top-level -framed, pinnable, draggable window. +framed, draggable window. ResizingPanel class ------------------- diff --git a/library/lua/gui/widgets.lua b/library/lua/gui/widgets.lua index 21f79c0ef..ab4dad88e 100644 --- a/library/lua/gui/widgets.lua +++ b/library/lua/gui/widgets.lua @@ -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, } -------------------