ó
    Ãu„j›  ã                  óö   • S r SSKJr  SSKJr  SSKJr  SSKJrJr  SSK	J
r
  SSKJr  SSKJrJr  SS	KJr  SS
KJr  SSKJr   " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rg)z-Provides a Textual application header widget.é    )Úannotations)Údatetime)ÚText)ÚComposeResultÚRenderResult)ÚContent)ÚNoScreen)ÚClickÚMount)ÚReactive)ÚWidget)ÚStaticc                  óL   • \ rS rSrSrSr\" S5      r S
S jrSS jr	SS jr
Srg	)Ú
HeaderIconé   z,Display an 'icon' on the left of the header.z¿
    HeaderIcon {
        dock: left;
        padding: 0 1;
        width: 8;
        content-align: left middle;
    }

    HeaderIcon:hover {
        background: $foreground 10%;
    }
    õ   â­˜c                óX   • U R                   R                  (       a  SU l        g SU l        g )NzOpen the command paletteT)ÚappÚENABLE_COMMAND_PALETTEÚtooltipÚdisabled©Úselfs    Ú¥C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\textual/widgets/_header.pyÚon_mountÚHeaderIcon.on_mount%   s   € Ø�8‰8×*×*Ø5ˆD�Là ˆD�Mó    c              ƒ  ób   #   • UR                  5         U R                  S5      I Sh  v•N   g N7f)z0Launch the command palette when icon is clicked.zapp.command_paletteN)ÚstopÚ
run_action)r   Úevents     r   Úon_clickÚHeaderIcon.on_click+   s!   é € à�
‰
ŒØ�o‰oÐ3Ó4×4Ó4ùs   ‚%/§-¨/c                ó   • U R                   $ )z9Render the header icon.

Returns:
    The rendered icon.
)Úiconr   s    r   ÚrenderÚHeaderIcon.render0   s   € ð �y‰yÐr   )r   r   N©ÚreturnÚNone)r!   r
   r)   r*   ©r)   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚDEFAULT_CSSr   r%   r   r"   r&   Ú__static_attributes__© r   r   r   r      s)   † Ù6ð€Kñ �E‹?€DØ=ô!ô5÷
r   r   c                  ó&   • \ rS rSrSrSrSS jrSrg)ÚHeaderClockSpaceé9   z;The space taken up by the clock on the right of the header.z`
    HeaderClockSpace {
        dock: right;
        width: 10;
        padding: 0 1;
    }
    c                ó   • g)zARender the header clock space.

Returns:
    The rendered space.
Ú r3   r   s    r   r&   ÚHeaderClockSpace.renderD   s   € ð r   r3   Nr+   )r,   r-   r.   r/   r0   r1   r&   r2   r3   r   r   r5   r5   9   s   † ÙEð€K÷r   r5   c                  óL   • \ rS rSr% SrSr\" S5      rS\S'   SS jr	SS jr
S	rg
)ÚHeaderClockéM   z+Display a clock on the right of the header.z§
    HeaderClock {
        background: $foreground-darken-1 5%;
        color: $foreground;
        text-opacity: 85%;
        content-align: center middle;
    }
    ú%XúReactive[str]Útime_formatc                ó:   • U R                  SU R                  SS9  g )Né   zupdate header clock)ÚcallbackÚname)Úset_intervalÚrefresh)r   Ú_s     r   Ú	_on_mountÚHeaderClock._on_mount[   s   € Ø×Ñ˜! d§l¡lÐ9NÐÒOr   c                óŒ   • [        [        R                  " 5       R                  5       R	                  U R
                  5      5      $ )z;Render the header clock.

Returns:
    The rendered clock.
)r   r   ÚnowÚtimeÚstrftimer?   r   s    r   r&   ÚHeaderClock.render^   s/   € ô ”H—L’L“N×'Ñ'Ó)×2Ñ2°4×3CÑ3CÓDÓEÐEr   r3   N©rF   r   r)   r*   r+   )r,   r-   r.   r/   r0   r1   r   r?   Ú__annotations__rG   r&   r2   r3   r   r   r;   r;   M   s(   ‡ Ù5ð€Kñ "*¨$£€K�Ó/ôP÷Fr   r;   c                  ó   • \ rS rSrSrSrSrg)ÚHeaderTitleég   z+Display the title / subtitle in the header.z”
    HeaderTitle {
        text-wrap: nowrap;
        text-overflow: ellipsis;
        content-align: center middle;
        width: 100%;
    }
    r3   N)r,   r-   r.   r/   r0   r1   r2   r3   r   r   rQ   rQ   g   s   † Ù5ðƒKr   rQ   c                  ó  ^ • \ rS rSr% SrSrSr\" S5      rS\	S'    \" S5      r
S	\	S
'    \" S5      rS	\	S'     SSSSSSS.           SU 4S jjjjrSS jrSS jrS rSS jr\SS j5       r\SS j5       rSS jrSrU =r$ )ÚHeaderét   z$A header widget with icon and clock.z·
    Header {
        dock: top;
        width: 100%;
        background: $panel;
        color: $foreground;
        height: 1;
    }
    Header.-tall {
        height: 3;
    }
    r8   FzReactive[bool]Útallr   r>   r%   r=   r?   N)rC   ÚidÚclassesr%   r?   c               óT   >• [         TU ]  X#US9  Xl        Ub  XPl        Ub  X`l        gg)aš  Initialise the header widget.

