
    {h                     z    d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZmZmZ  G d d	e      Zy
)    )ComposeResult)Screen)	ContainerVertical)on)GradientTitle)
MenuWidget)PRIMARY_COLORSECONDARY_COLORMENU_OPTIONSc                        e Zd ZdZdZ fdZdefdZ ee	j                        de	j                  ddfd       Zd
d	Z xZS )MainMenuScreenz)The main menu screen for the application.a  
    Vertical {
        width: 100%;
        height: auto;
        max-height: 20;
        align: center middle;
    }

    #title_container {
        width: 100%;
        height: auto;
        content-align: center top;
    }

    #menu_container {
        width: 100%;
        height: 1fr;
        align: center bottom;
        padding-bottom: 1;
    }

    MenuWidget {
        width: 100%;
        height: auto;
        content-align: center middle;
    }
    c                 J    t         |           t        t              | _        y)z1Initialize the MainMenuScreen with a menu widget.N)super__init__r	   r   menu_widget)self	__class__s    c/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/atomic_assembler/screens/main_menu.pyr   zMainMenuScreen.__init__0   s    %l3    returnc           	   #      K   t        t        t        dt        t              d      t        | j
                  d             yw)z&Compose the main layout of the screen.zAtomic Assembler)start_color	end_colortitle_container)idmenu_containerN)r   r   r   r
   r   r   r   s    r   composezMainMenuScreen.compose5   sG     & --
 %   #
 	
s   AAeventNc                     t         |j                     } | j                  j                  |j                  fi |j
                  xs i  y)z$Handle the selection of a menu item.N)r   indexapphandle_menu_actionactionparams)r   r    selected_options      r   handle_item_selectedz#MainMenuScreen.handle_item_selectedF   s=     'u{{3###O$:$:]?U?U?[Y[]r   c                 8    | j                   j                          y)zQuit the application.N)r#   exitr   s    r   action_quitzMainMenuScreen.action_quitM   s    r   )r   N)__name__
__module____qualname____doc__CSSr   r   r   r   r	   ItemSelectedr(   r+   __classcell__)r   s   @r   r   r      sZ    3C84

 
" 
 ^**A*A ^d ^ !^r   r   N)textual.appr   textual.screenr   textual.containersr   r   textualr   'atomic_assembler.widgets.gradient_titler   atomic_assembler.widgets.menur	   atomic_assembler.constantsr
   r   r   r    r   r   <module>r;      s/    & ! 2  A 4 >V >r   