#NEWLINE# def _layout_random( self ) : #NEWLINE# #INDENT# super_add = super ( ActionView , self ) . add_widget #NEWLINE# self . _state = 'random' #NEWLINE# self . _clear_all ( ) #NEWLINE# hidden_items = [ ] #NEWLINE# hidden_groups = [ ] #NEWLINE# total_width = 0 #NEWLINE# super_add ( self . action_previous ) #NEWLINE# width = ( ( self . width - self . overflow_group . pack_width ) - self . action_previous . pack_width ) #NEWLINE# if len ( self . _list_action_items ) : #NEWLINE# #INDENT# for child in self . _list_action_items [ 1 : ] : #NEWLINE# #INDENT# if child . important : #NEWLINE# #INDENT# if ( ( child . pack_width + total_width ) < width ) : #NEWLINE# #INDENT# super_add ( child ) #NEWLINE# child . inside_group = False #NEWLINE# total_width += child . pack_width #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# hidden_items . append ( child ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# hidden_items . append ( child ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( total_width < self . width ) : #NEWLINE# #INDENT# for group in self . _list_action_group : #NEWLINE# #INDENT# if ( ( ( group . pack_width + total_width ) + group . separator_width ) < width ) : #NEWLINE# #INDENT# super_add ( group ) #NEWLINE# group . show_group ( ) #NEWLINE# total_width += ( group . pack_width + group . separator_width ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# hidden_groups . append ( group ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# group_index = ( len ( self . children ) - 1 ) #NEWLINE# if ( total_width < self . width ) : #NEWLINE# #INDENT# for child in hidden_items [ : ] : #NEWLINE# #INDENT# if ( ( child . pack_width + total_width ) < width ) : #NEWLINE# #INDENT# super_add ( child , group_index ) #NEWLINE# total_width += child . pack_width #NEWLINE# child . inside_group = False #NEWLINE# hidden_items . remove ( child ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# extend_hidden = hidden_items . extend #NEWLINE# for group in hidden_groups : #NEWLINE# #INDENT# extend_hidden ( group . list_action_item ) #NEWLINE# #UNINDENT# overflow_group = self . overflow_group #NEWLINE# if ( hidden_items != [ ] ) : #NEWLINE# #INDENT# over_add = super ( overflow_group . __class__ , overflow_group ) . add_widget #NEWLINE# for child in hidden_items : #NEWLINE# #INDENT# over_add ( child ) #NEWLINE# #UNINDENT# overflow_group . show_group ( ) #NEWLINE# super_add ( overflow_group )