-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathui.lua
More file actions
96 lines (78 loc) · 1.94 KB
/
Copy pathui.lua
File metadata and controls
96 lines (78 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
local M = {}
local api = require "timerly.api"
local state = require "timerly.state"
local voltui = require "volt.ui"
M.modes = function()
local hovermark = vim.g.nvmark_hovered
local mode = state.mode
local focus_m = {
" Focus ",
((mode == "focus" or hovermark == "focus_m") and "exgreen") or "commentfg",
{
hover = { id = "focus_m", redraw = "modes" },
click = api.togglemode,
},
}
local break_m = {
" Break",
((mode == "break" or hovermark == "break_m") and "exgreen") or "commentfg",
{
hover = { id = "break_m", redraw = "modes" },
click = api.togglemode,
},
}
return {
{ { "│ ", "commentfg" }, { " Modes " }, focus_m, break_m, { " │", "commentfg" } },
}
end
M.clock = function()
return state.clock
end
M.progress = function()
local lines = voltui.progressbar {
w = state.w_with_pad,
val = state.progress,
icon = { on = "|", off = "|" },
}
return { lines }
end
M.actionbtns = function()
local hovermark = vim.g.nvmark_hovered
local btn1 = {
state.status == "start" and " Pause" or " Start",
hovermark == "tbtn1" and "ExRed" or "Normal",
{
hover = { id = "tbtn1", redraw = "actionbtns" },
click = api.togglestatus,
},
}
local resetbtn = {
" Reset ",
hovermark == "tbtn2" and "normal" or "Exblue",
{
hover = { id = "tbtn2", redraw = "actionbtns" },
click = api.reset,
},
}
local pad = { string.rep(" ", 7) }
local plusbtn = {
"",
hovermark == "tbtn3" and "normal" or "exgreen",
{
hover = { id = "tbtn3", redraw = "actionbtns" },
click = api.increment,
},
}
local minbtn = {
"",
hovermark == "tbtn4" and "normal" or "exred",
{
hover = { id = "tbtn4", redraw = "actionbtns" },
click = api.decrement,
},
}
return {
{ btn1, pad, minbtn, { " " }, plusbtn, pad, resetbtn },
}
end
return M