Skip to content

Commit

Permalink
修复 设置默认主题重启后无效
Browse files Browse the repository at this point in the history
修复 情景变量删除
优化 情景左侧节点显示
  • Loading branch information
MakesYT committed May 24, 2024
1 parent 63bd9cd commit df8504e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Core.Window/Core.Window.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>

<ProjectReference Include="..\Core\Core.csproj"/>
</ItemGroup>
<ItemGroup>
Expand Down
24 changes: 13 additions & 11 deletions KitopiaAvalonia/Services/ThemeChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using Avalonia;
using Avalonia.Styling;
using Avalonia.Threading;
using Core.SDKs.Services;
using FluentAvalonia.Styling;
using KitopiaAvalonia;
Expand All @@ -20,17 +21,18 @@ public void changeTo(string name)
{
log.Debug(nameof(ThemeChange) + "的接口" + nameof(changeTo) + "被调用");


switch (name)
{
case "theme_light":
Application.Current.RequestedThemeVariant = ThemeVariant.Light;
break;

default:
Application.Current.RequestedThemeVariant = ThemeVariant.Dark;
break;
}
Dispatcher.UIThread.Post(() => {
switch (name)
{
case "theme_light":
Application.Current.RequestedThemeVariant = ThemeVariant.Light;
break;
default:
Application.Current.RequestedThemeVariant = ThemeVariant.Dark;
break;
}
});
}

public void changeAnother()
Expand Down
21 changes: 9 additions & 12 deletions KitopiaAvalonia/Windows/TaskEditor.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

xmlns:objectModel="clr-namespace:System.Collections.ObjectModel;assembly=System.ObjectModel"
xmlns:generic="clr-namespace:System.Collections.Generic;assembly=System.Runtime"
xmlns:sdKs="clr-namespace:Kitopia.SDKs"
xmlns:controls2="clr-namespace:NodifyM.Avalonia.Controls;assembly=NodifyM.Avalonia"
xmlns:pages="clr-namespace:KitopiaAvalonia.Pages"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
Expand Down Expand Up @@ -273,8 +272,8 @@
<!-- ReSharper disable once Xaml.RedundantResource -->
<MenuItem Header="删除此变量"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Command="{Binding $parent[Border].((taskEditor1:TaskEditorViewModel)DataContext).DelValueCommand}"
CommandParameter="{Binding $parent[Border].((sdKs:KeyValuePairBindingTool)DataContext).Key }" />
Command="{Binding $parent[StackPanel].((taskEditor1:TaskEditorViewModel)DataContext).DelValueCommand}"
CommandParameter="{Binding Key }" />
</MenuFlyout>
</Border.ContextFlyout>

Expand Down Expand Up @@ -309,8 +308,8 @@
<Rectangle>
<Rectangle.Fill>
<SolidColorBrush
Color="{DynamicResource ApplicationBackgroundColor}"
Opacity="0.2" />
Color="{DynamicResource Node.BackgroundColor}"
Opacity="0.5" />
</Rectangle.Fill>
</Rectangle>
<DockPanel>
Expand Down Expand Up @@ -448,8 +447,8 @@
<Rectangle>
<Rectangle.Fill>
<SolidColorBrush
Color="{DynamicResource ApplicationBackgroundColor}"
Opacity="0.2" />
Color="{DynamicResource Node.BackgroundColor}"
Opacity="0.5" />
</Rectangle.Fill>
</Rectangle>
<StackPanel Orientation="Horizontal"
Expand Down Expand Up @@ -776,8 +775,8 @@
<Rectangle>
<Rectangle.Fill>
<SolidColorBrush
Color="{DynamicResource ApplicationBackgroundColor}"
Opacity="0.2" />
Color="{DynamicResource Node.BackgroundColor}"
Opacity="0.5" />
</Rectangle.Fill>
</Rectangle>
<DockPanel>
Expand Down Expand Up @@ -1179,9 +1178,7 @@

</controls2:Node.Resources>

<controls2:Node.Foreground>
<SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}" />
</controls2:Node.Foreground>

<controls2:Node.HeaderBrush>
<SolidColorBrush Color="{DynamicResource SystemAccentColor}"
Opacity="0.5" />
Expand Down

0 comments on commit df8504e

Please sign in to comment.