Open charlesroddie opened 5 years ago
Inner styles completely taking over outer ones is a problem. For example, setting text yellow inside bold text would un-bold the text.
I prefer different atoms for different style settings.
Inner styles completely taking over outer ones is a problem. For example, setting text yellow inside bold text would un-bold the text.
Of course inner colors take precedence over outer colors etc.. So combining styles would go:
type Style =
{ Color: System.Drawing.Color option
Italic: bool option
... }
static member Combine (outer:Style) (inner:Style) =
{ Color = if inner.Color.IsSome then inner.Color else outer.Color
Italic = if inner.Italic.IsSome then inner.Italic else outer.Italic
... }
So a single style atom vs separate color/bold/italic/etc. atoms vs anything inbetween shouldn't prevent correct behaviour here.
Can we discuss the best way to describe styles (colors, italics, fonts, ...) in the Atom type?
Currently:
Char of char * textStyle: string option
FixedChar of c:char * fontId:int
Styled of RowAtom* background: Brush * foreground: Brush
Styled of Atom * Style
Color of Atom * colorString: string
Should we have a single Atom case
Styled of Atom * Style
to give style information?Where inner styles take precedence over outer styles, and there is a default style which is the most outer style? Would this work?