Skip to content

Commit

Permalink
fix canvas position
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfinal committed Nov 15, 2017
1 parent 4d8042d commit 1e44593
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 135 deletions.
104 changes: 52 additions & 52 deletions Spoons/CountDown.spoon/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,139 +23,139 @@
"Constructor" : [

],
"items" : [
"Field" : [

],
"Method" : [
{
"parameters" : [

" * minutes - How many minutes"
],
"stripped_doc" : [
"Pause or resume the existing countdown."
"Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.",
""
],
"desc" : "Pause or resume the existing countdown.",
"doc" : "Pause or resume the existing countdown.",
"desc" : "Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.",
"doc" : "Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.\n\nParameters:\n * minutes - How many minutes",
"notes" : [

],
"signature" : "CountDown:pauseOrResume()",
"signature" : "CountDown:startFor(minutes)",
"type" : "Method",
"returns" : [

],
"def" : "CountDown:pauseOrResume()",
"name" : "pauseOrResume"
"name" : "startFor",
"def" : "CountDown:startFor(minutes)"
},
{
"parameters" : [
" * progress - an number specifying the value of progress (0.0 - 1.0)"

],
"stripped_doc" : [
"Set the progress of visual indicator to `progress`.",
""
"Pause or resume the existing countdown."
],
"desc" : "Set the progress of visual indicator to `progress`.",
"doc" : "Set the progress of visual indicator to `progress`.\n\nParameters:\n * progress - an number specifying the value of progress (0.0 - 1.0)",
"desc" : "Pause or resume the existing countdown.",
"doc" : "Pause or resume the existing countdown.",
"notes" : [

],
"signature" : "CountDown:setProgress(progress)",
"signature" : "CountDown:pauseOrResume()",
"type" : "Method",
"returns" : [

],
"def" : "CountDown:setProgress(progress)",
"name" : "setProgress"
"name" : "pauseOrResume",
"def" : "CountDown:pauseOrResume()"
},
{
"parameters" : [
" * minutes - How many minutes"
" * progress - an number specifying the value of progress (0.0 - 1.0)"
],
"stripped_doc" : [
"Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.",
"Set the progress of visual indicator to `progress`.",
""
],
"desc" : "Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.",
"doc" : "Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.\n\nParameters:\n * minutes - How many minutes",
"desc" : "Set the progress of visual indicator to `progress`.",
"doc" : "Set the progress of visual indicator to `progress`.\n\nParameters:\n * progress - an number specifying the value of progress (0.0 - 1.0)",
"notes" : [

],
"signature" : "CountDown:startFor(minutes)",
"signature" : "CountDown:setProgress(progress)",
"type" : "Method",
"returns" : [

],
"def" : "CountDown:startFor(minutes)",
"name" : "startFor"
"name" : "setProgress",
"def" : "CountDown:setProgress(progress)"
}
],
"Method" : [
"Command" : [

],
"items" : [
{
"parameters" : [
" * minutes - How many minutes"

],
"stripped_doc" : [
"Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.",
""
"Pause or resume the existing countdown."
],
"desc" : "Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.",
"doc" : "Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.\n\nParameters:\n * minutes - How many minutes",
"desc" : "Pause or resume the existing countdown.",
"doc" : "Pause or resume the existing countdown.",
"notes" : [

],
"signature" : "CountDown:startFor(minutes)",
"signature" : "CountDown:pauseOrResume()",
"type" : "Method",
"returns" : [

],
"def" : "CountDown:startFor(minutes)",
"name" : "startFor"
"name" : "pauseOrResume",
"def" : "CountDown:pauseOrResume()"
},
{
"parameters" : [

" * progress - an number specifying the value of progress (0.0 - 1.0)"
],
"stripped_doc" : [
"Pause or resume the existing countdown."
"Set the progress of visual indicator to `progress`.",
""
],
"desc" : "Pause or resume the existing countdown.",
"doc" : "Pause or resume the existing countdown.",
"desc" : "Set the progress of visual indicator to `progress`.",
"doc" : "Set the progress of visual indicator to `progress`.\n\nParameters:\n * progress - an number specifying the value of progress (0.0 - 1.0)",
"notes" : [

],
"signature" : "CountDown:pauseOrResume()",
"signature" : "CountDown:setProgress(progress)",
"type" : "Method",
"returns" : [

],
"def" : "CountDown:pauseOrResume()",
"name" : "pauseOrResume"
"name" : "setProgress",
"def" : "CountDown:setProgress(progress)"
},
{
"parameters" : [
" * progress - an number specifying the value of progress (0.0 - 1.0)"
" * minutes - How many minutes"
],
"stripped_doc" : [
"Set the progress of visual indicator to `progress`.",
"Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.",
""
],
"desc" : "Set the progress of visual indicator to `progress`.",
"doc" : "Set the progress of visual indicator to `progress`.\n\nParameters:\n * progress - an number specifying the value of progress (0.0 - 1.0)",
"desc" : "Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.",
"doc" : "Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance.\n\nParameters:\n * minutes - How many minutes",
"notes" : [

],
"signature" : "CountDown:setProgress(progress)",
"signature" : "CountDown:startFor(minutes)",
"type" : "Method",
"returns" : [

],
"def" : "CountDown:setProgress(progress)",
"name" : "setProgress"
"name" : "startFor",
"def" : "CountDown:startFor(minutes)"
}
],
"Command" : [

],
"Field" : [

],
"doc" : "Tiny countdown with visual indicator\n\nDownload: [https:\/\/github.com\/Hammerspoon\/Spoons\/raw\/master\/Spoons\/CountDown.spoon.zip](https:\/\/github.com\/Hammerspoon\/Spoons\/raw\/master\/Spoons\/CountDown.spoon.zip)",
"name" : "CountDown"
Expand Down
4 changes: 2 additions & 2 deletions Spoons/CountDown.spoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function obj:startFor(minutes)
else
local mainScreen = hs.screen.mainScreen()
local mainRes = mainScreen:fullFrame()
obj.canvas:frame({x=mainRes.x, y=mainRes.h-5, w=mainRes.w, h=5})
obj.canvas:frame({x=mainRes.x, y=mainRes.y+mainRes.h-5, w=mainRes.w, h=5})
-- Set minimum visual step to 2px (i.e. Make sure every trigger updates 2px on screen at least.)
local minimumStep = 2
local secCount = math.ceil(60*minutes)
Expand Down Expand Up @@ -109,7 +109,7 @@ function obj:setProgress(progress, notifystr)
-- Make the canvas actully visible
local mainScreen = hs.screen.mainScreen()
local mainRes = mainScreen:fullFrame()
obj.canvas:frame({x=mainRes.x, y=mainRes.h-5, w=mainRes.w, h=5})
obj.canvas:frame({x=mainRes.x, y=mainRes.y+mainRes.h-5, w=mainRes.w, h=5})
end
if progress >= 1 then
canvasCleanup()
Expand Down
Loading

0 comments on commit 1e44593

Please sign in to comment.