Skip to content

Commit d2cb4fd

Browse files
committed
Fixes for darkmode and episode list
1 parent 841ff84 commit d2cb4fd

File tree

5 files changed

+18
-23
lines changed

5 files changed

+18
-23
lines changed

BangumiNet/App.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Application.Styles>
1717
<sty:FluentAvaloniaTheme PreferSystemTheme="True" PreferUserAccentColor="True"/>
1818
<Style Selector="Border.Card">
19-
<Setter Property="BorderBrush" Value="#7f000000"/>
19+
<Setter Property="BorderBrush" Value="#7f7f7f7f"/>
2020
<Setter Property="BorderThickness" Value="1"/>
2121
<Setter Property="CornerRadius" Value="10"/>
2222
<Setter Property="BoxShadow" Value="0 0 10 0 LightGray"/>

BangumiNet/BangumiNet.csproj

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
<PackageReference Include="Avalonia.Desktop" Version="11.3.6" />
2727
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.6" />
2828
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.6" />
29-
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
30-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.6" />
29+
<PackageReference Include="Avalonia.Diagnostics" Version="11.3.6" Condition="'$(Configuration)' == 'Debug'" />
3130
<PackageReference Include="Avalonia.ReactiveUI" Version="11.3.6" />
3231
<PackageReference Include="FluentAvaloniaUI" Version="2.4.0" />
3332
<PackageReference Include="FluentIcons.Avalonia" Version="1.1.310" />
@@ -42,10 +41,4 @@
4241
<ProjectReference Include="..\BangumiNet.Api\BangumiNet.Api.csproj" />
4342
<ProjectReference Include="..\BangumiNet.Shared\BangumiNet.Shared.csproj" />
4443
</ItemGroup>
45-
46-
<ItemGroup>
47-
<Compile Update="Views\SubjectListView.axaml.cs">
48-
<DependentUpon>SubjectListView.axaml</DependentUpon>
49-
</Compile>
50-
</ItemGroup>
5144
</Project>

BangumiNet/Views/AiringView.axaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
x:DataType="vm:AiringViewModel"
1010
x:Class="BangumiNet.Views.AiringView">
1111
<ScrollViewer>
12-
<StackPanel Margin="5" Spacing="5">
13-
<Border Classes="Card" Padding="5">
12+
<StackPanel>
13+
<Border Classes="Card" Padding="5" Margin="5,5,5,0">
1414
<TextBlock FontSize="30"><ic:FluentIcon Icon="Live" FontSize="30" Margin="0,0,0,-4"/> 每日放送</TextBlock>
1515
</Border>
1616
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
17-
MaxWidth="1640" HorizontalAlignment="Center">
18-
<ItemsControl ItemsSource="{Binding Calendars}">
17+
MaxWidth="1650" HorizontalAlignment="Center">
18+
<ItemsControl ItemsSource="{Binding Calendars}" Margin="5" ClipToBounds="False">
1919
<ItemsControl.DataTemplates>
2020
<DataTemplate DataType="vm:CalendarViewModel">
2121
<v:CalendarView DataContext="{Binding .}" Width="230"/>

BangumiNet/Views/SearchView.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
<ItemsControl ItemsSource="{Binding Tag}">
148148
<ItemsControl.ItemTemplate>
149149
<DataTemplate>
150-
<Border Classes="Card" Margin="0,0,3,3" BoxShadow="0 0 0 transparent" BorderBrush="#3f000000">
150+
<Border Classes="Card" Margin="0,0,3,3" BoxShadow="0 0 0 transparent" BorderBrush="#3f7f7f7f">
151151
<Grid ColumnDefinitions="Auto,Auto">
152152
<TextBlock Text="{Binding}" VerticalAlignment="Center" />
153153
<Button Content="{ice:FluentIcon Icon=Dismiss}" Grid.Column="1" CommandParameter="{Binding}" Padding="0"
@@ -172,7 +172,7 @@
172172
<ItemsControl ItemsSource="{Binding MetaTag}">
173173
<ItemsControl.ItemTemplate>
174174
<DataTemplate>
175-
<Border Classes="Card" Margin="0,0,3,3" BoxShadow="0 0 0 transparent" BorderBrush="#3f000000">
175+
<Border Classes="Card" Margin="0,0,3,3" BoxShadow="0 0 0 transparent" BorderBrush="#3f7f7f7f">
176176
<Grid ColumnDefinitions="Auto,Auto">
177177
<TextBlock Text="{Binding}" VerticalAlignment="Center" />
178178
<Button Content="{ice:FluentIcon Icon=Dismiss}" Grid.Column="1" CommandParameter="{Binding}" Padding="0"

BangumiNet/Views/SubjectView.axaml.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ public SubjectView()
1313
{
1414
if (dataContextChanges > 10) return;
1515
if (DataContext is not SubjectViewModel viewModel) return;
16-
if (viewModel.Source?.GetType() == typeof(Api.V0.Models.Subject)) return;
17-
if (viewModel.Id is not int id) return;
18-
var fullSubject = await ApiC.V0.Subjects[id].GetAsync();
19-
if (fullSubject == null) return;
20-
dataContextChanges += 1;
21-
var vm = new SubjectViewModel(fullSubject);
22-
_ = vm.EpisodeListViewModel?.LoadEpisodes();
23-
DataContext = vm;
16+
if (viewModel.Source?.GetType() != typeof(Api.V0.Models.Subject))
17+
{
18+
if (viewModel.Id is not int id) return;
19+
var fullSubject = await ApiC.V0.Subjects[id].GetAsync();
20+
if (fullSubject == null) return;
21+
dataContextChanges += 1;
22+
var vm = new SubjectViewModel(fullSubject);
23+
DataContext = vm;
24+
}
25+
_ = ViewModel?.EpisodeListViewModel?.LoadEpisodes();
2426
};
2527
}
2628

0 commit comments

Comments
 (0)