Compare commits
No commits in common. "41b72f95c1a566ac7009cb037af9877f6f1d1502" and "b34a43897aba904dca342651afc83877e1b99a69" have entirely different histories.
41b72f95c1
...
b34a43897a
51
rc.fnl
51
rc.fnl
@ -4,13 +4,6 @@
|
|||||||
(local matrix (require :matrix))
|
(local matrix (require :matrix))
|
||||||
(local socket-repl (require :socket-repl))
|
(local socket-repl (require :socket-repl))
|
||||||
|
|
||||||
(local app-state
|
|
||||||
{
|
|
||||||
:in-overview false
|
|
||||||
:focus-view nil
|
|
||||||
:views []
|
|
||||||
})
|
|
||||||
|
|
||||||
(let [repl-socket-name
|
(let [repl-socket-name
|
||||||
(..
|
(..
|
||||||
(: (os.getenv "XDG_RUNTIME_DIR") :gsub "/$" "")
|
(: (os.getenv "XDG_RUNTIME_DIR") :gsub "/$" "")
|
||||||
@ -32,43 +25,9 @@
|
|||||||
(print "WHOOSH")
|
(print "WHOOSH")
|
||||||
true)
|
true)
|
||||||
|
|
||||||
(fn show-overview []
|
|
||||||
(let [facets 64
|
|
||||||
angle (/ (* 2 math.pi) facets)
|
|
||||||
scale 0.6
|
|
||||||
y-offset (+ (* 1 680)
|
|
||||||
(/ (* 360 facets) (* 2 math.pi)))
|
|
||||||
]
|
|
||||||
(each [i view (ipairs app-state.views)]
|
|
||||||
(doto view
|
|
||||||
(: :set_matrix
|
|
||||||
(-> matrix.identity
|
|
||||||
(matrix.scale scale scale)
|
|
||||||
(matrix.translate (* 2 180) (+ y-offset))
|
|
||||||
(matrix.rotate (/ (* (- i 2
|
|
||||||
) angle) 1))
|
|
||||||
(matrix.translate (* -2 180) (- y-offset))
|
|
||||||
(matrix.translate 120 150)
|
|
||||||
))
|
|
||||||
(: :show)))))
|
|
||||||
|
|
||||||
|
|
||||||
(fn hide-overview []
|
|
||||||
(each [k view (pairs app-state.views)]
|
|
||||||
(view:set_matrix matrix.identity)
|
|
||||||
(if (= (view:id) (app-state.focus-view:id))
|
|
||||||
(doto view
|
|
||||||
(: :show)
|
|
||||||
(: :focus))
|
|
||||||
(view:hide))))
|
|
||||||
|
|
||||||
(fn carousel []
|
(fn carousel []
|
||||||
(let [was app-state.in-overview]
|
(print "spin spin sugar")
|
||||||
(if was
|
true)
|
||||||
(hide-overview)
|
|
||||||
(show-overview))
|
|
||||||
(: (kiwmi:active_output) :redraw)
|
|
||||||
(tset app-state :in-overview (not was))))
|
|
||||||
|
|
||||||
(fn placements [output]
|
(fn placements [output]
|
||||||
(let [(width height) (output:size)
|
(let [(width height) (output:size)
|
||||||
@ -118,7 +77,7 @@
|
|||||||
r (output:renderer)
|
r (output:renderer)
|
||||||
kill (texture.from-file r "close-window.png")
|
kill (texture.from-file r "close-window.png")
|
||||||
launch (texture.from-file r "launcher.png")
|
launch (texture.from-file r "launcher.png")
|
||||||
overview (texture.from-file r "carousel.png")]
|
spinner (texture.from-file r "carousel.png")]
|
||||||
(output:on "render"
|
(output:on "render"
|
||||||
(fn [{: output : renderer}]
|
(fn [{: output : renderer}]
|
||||||
(let [buttons (placements output)]
|
(let [buttons (placements output)]
|
||||||
@ -136,7 +95,7 @@
|
|||||||
buttons.launch.x buttons.launch.y
|
buttons.launch.x buttons.launch.y
|
||||||
0.7)
|
0.7)
|
||||||
(renderer:draw_texture
|
(renderer:draw_texture
|
||||||
overview
|
spinner
|
||||||
matrix.identity
|
matrix.identity
|
||||||
buttons.overview.x buttons.overview.y
|
buttons.overview.x buttons.overview.y
|
||||||
0.7)))))))
|
0.7)))))))
|
||||||
@ -161,8 +120,6 @@
|
|||||||
(view:move geom.application.x geom.application.y))
|
(view:move geom.application.x geom.application.y))
|
||||||
(view:focus)
|
(view:focus)
|
||||||
(view:show)
|
(view:show)
|
||||||
(tset app-state :focus-view view)
|
|
||||||
(table.insert app-state.views view)
|
|
||||||
(view:on "request_move" #(view:imove))
|
(view:on "request_move" #(view:imove))
|
||||||
(view:on "request_resize" (fn [ev] (view:iresize ev.edges)))))
|
(view:on "request_resize" (fn [ev] (view:iresize ev.edges)))))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user