Skip to content

Feature: Removed margin when using the Compact Spacing option #13145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Files.App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<!-- Default list view item height -->
<x:Double x:Key="ListItemHeight">36</x:Double>

<!-- Default list view item margin -->
<x:Double x:Key="ListItemMargin">0</x:Double>

<!-- Default nav menu item height -->
<x:Double x:Key="NavigationViewItemOnLeftMinHeight">32</x:Double>

Expand Down
4 changes: 3 additions & 1 deletion src/Files.App/Services/ResourcesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public void SetAppThemeFontFamily(string contentControlThemeFontFamily)
/// <inheritdoc/>
public void SetCompactSpacing(bool useCompactSpacing)
{
var listItemHeight = useCompactSpacing ? 24 : 36;
var listItemHeight = useCompactSpacing ? 28 : 36;
var listItemMargin = useCompactSpacing ? "-2" : "0";
var navigationViewItemOnLeftMinHeight = useCompactSpacing ? 20 : 32;

Application.Current.Resources["ListItemHeight"] = listItemHeight;
Application.Current.Resources["ListItemMargin"] = listItemMargin;
Application.Current.Resources["NavigationViewItemOnLeftMinHeight"] = navigationViewItemOnLeftMinHeight;
}

Expand Down
1 change: 1 addition & 0 deletions src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
<Setter Property="MinHeight" Value="1" />
<Setter Property="Height" Value="{ThemeResource ListItemHeight}" />
<Setter Property="Margin" Value="{ThemeResource ListItemMargin}" />
</Style>
</ListView.ItemContainerStyle>

Expand Down
1 change: 1 addition & 0 deletions src/Files.App/Views/LayoutModes/ColumnViewBase.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="MinHeight" Value="1" />
<Setter Property="Margin" Value="{ThemeResource ListItemMargin}" />
<Setter Property="Height" Value="{ThemeResource ListItemHeight}" />
<Setter Property="Padding" Value="4,0" />
</Style>
Expand Down
1 change: 1 addition & 0 deletions src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,7 @@
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="MinHeight" Value="1" />
<Setter Property="Margin" Value="{ThemeResource ListItemMargin}" />
<Setter Property="Height" Value="{ThemeResource ListItemHeight}" />
</Style>
</ListView.ItemContainerStyle>
Expand Down
7 changes: 0 additions & 7 deletions src/Files.App/Views/Properties/SecurityAdvancedPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,6 @@
<behaviors:StickyHeaderBehavior />
</i:Interaction.Behaviors>

<ListView.ItemContainerStyle>
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
<Setter Property="MinHeight" Value="1" />
<Setter Property="Height" Value="{ThemeResource ListItemHeight}" />
</Style>
</ListView.ItemContainerStyle>

<ListView.Header>
<Grid
x:Name="HeaderGrid"
Expand Down
7 changes: 0 additions & 7 deletions src/Files.App/Views/Properties/SecurityPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,6 @@
SelectedItem="{x:Bind SecurityViewModel.SelectedAccessControlEntry, Mode=TwoWay}"
SelectionMode="Single">

<ListView.ItemContainerStyle>
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
<Setter Property="MinHeight" Value="1" />
<Setter Property="Height" Value="{ThemeResource ListItemHeight}" />
</Style>
</ListView.ItemContainerStyle>

<ListView.ItemTemplate>
<DataTemplate x:DataType="security:AccessControlEntry">
<Grid ColumnSpacing="4">
Expand Down