fix: Load grid-level settings in pnl window

Font family/size/weight, foreground, background
This commit is contained in:
John Colvin committed 2022-08-01 11:14:29 -04:00
1 parent adfb560dd1
commit 6d77a07bbe
2 files changed
+13

No files matched your search

@@ -264,6 +264,7 @@ namespace bts.shell {
var header_appearance = s.header_cell_appearance.to_appearance();
foreach (var c in _view._grid.Columns.OfType<PNLColumn>()) {
c.load_from(s.grid);
if (col_setting_map.TryGetValue(c.id, out var cs)) {
c.load_from(cs);
}
@@ -450,6 +450,18 @@
}
}
public void load_from(GridSettings settings) {
if (settings is null) {
return;
}
set_fallback_font_params(
settings.font_family is null ? null : new FontFamily(settings.font_family),
settings.font_size,
settings.font_color.argb_color(),
settings.font_weight,
settings.background);
}
// 'fallback' font-params (aka 'grid-level' font-params)
public void set_fallback_font_params(FontFamily font_family, double font_size, Color font_color, FontWeight font_weight, Color background_color) {
using (ReflectionHelper.detect_property_changes(this, raise_prop_changed, nameof(font_family), nameof(font_size), nameof(font_color), nameof(font_weight), nameof(background_color), nameof(background_brush))) {