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="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type DataGridCell}" TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
</ControlTheme>
<ResourceDictionary.ThemeDictionaries> <ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light"> <ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="SeriesEntryGridBackgroundBrush" Opacity="0.3" Color="#abffab" /> <SolidColorBrush x:Key="SeriesEntryGridBackgroundBrush" Opacity="0.3" Color="#abffab" />

View File

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

View File

@ -42,6 +42,17 @@ namespace LibationAvalonia.Dialogs
public EditQuickFilters() public EditQuickFilters()
{ {
InitializeComponent(); 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 // WARNING: accounts persister will write ANY EDIT to object immediately to file
// here: copy strings and dispose of persister // here: copy strings and dispose of persister