Fix dark theme text color in DataGridTextColumn

This commit is contained in:
Michael Bucari-Tovo 2025-03-04 16:18:06 -07:00
parent c3938c49a9
commit e37abbf276
3 changed files with 18 additions and 0 deletions

View File

@ -17,6 +17,9 @@
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="Background" Value="Transparent" />
</ControlTheme>
<ControlTheme x:Key="{x:Type DataGridCell}" TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
</ControlTheme>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="SeriesEntryGridBackgroundBrush" Opacity="0.3" Color="#abffab" />

View File

@ -1,6 +1,7 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Styling;
using LibationFileManager;
using System;
using System.Threading.Tasks;
@ -30,6 +31,9 @@ namespace LibationAvalonia.Dialogs
Closing += DialogWindow_Closing;
UseCustomTitleBar = Configuration.IsWindows;
if (Design.IsDesignMode)
RequestedThemeVariant = ThemeVariant.Dark;
}
private bool fixedMinHeight = false;

View File

@ -42,6 +42,17 @@ namespace LibationAvalonia.Dialogs
public EditQuickFilters()
{
InitializeComponent();
if (Design.IsDesignMode)
{
Filters = new ObservableCollection<Filter>([
new Filter { Name = "Filter 1", FilterString = "[filter1 string]" },
new Filter { Name = "Filter 2", FilterString = "[filter2 string]" },
new Filter { Name = "Filter 3", FilterString = "[filter3 string]" },
new Filter { Name = "Filter 4", FilterString = "[filter4 string]" }
]);
DataContext = this;
return;
}
// WARNING: accounts persister will write ANY EDIT to object immediately to file
// here: copy strings and dispose of persister