@ -45,10 +45,10 @@ class CliMenuStyle:
Allows to select header , option and selected option color
"""
def __init__ ( self , option _style = ' ' , highlight _styl e= ' ' , header_s tyl e= ' ' ) :
self . option _style = option _style
self . highlight _styl e = highlight _styl e
self . header_s tyl e = header_s tyl e
def __init__ ( self , option = ' ' , highlight ed = ' ' , text = ' ' ) :
self . option = option
self . highlight ed = highlight ed
self . text = text
class CliSelectionStyle :
@ -62,12 +62,12 @@ class CliSelectionStyle:
class CliMenuTheme :
BASIC = CliMenuStyle ( )
BASIC_BOLD = CliMenuStyle ( header_s tyl e= ' bold ' , highlight _styl e= ' bold ' )
BASIC_BOLD = CliMenuStyle ( text = ' bold ' , highlight ed = ' bold ' )
RED = CliMenuStyle ( ' #aa0000 ' , ' #ee0000 ' , ' #aa0000 ' )
CYAN = CliMenuStyle ( ' cyan ' , ' lightcyan ' , ' cyan ' )
BLUE = CliMenuStyle ( ' ansiblue ' , ' ansired ' , ' ansiblue ' )
ANSI_CYAN = CliMenuStyle ( ' ansicyan ' , ' ansibrightcyan ' , ' ansicyan ' )
BOLD_HIGHLIGHT = CliMenuStyle ( header_s tyl e= ' bold ' , highlight _styl e= ' bold fg:black bg:white ' )
BOLD_HIGHLIGHT = CliMenuStyle ( text = ' bold ' , highlight ed = ' bold fg:black bg:white ' )
class CliMenu :
@ -173,14 +173,14 @@ class CliMenu:
if ti . lineno == self . _pos :
prefix + = ' {} {} ' . format ( self . _cursor , self . _option_prefix )
style = s . highlight _styl e
style = s . highlight ed
else :
prefix + = ' ' * len ( self . _cursor ) + self . _option_prefix + ' ' * self . _dedent_selection
style = s . option _style
style = s . option
else :
if item . indent :
indent + = ' ' * ( self . _header_indent + len ( self . _cursor ) + 1 )
style = s . header_s tyl e
style = s . text
items = [ ( s if s else style , t ) for s , t in ti . fragments ]
prefix = self . _transform_prefix ( item , ti . lineno , prefix )