-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to manage styles and colors #3
Comments
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. |
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?
The text was updated successfully, but these errors were encountered: