blitz-foundation / monkey2

zlib License
3 stars 0 forks source link

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

Open Pharmhaus-2 opened 5 years ago

Pharmhaus-2 commented 5 years ago

Original Author: engor

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%. :)