2022-07-19 19:45:11 +02:00
|
|
|
-- ██████╗██╗ ██╗ ██████╗██╗ ██╗ █████╗ ██████╗ ██╗ ███████╗
|
|
|
|
-- ██╔════╝██║ ██║██╔════╝██║ ██╔╝██╔══██╗██╔══██╗██║ ██╔════╝
|
|
|
|
-- ██║ ██║ ██║██║ █████╔╝ ███████║██████╔╝██║ █████╗
|
|
|
|
-- ██║ ██║ ██║██║ ██╔═██╗ ██╔══██║██╔══██╗██║ ██╔══╝
|
|
|
|
-- ╚██████╗███████╗██║╚██████╗██║ ██╗██║ ██║██████╔╝███████╗███████╗
|
|
|
|
-- ╚═════╝╚══════╝╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚══════╝
|
|
|
|
|
|
|
|
-- ██████╗ ██████╗ ███╗ ██╗████████╗ █████╗ ██╗███╗ ██╗███████╗██████╗
|
|
|
|
-- ██╔════╝██╔═══██╗████╗ ██║╚══██╔══╝██╔══██╗██║████╗ ██║██╔════╝██╔══██╗
|
|
|
|
-- ██║ ██║ ██║██╔██╗ ██║ ██║ ███████║██║██╔██╗ ██║█████╗ ██████╔╝
|
|
|
|
-- ██║ ██║ ██║██║╚██╗██║ ██║ ██╔══██║██║██║╚██╗██║██╔══╝ ██╔══██╗
|
|
|
|
-- ╚██████╗╚██████╔╝██║ ╚████║ ██║ ██║ ██║██║██║ ╚████║███████╗██║ ██║
|
|
|
|
-- ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝
|
|
|
|
|
|
|
|
-- ===================================================================
|
|
|
|
-- Initialization
|
|
|
|
-- ===================================================================
|
|
|
|
|
|
|
|
|
|
|
|
local wibox = require('wibox')
|
|
|
|
|
|
|
|
|
|
|
|
-- ===================================================================
|
|
|
|
-- Widget Creation
|
|
|
|
-- ===================================================================
|
|
|
|
|
|
|
|
|
2023-05-20 23:04:33 +02:00
|
|
|
local function build(widget)
|
2022-07-19 19:45:11 +02:00
|
|
|
local container =
|
2022-07-23 19:31:38 +02:00
|
|
|
wibox.widget {
|
|
|
|
widget,
|
|
|
|
widget = wibox.container.background
|
2022-07-19 19:45:11 +02:00
|
|
|
}
|
|
|
|
local old_cursor, old_wibox
|
|
|
|
|
|
|
|
container:connect_signal(
|
2022-07-23 19:31:38 +02:00
|
|
|
'mouse::enter',
|
|
|
|
function()
|
|
|
|
container.bg = '#ffffff11'
|
|
|
|
local w = _G.mouse.current_wibox
|
|
|
|
if w then
|
|
|
|
old_cursor, old_wibox = w.cursor, w
|
|
|
|
w.cursor = 'hand1'
|
|
|
|
end
|
|
|
|
end
|
2022-07-19 19:45:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
container:connect_signal(
|
2022-07-23 19:31:38 +02:00
|
|
|
'mouse::leave',
|
|
|
|
function()
|
|
|
|
container.bg = '#ffffff00'
|
|
|
|
if old_wibox then
|
|
|
|
old_wibox.cursor = old_cursor
|
|
|
|
old_wibox = nil
|
|
|
|
end
|
|
|
|
end
|
2022-07-19 19:45:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
container:connect_signal(
|
2022-07-23 19:31:38 +02:00
|
|
|
'button::press',
|
|
|
|
function()
|
|
|
|
container.bg = '#ffffff22'
|
|
|
|
end
|
2022-07-19 19:45:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
container:connect_signal(
|
2022-07-23 19:31:38 +02:00
|
|
|
'button::release',
|
|
|
|
function()
|
|
|
|
container.bg = '#ffffff11'
|
|
|
|
end
|
2022-07-19 19:45:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
return container
|
|
|
|
end
|
|
|
|
|
|
|
|
return build
|