--// =============================================================================
--// Theme

theme = {}

theme.name = "Armada Blues"


--// =============================================================================
--// Define default skins

local defaultSkin = "Armada Blues"
--local defaultSkin = "Evolved"

theme.skin = {
	general = {
		skinName = defaultSkin,
	},

	imagelistview = {
	--  imageFolder      = LUA_DIRNAME .. "images/folder.png",
	--  imageFolderUp    = LUA_DIRNAME .. "images/folder_up.png",
	},

	icons = {
	--  imageplaceholder = LUA_DIRNAME .. "images/placeholder.png",
	},
}


--// =============================================================================
--// Theme

function theme.GetDefaultSkin(class)
	local skinName

	repeat
		skinName = theme.skin[class.classname].skinName
		class = class.inherited
--FIXME check if the skin contains the current control class! if not use inherit the theme table before doing so in the skin
	until ((skinName) and (SkinHandler.IsValidSkin(skinName))) or (not class);

	if (not skinName) or (not SkinHandler.IsValidSkin(skinName)) then
		skinName = theme.skin.general.skinName
	end

	if (not skinName) or (not SkinHandler.IsValidSkin(skinName)) then
		skinName = "default"
	end

	return skinName
end


function theme.LoadThemeDefaults(control)
	if (theme.skin[control.classname])
		then table.merge(control, theme.skin[control.classname]) end -- per-class defaults
	table.merge(control, theme.skin.general)
end

