a
    ©ˆcš  ã                   @   s<   d dl mZ d dlmZ d dlmZmZ G dd„ deƒZdS )é    )ÚImageResource)Ú
TaskWindow)ÚInstanceÚPropertyc                   @   sL   e Zd ZdZedƒZeeeƒdd�Zeedd�Z	dd„ Z
d	d
„ Zdd„ ZdS )r   z: A TaskWindow for use with the Envisage Tasks plugin.
    z&envisage.ui.tasks.api.TasksApplicationÚ_icon)ZobserveT)Ú
allow_nonec                 C   s>   | j s| jdu r| j S | jj}| jjr:d}||| jjf }|S )zp If the application has a name, add it to the title. Otherwise,
            behave like the base class.
        Nz%s - %s)Z_titleZactive_taskÚnameÚapplication)ÚselfÚtitleÚform© r   ú`/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/envisage/ui/tasks/task_window.pyÚ
_get_title$   s    zTaskWindow._get_titlec                 C   s*   | j dur| j S | jdur"| jjS dS dS )zHIf we have an icon return it, else delegate to the application.
        N)r   r	   Úicon)r
   r   r   r   Ú	_get_icon1   s
    

zTaskWindow._get_iconc                 C   s
   || _ dS )z:Explicitly set the icon to use.  None is allowed.
        N)r   )r
   r   r   r   r   Ú	_set_icon;   s    zTaskWindow._set_iconN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r	   r   r   r   r   r   r   r   r   r   r   r   r      s   
r   N)Zpyface.image_resourcer   Zpyface.tasks.apir   ZPyfaceTaskWindowZ
traits.apir   r   r   r   r   r   Ú<module>   s   