Skip to content

Commit

Permalink
Fixed incorrect logic for toggling options
Browse files Browse the repository at this point in the history
  • Loading branch information
Mantas-2155X committed Jul 21, 2024
1 parent 83cf5d0 commit 67233d7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions HardSubberGUI/HardSubberGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<TrimMode>copyused</TrimMode>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<PackageVersion>1.0.1</PackageVersion>
<AssemblyVersion>1.6.0.0</AssemblyVersion>
<FileVersion>1.6.0.0</FileVersion>
<AssemblyVersion>1.6.1.0</AssemblyVersion>
<FileVersion>1.6.1.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
Expand Down
24 changes: 20 additions & 4 deletions HardSubberGUI/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,18 @@ private void ApplySubsControl_OnPropertyChanged(object? sender, AvaloniaProperty
if (!initialized)
return;

SubtitleIndexControl.IsEnabled = (bool)ApplySubsControl.IsChecked!;
SubtitleIndexControl.IsEnabled = (bool)ApplySubsControl.IsChecked! && !(bool)ExternalSubsControl.IsChecked!;
AudioIndexControl.IsEnabled = (bool)ApplySubsControl.IsChecked!;

ExternalSubsControl.IsEnabled = (bool)ApplySubsControl.IsChecked! && !(bool)PGSSubsControl.IsChecked!;

if (!ExternalSubsControl.IsEnabled)
ExternalSubsControl.IsChecked = false;

PGSSubsControl.IsEnabled = (bool)ApplySubsControl.IsChecked! && !(bool)ExternalSubsControl.IsChecked!;

if (!PGSSubsControl.IsEnabled)
PGSSubsControl.IsChecked = false;
}

private void InputControl_OnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e)
Expand Down Expand Up @@ -128,8 +138,11 @@ private void PGSSubsControl_OnPropertyChanged(object? sender, AvaloniaPropertyCh

if (!ApplyResizeControl.IsEnabled)
ApplyResizeControl.IsChecked = false;

ExternalSubsControl.IsEnabled = !(bool)PGSSubsControl.IsChecked!;

if ((bool)PGSSubsControl.IsChecked)
ExternalSubsControl.IsEnabled = false;
else
ExternalSubsControl.IsEnabled = (bool)ApplySubsControl.IsChecked!;

if (!ExternalSubsControl.IsEnabled)
ExternalSubsControl.IsChecked = false;
Expand All @@ -145,7 +158,10 @@ private void ExternalSubsControl_OnPropertyChanged(object? sender, AvaloniaPrope
if (!PGSSubsControl.IsEnabled)
PGSSubsControl.IsChecked = false;

SubtitleIndexControl.IsEnabled = !(bool)ExternalSubsControl.IsChecked!;
if ((bool)ExternalSubsControl.IsChecked)
SubtitleIndexControl.IsEnabled = false;
else
SubtitleIndexControl.IsEnabled = (bool)ApplySubsControl.IsChecked!;
}

public void BackgroundTasks()
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ This is a simple cross platform GUI tool made with Avalonia used to burn subtitl
- [ ] Linux
- [x] AMD (v1.0.1.0+)
- [ ] NVIDIA
- [ ] Intel
- [x] Windows
- [x] AMD (v1.3.0.0+)
- [x] NVIDIA (v1.2.0.0+)
- [ ] Intel

### Notes
* ffmpeg is required for hardsubbing. If it's not installed already, hardsubber will download it and use it locally

0 comments on commit 67233d7

Please sign in to comment.