Skip to content

Commit

Permalink
fix: Issue where the delete button on the flyout was not clickable if…
Browse files Browse the repository at this point in the history
… it was infront of the window titlebar (Jorixon#50)
  • Loading branch information
Jorixon authored Sep 30, 2023
1 parent 352de20 commit 1fd5495
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ [ObservableProperty] [NotifyCanExecuteChangedFor(nameof(DeleteModsCommand), name

[ObservableProperty] private string _selectedModCharacterSkinOverrideDisplayName = string.Empty;


public event EventHandler? CloseFlyoutEvent;
public ObservableCollection<GenshinCharacter> SuggestedCharacters { get; init; } = new();
private List<NewModModel> SelectedMods { get; init; } = new();

Expand Down Expand Up @@ -92,7 +92,7 @@ private void SetSelectedMods(IEnumerable<NewModModel> modModel)
if (SelectedModsCount == 1)
{
var selectedMod = SelectedMods.First();
SelectedModHasCharacterSkinOverride = !string.IsNullOrWhiteSpace(selectedMod.CharacterSkinOverride);
SelectedModHasCharacterSkinOverride = !string.IsNullOrWhiteSpace(selectedMod.CharacterSkinOverride);
SelectedModCharacterSkinOverrideDisplayName = selectedMod.CharacterSkinOverride;
}
else
Expand Down Expand Up @@ -202,6 +202,7 @@ private async Task DeleteModsAsync()
DefaultButton = ContentDialogButton.Primary
};

CloseFlyout();
var result = await windowManager.ShowDialogAsync(dialog);

if (result != ContentDialogResult.Primary)
Expand Down Expand Up @@ -288,11 +289,11 @@ private async Task OverrideModCharacterSkin()
public event EventHandler? ModCharactersSkinOverriden;



[RelayCommand]
private void CloseFlyout()
{
IsMoveModsFlyoutOpen = false;
CloseFlyoutEvent?.Invoke(this, EventArgs.Empty);
}

private readonly GenshinCharacter
Expand Down Expand Up @@ -352,7 +353,6 @@ public bool SelectCharacter(GenshinCharacter? character)
}



[RelayCommand]
private void SelectNewCharacterSkin(SelectCharacterTemplate? characterTemplate)
{
Expand Down
3 changes: 2 additions & 1 deletion src/GIMI-ModManager.WinUI/Views/CharacterDetailsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
Closed="MoveRowFlyout_OnClosed"
Opened="ModRowFlyout_OnOpened"
Opening="ModRowFlyout_OnOpening"
Placement="RightEdgeAlignedBottom">
Placement="RightEdgeAlignedBottom"
ShouldConstrainToRootBounds="False">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand Down
2 changes: 2 additions & 0 deletions src/GIMI-ModManager.WinUI/Views/CharacterDetailsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public CharacterDetailsPage()
// set focus to the first item
ModListGrid.Focus(FocusState.Programmatic);
};

ViewModel.MoveModsFlyoutVM.CloseFlyoutEvent += (sender, args) => { ModRowFlyout.Hide(); };
}

protected override void OnNavigatedTo(NavigationEventArgs e)
Expand Down

0 comments on commit 1fd5495

Please sign in to comment.