from pathlib import Path

import omni.ui as ui
from omni.ui import color as cl
from omni.ui import constant as fl

CURRENT_PATH = Path(__file__).parent
ICON_PATH = CURRENT_PATH.parent.parent.parent.joinpath("data/icons")

cl.welcome_window_background = cl.shade(cl("#363636"))
cl.welcome_content_background = cl.shade(cl("#1F2123"))
cl.welcome_button_text = cl.shade(cl("#979797"))
cl.welcome_button_text_selected = cl.shade(cl("#E3E3E3"))
cl.welcome_label = cl.shade(cl("#A1A1A1"))
cl.welcome_label_selected = cl.shade(cl("#34C7FF"))

fl.welcome_page_button_size = 24
fl.welcome_title_font_size = 18
fl.welcome_page_button_height = 80
fl.welcome_page_title_height = fl._find("welcome_page_button_height") + 8
fl.welcome_content_padding_x = 10
fl.welcome_content_padding_y = 10

WELCOME_STYLE = {
    "Window": {
        "background_color": cl.welcome_window_background,
        "border_width": 0,
        "padding": 0,
        "marging" : 0,
        "padding_width": 0,
        "margin_width": 0,
    },
    "Page.Button": {
        "background_color": cl.welcome_window_background,
        "stack_direction": ui.Direction.LEFT_TO_RIGHT,
        "padding_x": 10,
        "margin": 0,
    },
    "Page.Button:hovered": {
        "background_color": cl.welcome_content_background,
    },
    "Page.Button:pressed": {
        "background_color": cl.welcome_content_background,
    },
    "Page.Button:selected": {
        "background_color": cl.welcome_content_background,
    },
    "Page.Button.Label": {
        "font_size": fl.welcome_page_button_size,
        "alignment": ui.Alignment.LEFT_CENTER,
        "color": cl.welcome_button_text,
    },
    "Page.Button.Label:selected": {
        "color": cl.welcome_button_text_selected,
    },

    "Content": {
        "background_color": cl.welcome_content_background,
    },
    "Title.Button": {
        "background_color": cl.transparent,
        "stack_direction": ui.Direction.RIGHT_TO_LEFT,
    },
    "Title.Button.Label": {
        "font_size": fl.welcome_title_font_size,
    },
    "Title.Button.Image": {
        "color": cl.welcome_label_selected,
        "alignment": ui.Alignment.LEFT_CENTER,
    },
    "Doc.Background": {"background_color": cl.white},

    "CheckBox": {
        "background_color": cl.welcome_button_text,
        "border_radius": 0,
    },
    "Label": {"color": cl.welcome_button_text},
}
