
    AHj                    n    d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ  G d d	e      Zy
)    )annotations)App)Binding)
GameScreen)
HomeScreen)ProjectsScreen)WidgetsScreenc                      e Zd ZdZdZeeeedZ	dZ
 edddd	       ed
ddd	       edddd	       edddd	       edddd	       edddd	      gZd!dZd"dZy )#DemoAppz7The demo app defines the modes and sets a few bindings.aC  
    .column {          
        align: center top;
        &>*{ max-width: 100; }        
    }
    Screen .-maximized {
        margin: 1 2;        
        max-width: 100%;
        &.column { margin: 1 2; padding: 1 2; }
        &.column > * {        
            max-width: 100%;           
        }        
    }
    )gamehomeprojectswidgetsr   hzapp.switch_mode('home')HomezShow the home screen)tooltipgzapp.switch_mode('game')GamezUnwind with a Textual gamepzapp.switch_mode('projects')ProjectszA selection of Textual projectswzapp.switch_mode('widgets')WidgetszTest the builtin widgetszctrl+szapp.screenshot
Screenshotz.Save an SVG 'screenshot' of the current screenzctrl+azapp.maximizeMaximizez)Maximize the focused widget (if possible)c                6   | j                   j                  ry | j                   j                  | j                  ddd       y | j                   j	                  | j                   j                        r| j                  dd       y | j                  ddd       y )Nz1Nothing to be maximized (try pressing [b]tab[/b])r   warning)titleseverityzAYou are now in the maximized view. Press [b]escape[/b] to return.)r   z!This widget may not be maximized.)screenis_maximizedfocusednotifymaximize)selfs    M/root/tools/cai/cai_env/lib/python3.12/site-packages/textual/demo/demo_app.pyaction_maximizezDemoApp.action_maximizeK   s    ;;##;;&KKC "   {{##DKK$7$78W$  
 7$&      c                8    |dk(  r|r| j                   |d   k(  ryy)z.Disable switching to a mode we are already on.switch_moder   NT)current_mode)r$   action
parameterss      r%   check_actionzDemoApp.check_actiona   s'     m#!!Z]2r'   N)returnNone)r+   strr,   ztuple[object, ...]r.   zbool | None)__name__
__module____qualname____doc__CSSr   r   r   r	   MODESDEFAULT_MODEr   BINDINGSr&   r-    r'   r%   r   r      s    AC  " 	E L%*		
 	%0		
 	)5		
 	(.		
 	D		
 	?		
?%HN,r'   r   N)
__future__r   textual.appr   textual.bindingr   textual.demo.gamer   textual.demo.homer   textual.demo.projectsr   textual.demo.widgetsr	   r   r9   r'   r%   <module>rA      s(    "  # ( ( 0 .^c ^r'   