#NEWLINE# @ decorate_constructor_parameter_types ( [ str , bool ] ) #NEWLINE# def __init__( self , text , is_folder = False , **kwargs ) : #NEWLINE# #INDENT# super ( FileFolderItem , self ) . __init__ ( ** kwargs ) #NEWLINE# super ( FileFolderItem , self ) . set_layout_orientation ( Widget . LAYOUT_HORIZONTAL ) #NEWLINE# self . style [ 'margin' ] = '3px' #NEWLINE# self . isFolder = is_folder #NEWLINE# self . attributes [ self . EVENT_ONCLICK ] = '' #NEWLINE# self . icon = Widget ( _class = 'FileFolderItemIcon' ) #NEWLINE# self . icon . set_size ( 30 , 30 ) #NEWLINE# if is_folder : #NEWLINE# #INDENT# self . icon . set_on_click_listener ( self , self . EVENT_ONCLICK ) #NEWLINE# #UNINDENT# icon_file = ( 'res/folder.png' if is_folder else 'res/file.png' ) #NEWLINE# self . icon . style [ 'background-image' ] = ( "url('%s')" % icon_file ) #NEWLINE# self . label = Label ( text ) #NEWLINE# self . label . set_size ( 400 , 30 ) #NEWLINE# self . label . set_on_click_listener ( self , self . EVENT_ONSELECTION ) #NEWLINE# self . append ( self . icon , key = 'icon' ) #NEWLINE# self . append ( self . label , key = 'text' ) #NEWLINE# self . selected = False