dropdown {
    background_color = rgb(200, 200, 200),
    border_width = border_width(2.0, 2.0),
    border = border(bside("#000000", "solid")),
    can_focus = true,
    can_hover = true,
    layout = "center",

    on_init = "ui.dropdown#init(node)",
    on_mouse_up = "ui.dropdown#open_dropdown(node)",
    on_mouse_move_over = "init#
        ui.set_cursor('base:ui/cursor/interact')
    ",
    on_mouse_move_out = "init#
        ui.set_cursor('base:ui/cursor/normal')
    ",
}

dropdown(hover=true) {
    background_color = rgb(225, 225, 225),
    border = border(bside("#AAAA00", "solid")),
}

dropdown(focused=true) {
    background_color = rgb(255, 255, 255),
    border = border(bside("#CCCC00", "solid")),
    shadow = shadow(0.0, 0.0, rgba(255, 255, 0, 0.5), 16.0, 0.0, "outset"),
}

dropdown(focused=true, hover=true) {
    background_color = rgb(255, 255, 255),
    border = border(bside("#AACC00", "solid")),
    shadow = shadow(0.0, 0.0, rgba(200, 255, 0, 0.5), 16.0, 0.0, "outset"),
}

dropdown(disabled=true) {
    on_mouse_up = "init#return true",
    on_mouse_move_over = "init#return true",
    on_mouse_move_out = "init#return true",

    background_color = rgb(40, 40, 40),
    border = border(bside("#000000", "solid")),
}

dropdown > content {
    layout = "lined",
    line_height = 36,
    width = parent_width,
}

dropdown > content > @text {
    font_size = 30,
    font_color = rgb(0, 0, 0),
}

dropdown_catcher {
    width = parent_width,
    height = parent_height,

    can_hover = true,
    layout = "clipped",

    on_mouse_up = "ui.dropdown#
        close_dropdown()
        return true
    ",
    on_mouse_down = "ui.dropdown#return true",
    on_mouse_move = "ui.dropdown#return true",
    on_mouse_move_over = "ui.dropdown#return true",
    on_mouse_move_out = "ui.dropdown#return true",
    on_mouse_scroll = "ui.dropdown#return true",
}

dropdown_catcher > dropdown_list(x=x, y=y, width=width, rows=rows) {
    x = x,
    y = y,
    width = width,
    height = rows * 40,

    background_color = rgb(255, 255, 255),
    border = border(bside("#CCCC00", "solid")),
    shadow = shadow(0.0, 0.0, rgba(0, 0, 0, 0.5), 16.0, 0.0, "outset"),
}

dropdown_catcher > dropdown_list > scroll_panel {
    width = parent_width,
    height = parent_height,
}

dropdown_catcher > dropdown_list > scroll_panel > content(rows=rows) {
    height = rows * 40,

    layout = "grid",
    rows = rows,
}

dropdown_list > scroll_panel > content > entry {
    layout = "center",
    can_hover = true,
    on_mouse_up = "ui.dropdown#select_entry(node)",
    on_mouse_move_over = "ui.dropdown#hover_entry(node)",
}

dropdown_list > scroll_panel > content > entry(hover=true) {
    background_color = rgba(255, 255, 0, 0.4),
}

dropdown_list > scroll_panel > content > entry(selected=true) {
    background_color = rgba(0, 255, 0, 0.4),
}

dropdown_list > scroll_panel > content > entry(hover=true, selected=true) {
    background_color = rgba(170, 255, 0, 0.4),
}

dropdown_list > scroll_panel > content > entry > content {
    layout = "lined",
    line_height = 36,
    width = parent_width,
}

dropdown_list > scroll_panel > content > entry > content > @text {
    font_size = 30,
    font_color = rgb(0, 0, 0),
}
