@@ -1,3 +1,8 @@
|
||||
---------------------------------
|
||||
-- This is the tasklist widget --
|
||||
---------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require('awful')
|
||||
local wibox = require('wibox')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
@@ -83,7 +88,7 @@ local list_update = function(widget, buttons, label, data, objects)
|
||||
|
||||
task_widget:buttons(create_buttons(buttons, object))
|
||||
|
||||
local text, bg, bg_image, icon, args = label(object, task_widget.container.layout_it.title)
|
||||
local text, _ = label(object, task_widget.container.layout_it.title)
|
||||
if object == client.focus then
|
||||
if text == nil or text == '' then
|
||||
task_widget.container.layout_it.title:set_margins(0)
|
||||
@@ -112,61 +117,64 @@ local list_update = function(widget, buttons, label, data, objects)
|
||||
widget:add(task_widget)
|
||||
widget:set_spacing(dpi(6))
|
||||
|
||||
--#region Hover_signal
|
||||
local old_wibox, old_cursor, old_bg
|
||||
task_widget:connect_signal(
|
||||
"mouse::enter",
|
||||
function()
|
||||
old_bg = task_widget.bg
|
||||
if object == client.focus then
|
||||
task_widget.bg = '#dddddddd'
|
||||
else
|
||||
task_widget.bg = '#3A475Cdd'
|
||||
old_bg = task_widget.bg
|
||||
if object == client.focus then
|
||||
task_widget.bg = '#dddddddd'
|
||||
else
|
||||
task_widget.bg = '#3A475Cdd'
|
||||
end
|
||||
local w = mouse.current_wibox
|
||||
if w then
|
||||
old_cursor, old_wibox = w.cursor, w
|
||||
w.cursor = "hand1"
|
||||
end
|
||||
end
|
||||
local w = mouse.current_wibox
|
||||
if w then
|
||||
old_cursor, old_wibox = w.cursor, w
|
||||
w.cursor = "hand1"
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
task_widget:connect_signal(
|
||||
"button::press",
|
||||
function()
|
||||
if object == client.focus then
|
||||
task_widget.bg = "#ffffffaa"
|
||||
else
|
||||
task_widget.bg = '#3A475Caa'
|
||||
if object == client.focus then
|
||||
task_widget.bg = "#ffffffaa"
|
||||
else
|
||||
task_widget.bg = '#3A475Caa'
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
task_widget:connect_signal(
|
||||
"button::release",
|
||||
function()
|
||||
if object == client.focus then
|
||||
task_widget.bg = "#ffffffdd"
|
||||
else
|
||||
task_widget.bg = '#3A475Cdd'
|
||||
if object == client.focus then
|
||||
task_widget.bg = "#ffffffdd"
|
||||
else
|
||||
task_widget.bg = '#3A475Cdd'
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
task_widget:connect_signal(
|
||||
"mouse::leave",
|
||||
function()
|
||||
task_widget.bg = old_bg
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
task_widget.bg = old_bg
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
--#endregion
|
||||
|
||||
end
|
||||
return widget
|
||||
end
|
||||
|
||||
local tasklist = function(s)
|
||||
return function(s)
|
||||
return awful.widget.tasklist(
|
||||
s,
|
||||
awful.widget.tasklist.filter.currenttags,
|
||||
@@ -175,24 +183,24 @@ local tasklist = function(s)
|
||||
{},
|
||||
1,
|
||||
function(c)
|
||||
if c == client.focus then
|
||||
c.minimized = true
|
||||
else
|
||||
c.minimized = false
|
||||
if not c:isvisible() and c.first_tag then
|
||||
c.first_tag:view_only()
|
||||
if c == client.focus then
|
||||
c.minimized = true
|
||||
else
|
||||
c.minimized = false
|
||||
if not c:isvisible() and c.first_tag then
|
||||
c.first_tag:view_only()
|
||||
end
|
||||
c:emit_signal('request::activate')
|
||||
c:raise()
|
||||
end
|
||||
c:emit_signal('request::activate')
|
||||
c:raise()
|
||||
end
|
||||
end
|
||||
),
|
||||
awful.button(
|
||||
{},
|
||||
3,
|
||||
function(c)
|
||||
c:kill()
|
||||
end
|
||||
c:kill()
|
||||
end
|
||||
)
|
||||
),
|
||||
{},
|
||||
@@ -200,5 +208,3 @@ local tasklist = function(s)
|
||||
wibox.layout.fixed.horizontal()
|
||||
)
|
||||
end
|
||||
|
||||
return tasklist
|
||||
|
||||
Reference in New Issue
Block a user