From 6a90ef2b6efca9024e2619b232102c495b050727 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 1 Apr 2018 13:57:02 +0100 Subject: [PATCH] Update RoundedCorners spoon for Hammerspoon --- .../Spoons/RoundedCorners.spoon/docs.json | 171 ++++++++++++++---- .../Spoons/RoundedCorners.spoon/init.lua | 2 +- 2 files changed, 141 insertions(+), 32 deletions(-) diff --git a/hammerspoon/Spoons/RoundedCorners.spoon/docs.json b/hammerspoon/Spoons/RoundedCorners.spoon/docs.json index 32c5c54..6c75560 100644 --- a/hammerspoon/Spoons/RoundedCorners.spoon/docs.json +++ b/hammerspoon/Spoons/RoundedCorners.spoon/docs.json @@ -1,39 +1,148 @@ [ { - "doc" : "Give your screens rounded corners", - "items" : [ + "Command": [], + "Constant": [], + "Constructor": [], + "Deprecated": [], + "Field": [], + "Function": [], + "Method": [ { - "doc" : "Controls whether corners are drawn on all screens or just the primary screen. Defaults to true", - "type" : "Variable", - "name" : "allScreens", - "def" : "RoundedCorners.allScreens" + "def": "RoundedCorners:start()", + "desc": "Starts RoundedCorners", + "doc": "Starts RoundedCorners\n\nParameters:\n * None\n\nReturns:\n * The RoundedCorners object\n\nNotes:\n * This will draw the rounded screen corners and start watching for changes in screen sizes/layouts, reacting accordingly", + "name": "start", + "notes": [ + " * This will draw the rounded screen corners and start watching for changes in screen sizes/layouts, reacting accordingly" + ], + "parameters": [ + " * None" + ], + "returns": [ + " * The RoundedCorners object" + ], + "signature": "RoundedCorners:start()", + "stripped_doc": "", + "type": "Method" }, { - "doc" : "Controls which level of the screens the corners are drawn at. See `hs.canvas.windowLevels` for more information. Defaults to `screenSaver + 1`", - "type" : "Variable", - "name" : "level", - "def" : "RoundedCorners.level" - }, - { - "doc" : "Controls the radius of the rounded corners, in points. Defaults to 6", - "type" : "Variable", - "name" : "radius", - "def" : "RoundedCorners.radius" - }, - { - "doc" : "Starts RoundedCorners\n\nParameters:\n * None\n\nReturns:\n * The RoundedCorners object\n\nNotes:\n * This will draw the rounded screen corners and start watching for changes in screen sizes\/layouts, reacting accordingly", - "type" : "Method", - "name" : "start", - "def" : "RoundedCorners:start()" - }, - { - "doc" : "Stops RoundedCorners\n\nParameters:\n * None\n\nReturns:\n * The RoundedCorners object\n\nNotes:\n * This will remove all rounded screen corners and stop watching for changes in screen sizes\/layouts", - "type" : "Method", - "name" : "stop", - "def" : "RoundedCorners:stop()" + "def": "RoundedCorners:stop()", + "desc": "Stops RoundedCorners", + "doc": "Stops RoundedCorners\n\nParameters:\n * None\n\nReturns:\n * The RoundedCorners object\n\nNotes:\n * This will remove all rounded screen corners and stop watching for changes in screen sizes/layouts", + "name": "stop", + "notes": [ + " * This will remove all rounded screen corners and stop watching for changes in screen sizes/layouts" + ], + "parameters": [ + " * None" + ], + "returns": [ + " * The RoundedCorners object" + ], + "signature": "RoundedCorners:stop()", + "stripped_doc": "", + "type": "Method" } ], - "name" : "RoundedCorners", - "desc" : "Give your screens rounded corners" + "Variable": [ + { + "def": "RoundedCorners.allScreens", + "desc": "Controls whether corners are drawn on all screens or just the primary screen. Defaults to true", + "doc": "Controls whether corners are drawn on all screens or just the primary screen. Defaults to true", + "name": "allScreens", + "signature": "RoundedCorners.allScreens", + "stripped_doc": "", + "type": "Variable" + }, + { + "def": "RoundedCorners.level", + "desc": "Controls which level of the screens the corners are drawn at. See `hs.canvas.windowLevels` for more information. Defaults to `screenSaver + 1`", + "doc": "Controls which level of the screens the corners are drawn at. See `hs.canvas.windowLevels` for more information. Defaults to `screenSaver + 1`", + "name": "level", + "signature": "RoundedCorners.level", + "stripped_doc": "", + "type": "Variable" + }, + { + "def": "RoundedCorners.radius", + "desc": "Controls the radius of the rounded corners, in points. Defaults to 6", + "doc": "Controls the radius of the rounded corners, in points. Defaults to 6", + "name": "radius", + "signature": "RoundedCorners.radius", + "stripped_doc": "", + "type": "Variable" + } + ], + "desc": "Give your screens rounded corners", + "doc": "Give your screens rounded corners\n\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/RoundedCorners.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/RoundedCorners.spoon.zip)", + "items": [ + { + "def": "RoundedCorners.allScreens", + "desc": "Controls whether corners are drawn on all screens or just the primary screen. Defaults to true", + "doc": "Controls whether corners are drawn on all screens or just the primary screen. Defaults to true", + "name": "allScreens", + "signature": "RoundedCorners.allScreens", + "stripped_doc": "", + "type": "Variable" + }, + { + "def": "RoundedCorners.level", + "desc": "Controls which level of the screens the corners are drawn at. See `hs.canvas.windowLevels` for more information. Defaults to `screenSaver + 1`", + "doc": "Controls which level of the screens the corners are drawn at. See `hs.canvas.windowLevels` for more information. Defaults to `screenSaver + 1`", + "name": "level", + "signature": "RoundedCorners.level", + "stripped_doc": "", + "type": "Variable" + }, + { + "def": "RoundedCorners.radius", + "desc": "Controls the radius of the rounded corners, in points. Defaults to 6", + "doc": "Controls the radius of the rounded corners, in points. Defaults to 6", + "name": "radius", + "signature": "RoundedCorners.radius", + "stripped_doc": "", + "type": "Variable" + }, + { + "def": "RoundedCorners:start()", + "desc": "Starts RoundedCorners", + "doc": "Starts RoundedCorners\n\nParameters:\n * None\n\nReturns:\n * The RoundedCorners object\n\nNotes:\n * This will draw the rounded screen corners and start watching for changes in screen sizes/layouts, reacting accordingly", + "name": "start", + "notes": [ + " * This will draw the rounded screen corners and start watching for changes in screen sizes/layouts, reacting accordingly" + ], + "parameters": [ + " * None" + ], + "returns": [ + " * The RoundedCorners object" + ], + "signature": "RoundedCorners:start()", + "stripped_doc": "", + "type": "Method" + }, + { + "def": "RoundedCorners:stop()", + "desc": "Stops RoundedCorners", + "doc": "Stops RoundedCorners\n\nParameters:\n * None\n\nReturns:\n * The RoundedCorners object\n\nNotes:\n * This will remove all rounded screen corners and stop watching for changes in screen sizes/layouts", + "name": "stop", + "notes": [ + " * This will remove all rounded screen corners and stop watching for changes in screen sizes/layouts" + ], + "parameters": [ + " * None" + ], + "returns": [ + " * The RoundedCorners object" + ], + "signature": "RoundedCorners:stop()", + "stripped_doc": "", + "type": "Method" + } + ], + "name": "RoundedCorners", + "stripped_doc": "\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/RoundedCorners.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/RoundedCorners.spoon.zip)", + "submodules": [], + "type": "Module" } -] +] \ No newline at end of file diff --git a/hammerspoon/Spoons/RoundedCorners.spoon/init.lua b/hammerspoon/Spoons/RoundedCorners.spoon/init.lua index 6e1bbdf..4a363ed 100644 --- a/hammerspoon/Spoons/RoundedCorners.spoon/init.lua +++ b/hammerspoon/Spoons/RoundedCorners.spoon/init.lua @@ -117,7 +117,7 @@ function obj:render() { action="clip", type="circle", center=data.center, radius=radius, reversePath=true, }, { action="fill", type="rectangle", frame={x=0, y=0, w=radius, h=radius, }, fillColor={ alpha=1, }}, { type="resetClip", } - ):behavior(hs.canvas.windowBehaviors.canJoinAllSpaces):show() + ):behavior(hs.canvas.windowBehaviors.canJoinAllSpaces):level(self.level):show() end end) end