Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
修复弹幕区域设置没有立即生效的问题 (#1113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy authored Apr 23, 2022
1 parent b6a3a31 commit 236d723
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
- [ ] 新组件
- [ ] 已经准备了关于新组件的说明文档,文档链接:[link]()
- [ ] 对于控件,已将控件放在主项目的 Controls 文件夹内
- [ ] 主要的功能修改已经添加至 [Wiki](https://github.com/Richasy/Bili.Uwp/wiki) e.g. 新的功能,管道更新,快捷键增加...
- [ ] 单元测试更新 (对于 Bug 修复及新功能添加) (如果适用)
- [ ] 主要的功能修改已经添加至 [Wiki](https://github.com/Richasy/Bili.Uwp/wiki)
- [ ] 文件头已经被添加至所有源文件中
- [ ] ****包含破坏式更新

Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/release-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ jobs:
$manifest.Package.Identity.Version = "${{github.event.inputs.version}}"
$manifest.save(".\$env:UWP_Project_Directory\Package.appxmanifest")
- name: Build x86
run: msbuild $env:Solution_Path /p:Platform=x86 /p:AppxBundlePlatforms="x86" /p:AppxPackageDir=C:\Package\x86 /p:PackageCertificateKeyFile=$env:SigningCertificate /restore
env:
BuildMode: SideloadOnly
Configuration: Release

- name: Build x64
run: msbuild $env:Solution_Path /p:Platform=x64 /p:AppxBundlePlatforms="x64" /p:AppxPackageDir=C:\Package\x64 /p:PackageCertificateKeyFile=$env:SigningCertificate /restore
env:
Expand All @@ -56,12 +62,26 @@ jobs:
env:
BuildMode: SideloadOnly
Configuration: Release

- name: Create x86 archive
run: Compress-Archive -Path C:\Package\x86\App_${{github.event.inputs.version}}_Test -DestinationPath C:\Package\Bili.Uwp_${{github.event.inputs.version}}_x86.zip

- name: Create x64 archive
run: Compress-Archive -Path C:\Package\x64\App_${{github.event.inputs.version}}_Test -DestinationPath C:\Package\Bili.Uwp_${{github.event.inputs.version}}_x64.zip

- name: Create ARM64 archive
run: Compress-Archive -Path C:\Package\ARM64\App_${{github.event.inputs.version}}_Test -DestinationPath C:\Package\Bili.Uwp_${{github.event.inputs.version}}_ARM64.zip

- name: Update x86 release asset
id: upload-release-asset-x86
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
asset_path: C:\Package\Bili.Uwp_${{github.event.inputs.version}}_x86.zip
asset_name: Bili.Uwp_${{github.event.inputs.version}}_x86.zip
asset_content_type: application/zip

- name: Update x64 release asset
id: upload-release-asset-x64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public sealed partial class DanmakuView
/// <see cref="DanmakuArea"/>的依赖属性.
/// </summary>
public static readonly DependencyProperty DanmakuAreaProperty =
DependencyProperty.Register(nameof(DanmakuArea), typeof(double), typeof(DanmakuView), new PropertyMetadata(0d, OnDanmakuAreaChanged));
DependencyProperty.Register(nameof(DanmakuArea), typeof(double), typeof(DanmakuView), new PropertyMetadata(default, OnDanmakuAreaChanged));

/// <summary>
/// <see cref="IsDanmakuLimit"/>的依赖属性.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,12 @@ protected override void OnApplyTemplate()
DanmakuViewModel.DanmakuListAdded += OnDanmakuListAdded;
DanmakuViewModel.RequestClearDanmaku += OnRequestClearDanmaku;
DanmakuViewModel.SendDanmakuSucceeded += OnSendDanmakuSucceeded;
DanmakuViewModel.PropertyChanged += OnDanmakuViewModelPropertyChanged;
ViewModel.MediaPlayerUpdated += OnMediaPlayerUdpated;
ViewModel.PropertyChanged += OnViewModelPropertyChanged;
ViewModel.NewLiveDanmakuAdded += OnNewLiveDanmakuAdded;
AppViewModel.Instance.PropertyChanged += OnAppViewModelPropertyChanged;
_danmakuView.DanmakuArea = DanmakuViewModel.DanmakuArea;

CheckCurrentPlayerModeAsync();
CheckSubtitleZoom();
Expand Down Expand Up @@ -583,6 +585,14 @@ private void OnViewModelPropertyChanged(object sender, PropertyChangedEventArgs
}
}

private void OnDanmakuViewModelPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(DanmakuViewModel.DanmakuArea) && _danmakuView != null)
{
_danmakuView.DanmakuArea = DanmakuViewModel.DanmakuArea;
}
}

private async void OnPlaybackStateChangedAsync(MediaPlaybackSession sender, object args)
{
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@
x:Name="DanmakuView"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
DanmakuArea="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=DanmakuViewModel.DanmakuArea}"
DanmakuBold="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=DanmakuViewModel.IsDanmakuBold}"
DanmakuDuration="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=DanmakuViewModel.DanmakuSpeed}"
DanmakuFontFamily="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=DanmakuViewModel.DanmakuFont}"
Expand Down

0 comments on commit 236d723

Please sign in to comment.