Skip to content

Commit

Permalink
fix: 修复windows上部分输入框样式不正确
Browse files Browse the repository at this point in the history
  • Loading branch information
yaobiao131 committed Jan 13, 2024
1 parent 4bc340c commit 442dadc
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 35 deletions.
16 changes: 5 additions & 11 deletions DownKyi/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,20 @@ public partial class App : PrismApplication
public static ObservableCollection<DownloadedItem>? DownloadedList { get; set; }
public new static App Current => (App)Application.Current!;
public new MainWindow MainWindow => Container.Resolve<MainWindow>();
private IClassicDesktopStyleApplicationLifetime _appLife;
public IClassicDesktopStyleApplicationLifetime? AppLife;

// 下载服务
private IDownloadService? _downloadService;

public static AppBuilder BuildAvaloniaApp() =>
AppBuilder
.Configure<App>()
.UsePlatformDetect();

public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.Exit += OnExit!;
_appLife = desktop;
AppLife = desktop;
}

base.Initialize();
}

Expand Down Expand Up @@ -209,7 +204,7 @@ await Task.Run(() =>
_downloadService = new AriaDownloadService(DownloadingList, DownloadedList, (IDialogService)Container.GetContainer().GetService(typeof(IDialogService)));
break;
case Downloader.CUSTOM_ARIA:
// downloadService = new CustomAriaDownloadService(DownloadingList, DownloadedList, (IDialogService)Container.GetContainer().GetService(typeof(IDialogService)));
_downloadService = new CustomAriaDownloadService(DownloadingList, DownloadedList, (IDialogService)Container.GetContainer().GetService(typeof(IDialogService)));
break;
}

Expand All @@ -219,7 +214,6 @@ await Task.Run(() =>
_downloadService?.Start();
}


return Container.Resolve<MainWindow>();
}

Expand Down Expand Up @@ -278,6 +272,6 @@ private void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e)

private void NativeMenuItem_OnClick(object? sender, EventArgs e)
{
_appLife.Shutdown();
AppLife?.Shutdown();
}
}
5 changes: 1 addition & 4 deletions DownKyi/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public string? Message
set => SetProperty(ref _message, value);
}

private DelegateCommand? LoadedCommand { get; }
public DelegateCommand? LoadedCommand { get; }
public DelegateCommand<PointerPressedEventArgs> DragMoveCommand { get; private set; }

private DelegateCommand? _closingCommand;
Expand Down Expand Up @@ -144,9 +144,6 @@ public MainWindowViewModel(IRegionManager regionManager, IEventAggregator eventA
// ignored
}
});


Dispatcher.UIThread.InvokeAsync(() => { LoadedCommand.Execute(); });
}

#region 剪贴板
Expand Down
1 change: 0 additions & 1 deletion DownKyi/Views/Dialogs/ViewDownloadSetter.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
<ComboBox
Grid.Row="0"
Grid.Column="1"
Height="25"
Margin="10,0"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
Expand Down
3 changes: 3 additions & 0 deletions DownKyi/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<ia:EventTriggerBehavior EventName="Closing">
<ia:InvokeCommandAction Command="{Binding ClosingCommand}" />
</ia:EventTriggerBehavior>
<ia:EventTriggerBehavior EventName="Opened">
<ia:InvokeCommandAction Command="{Binding LoadedCommand}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
<Grid Background="{DynamicResource BrushBackground}" RowDefinitions="*">
<ContentControl prism:RegionManager.RegionName="ContentRegion" />
Expand Down
4 changes: 0 additions & 4 deletions DownKyi/Views/Settings/ViewDanmaku.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<TextBox
Name="NameScreenWidth"
Width="95"
Height="25"
VerticalContentAlignment="Center"
Text="{Binding ScreenWidth, Mode=TwoWay}">
<i:Interaction.Behaviors>
Expand All @@ -82,7 +81,6 @@
<TextBox
Name="NameScreenHeight"
Width="95"
Height="25"
VerticalContentAlignment="Center"
Text="{Binding ScreenHeight, Mode=TwoWay}">
<i:Interaction.Behaviors>
Expand Down Expand Up @@ -127,7 +125,6 @@
<TextBox
x:Name="NameFontSize"
Width="200"
Height="25"
VerticalContentAlignment="Center"
Text="{Binding FontSize}">
<i:Interaction.Behaviors>
Expand All @@ -150,7 +147,6 @@
<TextBox
Name="NameLineCount"
Width="200"
Height="25"
VerticalContentAlignment="Center"
Text="{Binding LineCount}">
<i:Interaction.Behaviors>
Expand Down
1 change: 0 additions & 1 deletion DownKyi/Views/Settings/ViewNetwork.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

