monkey2 icon indicating copy to clipboard operation
monkey2 copied to clipboard

(suggestion) Theme class - add downcasting to GetStyle()

Open engor opened this issue 7 years ago • 0 comments

Idea is to have such method instead of existing one

Method GetStyle:Style( name:String,name2:String=Null,name3:String=Null )
	
	Local style:=Self.GetStyle( name )
	If style=Null And name2
		style=Self.GetStyle( name2 )
	Endif
	If style=Null And name3
		style=Self.GetStyle( name3 )
	Endif
	
	Return style
End

It gives us kind of styles downcasting: _myHint.Style=App.Theme.GetStyle( "SuperHint","Label" ) So, we allow to use Label if have no SuperHint.

Two params may be enough for 98%, but three covers 100%. :)

engor avatar Jul 08 '18 13:07 engor