From d7c66522cf365f516babcfeb1d4a2d36c3ea41af Mon Sep 17 00:00:00 2001 From: delta Date: Wed, 29 Oct 2025 16:35:38 +0100 Subject: a small refactor --- .config/awesome/quarrel/ui/init.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to '.config/awesome/quarrel/ui') diff --git a/.config/awesome/quarrel/ui/init.lua b/.config/awesome/quarrel/ui/init.lua index 5acaa51..2b63694 100644 --- a/.config/awesome/quarrel/ui/init.lua +++ b/.config/awesome/quarrel/ui/init.lua @@ -36,6 +36,28 @@ function M.styled(target) }, target) end +--- Wraps a widget inside of a margin widget +---@param target table +---@return table +function M.padded(target) + return { + widget = wibox.container.margin, + margins = M.PADDING, + target, + } +end + +--- Wraps a widget inside of a margin widget +---@param target table +---@return table +function M.padded_big(target) + return { + widget = wibox.container.margin, + margins = M.BIG_PADDING, + target, + } +end + --- Generates a styled popup ---@param target table ---@return table @@ -56,6 +78,18 @@ function M.recolor(color) return "svg{fill:" .. color .. "}" end +--- Generates icon widget +---@param args table +---@return table +function M.separator(args) + return wibox.widget(gtable.crush({ + widget = wibox.container.background, + bg = qcolor.palette.border(), + forced_height = not args.vertical and args.size, + forced_width = args.vertical and args.size, + }, args.widget or {})) +end + --- Generates icon widget ---@param args table ---@return table -- cgit v1.2.3