Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e1fe5c7
snowcap: add mouse_area widget
Ph4ntomas Sep 21, 2025
e89e811
snowcap/rust: add mouse_area widget to api
Ph4ntomas Sep 26, 2025
3a7b4bd
snowcap/lua: Add support for MouseArea
Ph4ntomas Sep 23, 2025
8682e89
snowcap: add TextInput widget
Ph4ntomas Oct 5, 2025
64e4d92
snowcap-api-defs: force boxing TextInput to satisfy clippy
Ph4ntomas Oct 5, 2025
375e082
snowcap: Send text in Keyboard events
Ph4ntomas Oct 5, 2025
70e29af
snowcap: emit event when keyboard mods changes
Ph4ntomas Oct 5, 2025
8520cd2
snowcap: setup key-repetition
Ph4ntomas Oct 5, 2025
fa6d557
snowcap/rust: Add TextInput
Ph4ntomas Oct 5, 2025
402f907
snowcap: add text_input missing fields
Ph4ntomas Oct 5, 2025
2ede0bb
snowcap/rust: add text_input missing fields
Ph4ntomas Oct 5, 2025
6872908
snowcap: TextInput Style: Fallback on closest match
Ph4ntomas Oct 6, 2025
a514372
snowcap/rust: TextInput: improve style building
Ph4ntomas Oct 6, 2025
b82018e
snowcap: Add operations to decorations & layers
Ph4ntomas Oct 7, 2025
842811e
snowcap/rust: Add operate fn to decorations & layers
Ph4ntomas Oct 7, 2025
4136fe4
snowcap/rust: Document TextInput and associated types
Ph4ntomas Oct 8, 2025
d13c4d0
snowcap/lua: basic text_input integration
Ph4ntomas Oct 7, 2025
ae304ce
snowcap/lua: Add widgets operations
Ph4ntomas Oct 8, 2025
2739996
snowcap/lua: Document TextInput and associated fields
Ph4ntomas Oct 8, 2025
57f1ede
snowcap/lua: stylua: ignore generated file
Ph4ntomas Oct 8, 2025
8a30e4f
snowcap: remove expect() from API
Ph4ntomas Oct 11, 2025
6be638a
snowcap/text_input: use google.proto.Empty to flatten TextInput.Event
Ph4ntomas Oct 20, 2025
5ace510
rust: snowcap/text_input: use google.proto.Empty to flatten TextInput…
Ph4ntomas Oct 20, 2025
938360d
lua: snowcap/text_input: use google.proto.Empty to flatten TextInput.…
Ph4ntomas Oct 20, 2025
1fe3a6e
lua: snowcap/text_input: merge TextInput.callbacks into TextInput
Ph4ntomas Oct 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/lua/pinnacle-api-dev-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ build = {
["pinnacle.snowcap.snowcap.input"] = "pinnacle/snowcap/snowcap/input.lua",
["pinnacle.snowcap.snowcap.input.keys"] = "pinnacle/snowcap/snowcap/input/keys.lua",
["pinnacle.snowcap.snowcap.widget"] = "pinnacle/snowcap/snowcap/widget.lua",
["pinnacle.snowcap.snowcap.widget.operation"] = "pinnacle/snowcap/snowcap/widget/operation.lua",
["pinnacle.snowcap.snowcap.layer"] = "pinnacle/snowcap/snowcap/layer.lua",
["pinnacle.snowcap.snowcap.decoration"] = "pinnacle/snowcap/snowcap/decoration.lua",
["pinnacle.snowcap.snowcap.util"] = "pinnacle/snowcap/snowcap/util.lua",
Expand Down
1 change: 1 addition & 0 deletions snowcap/api/lua/.styluaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
snowcap/grpc/defs.lua
1 change: 1 addition & 0 deletions snowcap/api/lua/snowcap-api-dev-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ build = {
["snowcap.input"] = "snowcap/input.lua",
["snowcap.input.keys"] = "snowcap/input/keys.lua",
["snowcap.widget"] = "snowcap/widget.lua",
["snowcap.widget.operation"] = "snowcap/widget/operation.lua",
["snowcap.layer"] = "snowcap/layer.lua",
["snowcap.decoration"] = "snowcap/decoration.lua",
["snowcap.util"] = "snowcap/util.lua",
Expand Down
21 changes: 21 additions & 0 deletions snowcap/api/lua/snowcap/decoration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ function decoration.new_widget(args)

if event.button then
msg = callbacks[widget_id]
elseif event.mouse_area then
if callbacks[widget_id] ~= nil then
msg = widget._mouse_area_process_event(callbacks[widget_id], event.mouse_area)
end
elseif event.text_input then
if callbacks[widget_id] ~= nil then
msg = widget._text_input_process_event(callbacks[widget_id], event.text_input)
end
end

if msg then
Expand Down Expand Up @@ -144,6 +152,19 @@ function DecorationHandle:send_message(message)
self.update(message)
end

---Sends an `Operation` to this decoration.
---@param operation snowcap.widget.operation.Operation
function DecorationHandle:operate(operation)
local _, err = client:snowcap_decoration_v1_DecorationService_OperateDecoration({
decoration_id = self.id,
operation = require("snowcap.widget.operation")._to_api(operation),
})

if err then
log.error(err)
end
end

---Sets the z-index at which this decoration will render.
---
---@param z_index integer
Expand Down
Loading
Loading