Variation without load_silently

This commit is contained in:
Miroslav Bendík 2023-03-26 08:09:39 +02:00
parent bca49ce408
commit a03aaec1dc
1 changed files with 6 additions and 4 deletions

View File

@ -32,11 +32,13 @@ local function update(w, screen)
local name = layout.getname(layout.get(screen))
w._layoutbox_tooltip:set_text(name or "[no name]")
local img = surface.load_silently(beautiful["layout_" .. name], false)
if img then
w.imagebox:set_image(beautiful["layout_" .. name])
local image_name = "layout_" .. name
local theme_image = beautiful[image_name]
local success = false
if theme_image ~= nil then
success = w.imagebox:set_image(beautiful[image_name])
end
w.textbox.text = img and "" or name
w.textbox.text = success and "" or name
end
local function update_from_tag(t)