mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 08:50:25 +01:00
Changed CellColorGetterDelegate to use its own class for args CellColorGetterArgs to future proof the API against breaking changes
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -319,9 +319,9 @@ namespace UICatalog.Scenarios {
|
||||
// not a double
|
||||
TextAlignment.Left,
|
||||
|
||||
ColorGetter = (i,v)=>v is double d ?
|
||||
ColorGetter = (a)=> a.CellValue is double d ?
|
||||
// color 0 and negative values red
|
||||
d <= 0.0000001 ? i%2==0 && miAlternatingColors.Checked ? redColorSchemeAlt: redColorScheme :
|
||||
d <= 0.0000001 ? a.RowIndex%2==0 && miAlternatingColors.Checked ? redColorSchemeAlt: redColorScheme :
|
||||
// use normal scheme for positive values
|
||||
null:
|
||||
// not a double
|
||||
|
||||
@@ -511,7 +511,7 @@ namespace Terminal.Gui.Views {
|
||||
|
||||
// when B is 2 use the custom highlight colour
|
||||
ColorScheme cellHighlight = new ColorScheme () { Normal = Attribute.Make (Color.BrightCyan, Color.DarkGray) };
|
||||
bStyle.ColorGetter = (rowIdx, value) => Convert.ToInt32(value) == 2 ? cellHighlight : null;
|
||||
bStyle.ColorGetter = (a) => Convert.ToInt32(a.CellValue) == 2 ? cellHighlight : null;
|
||||
|
||||
tv.Redraw (tv.Bounds);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user