<TextBox
Name="NameUserAgent"
Height="25"
Margin="0,10,0,0"
HorizontalAlignment="Stretch"
Text="{Binding UserAgent}">
Expand Down
3 changes: 0 additions & 3 deletions DownKyi/Views/Toolbox/ViewBiliHelper.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<TextBox
x:Name="NameAvid"
Width="150"
Height="25"
Margin="10"
VerticalContentAlignment="Center"
Text="{Binding Avid, Mode=TwoWay}">
Expand All @@ -52,7 +51,6 @@
<TextBox
x:Name="NameBvid"
Width="150"
Height="25"
Margin="10"
VerticalContentAlignment="Center"
Text="{Binding Bvid, Mode=TwoWay}">
Expand Down Expand Up @@ -95,7 +93,6 @@
<TextBox
Name="NameUserId"
Width="150"
Height="25"
Margin="10"
VerticalContentAlignment="Center"
Text="{Binding DanmakuUserId, Mode=TwoWay}" />
Expand Down
11 changes: 1 addition & 10 deletions DownKyi/Views/Toolbox/ViewDelogo.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<TextBlock VerticalAlignment="Center" Text="{DynamicResource VideoFilePath}" />
<TextBox
Width="300"
Height="25"
Margin="0,10,10,10"
VerticalContentAlignment="Center"
IsReadOnly="True"
Expand All @@ -50,29 +49,25 @@
<TextBlock VerticalAlignment="Center" Text="{DynamicResource LogoWidth}" />
<TextBox
Width="50"
Height="25"
Margin="0,0,20,0"
VerticalContentAlignment="Center"
Text="{Binding LogoWidth, Mode=TwoWay}" />
<TextBlock VerticalAlignment="Center" Text="{DynamicResource LogoHeight}" />
<TextBox
Width="50"
Height="25"
Margin="0,0,20,0"
VerticalContentAlignment="Center"
Text="{Binding LogoHeight, Mode=TwoWay}" />

<TextBlock VerticalAlignment="Center" Text="{DynamicResource LogoX}" />
<TextBox
Width="50"
Height="25"
Margin="0,0,20,0"
VerticalContentAlignment="Center"
Text="{Binding LogoX, Mode=TwoWay}" />
<TextBlock VerticalAlignment="Center" Text="{DynamicResource LogoY}" />
<TextBox
Width="50"
Height="25"
Margin="0,0,20,0"
VerticalContentAlignment="Center"
Text="{Binding LogoY, Mode=TwoWay}" />
Expand All @@ -94,11 +89,7 @@
Grid.Row="1"
Margin="0,20"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition />
</Grid.RowDefinitions>
VerticalAlignment="Stretch" RowDefinitions="20,*">
<TextBlock
Grid.Row="0"
VerticalAlignment="Bottom"
Expand Down
1 change: 0 additions & 1 deletion DownKyi/Views/ViewVideoDetail.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@
<TextBox
Grid.Column="3"
Width="200"
Height="25"
Margin="48,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Expand Down

0 comments on commit 442dadc

Please sign in to comment.