systray, dock, icon_handler some major revision

This commit is contained in:
Rene Kievits
2022-03-06 20:56:06 +01:00
parent 39179f06b7
commit dae28d55eb
29 changed files with 422 additions and 255 deletions

View File

@@ -53,7 +53,7 @@ return function ()
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
local get_volume = function ()
@@ -120,4 +120,4 @@ return function ()
check_muted()
return audio_widget
end
end

View File

@@ -56,7 +56,7 @@ return function ()
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
local battery_tooltip = awful.tooltip{
@@ -198,4 +198,4 @@ return function ()
)
return battery_widget
end
end

View File

@@ -37,7 +37,7 @@ return function ()
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
local bluetooth_tooltip = awful.tooltip{
@@ -123,4 +123,4 @@ return function ()
get_bluetooth_information()
return bluetooth_widget
end
end

View File

@@ -54,7 +54,7 @@ return function ()
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
local set_clock = function ()
@@ -75,4 +75,4 @@ return function ()
hover_signal(clock_widget, color.color["Orange200"])
return clock_widget
end
end

View File

@@ -54,7 +54,7 @@ return function ()
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
local set_date = function ()
@@ -89,4 +89,4 @@ return function ()
)
return date_widget
end
end

View File

@@ -13,7 +13,7 @@ require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/kblayout/"
return function ()
return function (s)
local kblayout_widget = wibox.widget{
{
{
@@ -52,7 +52,7 @@ return function ()
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
local layout = "";
@@ -246,6 +246,7 @@ return function ()
end
local kb_menu_widget = awful.popup{
screen = s,
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
@@ -335,4 +336,4 @@ return function ()
get_kblayout()
kb_menu_widget.visible = false
return kblayout_widget
end
end

View File

@@ -66,7 +66,7 @@ return function ()
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
local network_tooltip = awful.tooltip{
@@ -334,4 +334,4 @@ return function ()
)
return network_widget
end
end

View File

@@ -47,7 +47,7 @@ return function ()
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, height, width, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
-- Signals
@@ -61,4 +61,4 @@ return function ()
)
return power_widget
end
end

View File

@@ -16,14 +16,14 @@ return function (s)
local systray = wibox.widget{
{
{
wibox.widget.systray,
wibox.widget.systray(),
top = dpi(6),
bottom = dpi(6),
left = dpi(6),
right = dpi(6),
widget = wibox.container.margin
widget = wibox.container.margin,
id = 'st'
},
width = dpi(100),
strategy = "exact",
layout = wibox.container.constraint,
id = "container"
@@ -36,6 +36,6 @@ return function (s)
}
-- Signals
hover_signal(systray.container, color.color["Red200"])
systray.container.st.widget:set_base_size(dpi(20))
return systray
end
end

View File

@@ -60,7 +60,7 @@ local list_update = function (widget, buttons, label, data, objects)
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
local function create_buttons(buttons, object)
@@ -235,12 +235,11 @@ local tag_list = function (s)
awful.tag.viewprev(t.screen)
end
)
)
,
),
{},
list_update,
wibox.layout.fixed.horizontal()
)
end
return tag_list
return tag_list

View File

@@ -6,7 +6,9 @@ local color = require('theme.crylia.colors')
local list_update = function (widget, buttons, label, data, objects)
widget:reset()
local count
for i, object in ipairs(objects) do
count = i
local task_widget = wibox.widget{
{
{
@@ -48,7 +50,7 @@ local list_update = function (widget, buttons, label, data, objects)
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.widget.background
widget = wibox.container.background
}
local task_tool_tip = awful.tooltip{
@@ -81,11 +83,9 @@ local list_update = function (widget, buttons, label, data, objects)
return btns
end
end
task_widget:buttons(create_buttons(buttons, object))
local text, bg, bg_image, icon, args = 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)
@@ -109,7 +109,6 @@ local list_update = function (widget, buttons, label, data, objects)
task_widget.container.layout_it.margin.layout_icon.icon:set_image(Get_icon("Papirus-Dark", object))
widget:add(task_widget)
widget:set_spacing(dpi(6))
local old_wibox, old_cursor, old_bg
task_widget:connect_signal(
"mouse::enter",
@@ -161,16 +160,10 @@ local list_update = function (widget, buttons, label, data, objects)
end
)
end
if (widget.children and #widget.children or 0) == 0 then
awesome.emit_signal("hide_centerbar", false)
else
awesome.emit_signal("hide_centerbar", true)
end
return widget
end
return function(s)
local tasklist = function(s)
return awful.widget.tasklist(
s,
awful.widget.tasklist.filter.currenttags,
@@ -203,4 +196,6 @@ return function(s)
list_update,
wibox.layout.fixed.horizontal()
)
end
end
return tasklist