Support multiple tags at once in the tasklist
This commit is contained in:
parent
8da00cbd65
commit
d9a82c87a4
|
@ -95,7 +95,6 @@ local function create_item(t,s)
|
|||
end)
|
||||
|
||||
item._internal.screen = s
|
||||
-- item.state[radical.base.item_flags.USED ] = #t:clients() > 0
|
||||
item.state[radical.base.item_flags.SELECTED] = t.selected or nil
|
||||
cache[t] = item
|
||||
item.tag = t
|
||||
|
@ -106,8 +105,8 @@ local function track_used(c,t)
|
|||
if t then
|
||||
local item = cache[t] or create_item(t,tag.getscreen(t))
|
||||
if not item then return end -- Yes, it happen if the screen is still nil
|
||||
item.state[radical.base.item_flags.USED] = #t:clients() > 0
|
||||
item.state[radical.base.item_flags.CHANGED] = not t.selected
|
||||
item.state[radical.base.item_flags.USED] = #t:clients() > 0 and true or nil
|
||||
item.state[radical.base.item_flags.CHANGED] = ((not t.selected) and #t:clients() > 0) and true or nil
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -167,11 +167,17 @@ local function load_clients(t)
|
|||
local screen = tag.getscreen(t)
|
||||
if not t or not screen or not instances[screen] then return end
|
||||
local menu = instances[screen].menu
|
||||
if t.selected then
|
||||
local clients = {}
|
||||
local selected = tag.selectedlist(screen)
|
||||
-- The "#selected > 0" is for reseting when multiple tags are selected
|
||||
if t.selected or #selected > 0 then
|
||||
menu:clear()
|
||||
for k, c in ipairs(t:clients()) do
|
||||
if not c.sticky then
|
||||
add_client(c,screen)
|
||||
for k2,t2 in ipairs(selected) do
|
||||
for k, c in ipairs(t2:clients()) do
|
||||
if not c.sticky then
|
||||
add_client(c,screen)
|
||||
clients[#clients+1] = c
|
||||
end
|
||||
end
|
||||
end
|
||||
for c,_ in pairs(sticky) do
|
||||
|
|
|
@ -112,7 +112,6 @@ function module:setup_item(data,item,args)
|
|||
end
|
||||
--Create the background
|
||||
local item_layout = item.layout or data.item_layout or horizontal_item_layout
|
||||
print("\n\n\n\nsadHERE",item.layout,data.item_layout)
|
||||
item.widget = item_layout(item,data,args)--wibox.widget.background()
|
||||
cache_pixmap(item)
|
||||
|
||||
|
|
Loading…
Reference in New Issue