#include "../avatarui_common.lua"


Avatar.SkinItemViewConsole = function(obj)
    local bindSkin = Ui.bind().viewModel.skinModel

    local item = Ui.Frame
    {
        w = 500,
        h = 60,

        Ui.Rect
        {
            resizeToParent = true,
            cornerRadius = 7,
            color = 0x10000009B
        },

        Ui.RectOutline
        {
            id = "highlight",
            resizeToParent = true,
            cornerRadius = 7,
            thickness = 2,
            color = 0xFFFF7F,
            visible = bindSkin.isFocused
        },

        Ui.Text
        {
            vAlign = Ui.V.Middle,
            margin = { left = 20 },
            id = "skinName",
            font = { "bold.ttf", 22 },
            text = bindSkin.name,
            color = { 1, 1, 1, 0.8 },
            uniformHeight = true
        },

        Ui.Image
        {
            id = "lockIcon",

            vAlign = Ui.V.Middle,
            hAlign = Ui.H.Right,
            margin = { right = 10 },

            w = 46,
            h = 46,
            color = { 0.8, 0.8, 0.8 },
            
            path = "avatarui/resources/lockicon.png",
            visible = bindSkin.isLocked
        },

        Ui.Image
        {
            id = "tickMark",

            vAlign = Ui.V.Middle,
            hAlign = Ui.H.Right,
            margin = { right = 10 },

            w = 42,
            h = 42,

            path = "avatarui/resources/tickmark.png",
            visible = bindSkin.isSelected
        }
    }

    return item:new(obj)
end
