Skip to content

Commit

Permalink
Fix multiselect and hide sizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiktack committed Aug 19, 2024
1 parent c087b40 commit 9cc4c33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Wino.Mail/Views/MailListPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@
</Grid>
</Border>
<controls1:PropertySizer
x:Name="MailListSizer"
Grid.Column="1"
Width="16"
HorizontalAlignment="Left"
Expand Down
9 changes: 5 additions & 4 deletions Wino.Mail/Views/MailListPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,13 @@ private void UpdateAdaptiveness()
{
bool shouldDisplayNoMessagePanel, shouldDisplayMailingList, shouldDisplayRenderingFrame;

bool isMultiSelectionEnabled = ViewModel.IsMultiSelectionModeEnabled || KeyPressService.IsCtrlKeyPressed();

// This is the smallest state UI can get.
// Either mailing list or rendering grid is visible.
if (StatePersistenceService.IsReaderNarrowed)
{
// Start visibility checks by no message panel.

bool isMultiSelectionEnabled = ViewModel.IsMultiSelectionModeEnabled || KeyPressService.IsCtrlKeyPressed();

shouldDisplayMailingList = isMultiSelectionEnabled ? true : (!ViewModel.HasSelectedItems || ViewModel.HasMultipleItemSelections);
shouldDisplayNoMessagePanel = shouldDisplayMailingList ? false : !ViewModel.HasSelectedItems || ViewModel.HasMultipleItemSelections;
shouldDisplayRenderingFrame = shouldDisplayMailingList ? false : !shouldDisplayNoMessagePanel;
Expand All @@ -524,7 +523,7 @@ private void UpdateAdaptiveness()

if (StatePersistenceService.IsReaderNarrowed == true)
{
if (ViewModel.HasSingleItemSelection)
if (ViewModel.HasSingleItemSelection && !isMultiSelectionEnabled)
{
MailListColumn.Width = new GridLength(0);
RendererColumn.Width = new GridLength(1, GridUnitType.Star);
Expand All @@ -544,6 +543,7 @@ private void UpdateAdaptiveness()
MailListContainer.Visibility = Visibility.Visible;
RenderingGrid.Visibility = Visibility.Collapsed;
SearchBar.Margin = new Thickness(8, 0, -2, 0);
MailListSizer.Visibility = Visibility.Collapsed;
}
}
else
Expand All @@ -561,6 +561,7 @@ private void UpdateAdaptiveness()
MailListContainer.Visibility = Visibility.Visible;
RenderingGrid.Visibility = Visibility.Visible;
SearchBar.Margin = new Thickness(2, 0, -2, 0);
MailListSizer.Visibility = Visibility.Visible;
}
}
}
Expand Down

0 comments on commit 9cc4c33

Please sign in to comment.