Skip to content

Commit

Permalink
修复颜色控制
Browse files Browse the repository at this point in the history
  • Loading branch information
Poker-sang committed Jul 7, 2024
1 parent 5517c80 commit d479232
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DanmakuPlayer/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public AppConfig()
/// <summary>
/// 弹幕描边颜色
/// </summary>
/// <remarks>default: 0xFFA9A9A9</remarks>
public uint DanmakuStrokeColor { get; set; } = 0xFFA9A9A9;
/// <remarks>default: 0xFF000000</remarks>
public uint DanmakuStrokeColor { get; set; } = 0xFF000000;

/// <summary>
/// 转换大会员彩色弹幕
Expand Down
3 changes: 1 addition & 2 deletions DanmakuPlayer/Views/Controls/SettingsDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:controls1="using:WinUI3Utilities.Controls"
xmlns:converters="using:DanmakuPlayer.Views.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:fluent="using:FluentIcons.WinUI"
Expand Down Expand Up @@ -154,7 +153,7 @@
x:Uid="/SettingsDialog/DanmakuStrokeColorCard"
HeaderIcon="{fluent:SymbolIcon Symbol=Eyedropper}"
IsEnabled="{x:Bind local:C.IsNotZero(Vm.DanmakuStrokeWidth), Mode=OneWay}">
<controls:ColorPickerButton SelectedColor="{x:Bind local:C.ToAlphaColor(Vm.DanmakuStrokeColor), BindBack=local:C.ToAlphaUInt, Mode=TwoWay}">
<controls:ColorPickerButton SelectedColor="{x:Bind local:C.ToAlphaColor(Vm.DanmakuStrokeColor), BindBack=ColorBindBack, Mode=TwoWay}">
<controls:ColorPickerButton.ColorPickerStyle>
<Style TargetType="controls:ColorPicker">
<Setter Property="IsAlphaEnabled" Value="True" />
Expand Down
3 changes: 3 additions & 0 deletions DanmakuPlayer/Views/Controls/SettingsDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using Windows.ApplicationModel.DataTransfer;
using Windows.System;
using Windows.UI;
using CommunityToolkit.Mvvm.ComponentModel;
using DanmakuPlayer.Services;
using DanmakuPlayer.Views.ViewModels;
Expand Down Expand Up @@ -83,6 +84,8 @@ private void CompareChanges(AppConfig before, AppConfig after)
HttpClientHelper.ShouldRefreshHeader = true;
}

private void ColorBindBack(Color color) => Vm.DanmakuStrokeColor = C.ToAlphaUInt(color);

#region 事件处理

private async void NavigateUriTapped(object sender, TappedRoutedEventArgs e)
Expand Down

0 comments on commit d479232

Please sign in to comment.