Args:
    show_clock: ``True`` if the clock should be shown on the right of the header.
    name: The name of the header widget.
    id: The ID of the header widget in the DOM.
    classes: The CSS classes of the header widget.
    icon: Single character to use as an icon, or `None` for default.
    time_format: Time format (used by strftime) for clock, or `None` for default.
)rC   rW   rX   N)ÚsuperÚ__init__Ú_show_clockr%   r?   )r   Ú
show_clockrC   rW   rX   r%   r?   Ú	__class__s          €r   r[   ÚHeader.__init__�   s9   ø€ ô( 	‰Ñ˜d°7ÐÑ;Ø%ÔØÑØŒIØÑ"Ø*Õð #r   c              #  óþ   #   • [        5       R                  [        R                  5      v •  [	        5       v •  U R
                  (       a'  [        5       R                  [        R                  5      O	[        5       v •  g 7f©N)	r   Ú	data_bindrT   r%   rQ   r\   r;   r?   r5   r   s    r   ÚcomposeÚHeader.composeª   sR   é € Ü‹l×$Ñ$¤V§[¡[Ó1Ò1Ü‹mÒð ××ô ‹M×#Ñ#¤F×$6Ñ$6Ô7ä!Ó#ó	
ùs   ‚A;A=c                ó(   • U R                  US5        g ©Nz-tall)Ú	set_class)r   rV   s     r   Ú
watch_tallÚHeader.watch_tall³   s   € Ø�‰�t˜WÕ%r   c                ó&   • U R                  S5        g rf   )Útoggle_classr   s    r   Ú	_on_clickÚHeader._on_click¶   s   € Ø×Ñ˜'Õ"r   c                ób   • U R                   R                  U R                  U R                  5      $ )zèFormat the title and subtitle.

Defers to [App.format_title][textual.app.App.format_title] by default.
Override this method if you want to customize how the title is displayed in the header.

Returns:
    Content for title display.
)r   Úformat_titleÚscreen_titleÚscreen_sub_titler   s    r   ro   ÚHeader.format_title¹   s'   € ð �x‰x×$Ñ$ T×%6Ñ%6¸×8MÑ8MÓNÐNr   c                ól   • U R                   R                  nUb  UnU$ U R                  R                  nU$ )z’The title that this header will display.

This depends on [`Screen.title`][textual.screen.Screen.title] and [`App.title`][textual.app.App.title].
)ÚscreenÚtitler   )r   rp   ru   s      r   rp   ÚHeader.screen_titleÄ   s7   € ð —{‘{×(Ñ(ˆØ ,Ñ 8�ˆØˆð ?C¿h¹h¿n¹nˆØˆr   c                ól   • U R                   R                  nUb  UnU$ U R                  R                  nU$ )z¦The sub-title that this header will display.

This depends on [`Screen.sub_title`][textual.screen.Screen.sub_title] and [`App.sub_title`][textual.app.App.sub_title].
)rt   Ú	sub_titler   )r   rq   rx   s      r   rq   ÚHeader.screen_sub_titleÎ   sH   € ð  Ÿ;™;×0Ñ0Ðà 0Ñ <Ðð 	ð Ðð CGÇ(Á(×BTÑBTð 	ð Ðr   c                óþ   ^ • SU 4S jjnT R                  T R                  SU5        T R                  T R                  SU5        T R                  T R                  SU5        T R                  T R                  SU5        g )Nc               “  ó”   >#   •  T R                  [        5      R                  T R                  5       5        g ! [         a     g f = f7fra   )Ú	query_onerQ   Úupdatero   r	   r   s   €r   Ú	set_titleÚ#Header._on_mount.<locals>.set_titleÛ   s<   øé € ðØ—‘œ{Ó+×2Ñ2°4×3DÑ3DÓ3FÕGøÜó Ùðüs%   ƒA…28 ·A¸
AÁAÁAÁAru   rx   r(   )Úwatchr   rt   )r   rF   r~   s   `  r   rG   ÚHeader._on_mountÚ   sZ   ø€ ÷	ð 	�
‰
�4—8‘8˜W iÔ0Ø�
‰
�4—8‘8˜[¨)Ô4Ø�
‰
�4—;‘; ¨Ô3Ø�
‰
�4—;‘; ¨YÕ7r   )r\   r%   r?   )F)r]   ÚboolrC   ú
str | NonerW   rƒ   rX   rƒ   r%   rƒ   r?   rƒ   )r)   r   )rV   r‚   r)   r*   )r)   r   )r)   ÚstrrN   )r,   r-   r.   r/   r0   r1   ÚDEFAULT_CLASSESr   rV   rO   r%   r?   r[   rc   rh   rl   ro   Úpropertyrp   rq   rG   r2   Ú__classcell__)r^   s   @r   rT   rT   t   sí   ø‡ Ù.ð€Kð €Oá# E›?€Dˆ.Ó*ØPá" 5›/€Dˆ-Ó)Ø3á!)¨$£€K�Ó/Ø#ð !ð+ð  ØØ"ØØ"&ñ+àð+ð ð	+ð
 ð+ð ð+ð ð+ð  ÷+ñ +ô6
ô&ò#ô	Oð óó ðð ó	ó ð	÷
8ò 
8r   rT   N)r0   Ú
__future__r   r   Ú	rich.textr   Útextual.appr   r   Útextual.contentr   Útextual.domr	   Útextual.eventsr
   r   Útextual.reactiver   Útextual.widgetr   Útextual.widgetsr   r   r5   r;   rQ   rT   r3   r   r   Ú<module>r‘      sh   ðÙ 3å "å å ç 3Ý #Ý  ß 'Ý %Ý !Ý "ô$�ô $ôN�vô ô(FÐ"ô Fô4
�&ô 
ôp8ˆVõ p8r   