awful, beautiful: getimage rather belongs in beautiful

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-09 15:51:43 +01:00
parent 015c6c5152
commit 7108e5cb20
3 changed files with 14 additions and 13 deletions

View File

@ -382,7 +382,7 @@ end)
awful.hooks.arrange.register(function (screen)
local layout = awful.layout.get(screen)
if layout then
mylayoutbox[screen].image = awful.beautiful.get_image("layout_"..layout)
mylayoutbox[screen].image = beautiful.getimage("layout_" .. layout)
else
mylayoutbox[screen].image = nil
end

View File

@ -5,7 +5,6 @@
---------------------------------------------------------------------------
local package = package
local image = image
--- Beautiful module for awful
module("awful.beautiful")
@ -31,14 +30,4 @@ function get()
return package.loaded.awful.beautiful.theme
end
--- Return an image from the theme
-- @param imgspec name of the image key
-- @return the image
function get_image(imgspec)
if theme[imgspec] then
return image(theme[imgspec])
else
return nil
end
end
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -14,7 +14,8 @@ local package = package
local capi =
{
screen = screen,
awesome = awesome
awesome = awesome,
image = image
}
local module_name = "beautiful"
@ -86,6 +87,17 @@ function init(path)
end
end
--- Return an image from the theme.
-- @param imgspec Name of the image key.
-- @return The image.
function getimage(imgspec)
if theme[imgspec] then
return capi.image(theme[imgspec])
else
return nil
end
end
setmetatable(package.loaded[module_name], package.loaded[module_name])
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80