diff options
Diffstat (limited to '.config/awesome/ui/statusbar/widgets/dnd.lua')
| -rw-r--r-- | .config/awesome/ui/statusbar/widgets/dnd.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/.config/awesome/ui/statusbar/widgets/dnd.lua b/.config/awesome/ui/statusbar/widgets/dnd.lua new file mode 100644 index 0000000..37d96b7 --- /dev/null +++ b/.config/awesome/ui/statusbar/widgets/dnd.lua @@ -0,0 +1,34 @@ +local qvars = require "quarrel.vars" +local wibox = require "wibox" +local dnd = require "services.dnd" +local qcolor = require "quarrel.color" +local phosphor = require "assets.phosphor" +local qui = require "quarrel.ui" +local qdebug = require "quarrel.debug" + +local w = wibox.widget { + widget = wibox.container.background, + shape = qui.shape, + qui.padded { + widget = wibox.container.place, + qui.icon { + icon = phosphor.bell_simple_slash_fill, + color = qcolor.palette.bg(), + widget = { + forced_height = qui.CHAR_HEIGHT - qui.PADDING * 2, + forced_width = qui.CHAR_HEIGHT - qui.PADDING * 2 + } + } + }, + -- visible = false +} + +dnd:connect_signal("dnd", function (_, value) + -- this is a giant hack + -- why is it here? cause otherwise the align layout freaks out + -- and counts the hidden widget when reserving space *and* when drawing, offsetting the rest of the widgets in the process + -- w.visible = value + w.bg = qcolor.palette[value and "yellow" or "bg"]() +end) + +return w |
