Skip to content

Commit

Permalink
Merge pull request #2484 from Nexus-Mods/fix-library-scrollbar
Browse files Browse the repository at this point in the history
Fixes lack of Library scrolling
  • Loading branch information
Al12rs authored Jan 20, 2025
2 parents ca81f4d + 69b64f8 commit b4b0648
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 100 deletions.
193 changes: 99 additions & 94 deletions src/NexusMods.App.UI/Pages/LibraryPage/LibraryView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="450"
x:Class="NexusMods.App.UI.Pages.LibraryPage.LibraryView">

<Grid RowDefinitions="Auto, Auto" ColumnDefinitions="*">
<Expander x:Name="ExpanderCollections" Grid.Row="0" IsExpanded="True" ExpandDirection="Down" HorizontalAlignment="Stretch">

<Grid RowDefinitions="Auto, *" VerticalAlignment="Top">
<Expander x:Name="ExpanderCollections" Grid.Row="0" IsExpanded="True" ExpandDirection="Down"
HorizontalAlignment="Stretch">
<Expander.Header>
<StackPanel Orientation="Horizontal" Spacing="{StaticResource Spacing-2}" Classes="ExpanderLibraryHeader">
<icons:UnifiedIcon Value="{x:Static icons:IconValues.CollectionsOutline}"/>
<TextBlock Text="Collections"/>
<StackPanel Orientation="Horizontal" Spacing="{StaticResource Spacing-2}"
Classes="ExpanderLibraryHeader">
<icons:UnifiedIcon Value="{x:Static icons:IconValues.Collections}" />
<TextBlock Text="Collections" />
<TextBlock x:Name="TextNumCollections" Text="0" />
</StackPanel>
</Expander.Header>

<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
<ScrollViewer
MaxHeight="350">
<ItemsControl x:Name="Collections">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
Expand All @@ -49,105 +53,106 @@
</ScrollViewer>
</Expander>

<Expander x:Name="ExpanderMods" Grid.Row="1" IsExpanded="True" ExpandDirection="Down" HorizontalAlignment="Stretch">

<Expander x:Name="ExpanderMods" Grid.Row="1" IsExpanded="True" ExpandDirection="Down"
HorizontalAlignment="Stretch">
<Expander.Header>
<StackPanel Orientation="Horizontal" Spacing="{StaticResource Spacing-2}" Classes="ExpanderLibraryHeader">
<icons:UnifiedIcon Value="{x:Static icons:IconValues.Mods}"/>
<TextBlock Text="Mods"/>
<StackPanel Orientation="Horizontal" Spacing="{StaticResource Spacing-2}"
Classes="ExpanderLibraryHeader">
<icons:UnifiedIcon Value="{x:Static icons:IconValues.Mods}" />
<TextBlock Text="Mods" />
<TextBlock x:Name="TextNumMods" Text="0" />
</StackPanel>
</Expander.Header>

<Grid RowDefinitions="Auto, *">
<!-- Toolbar -->
<Border Grid.Row="0" Classes="Toolbar">
<StackPanel Orientation="Horizontal">

<controls:StandardButton x:Name="SwitchView"
Text="{x:Static resources:Language.FileOriginPage_SwitchView}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ToolTip.Tip="{x:Static resources:Language.FileOriginPage_SwitchView_ToolTip}" />
<Line />

<controls:StandardButton x:Name="RemoveModButton"
Text="{x:Static resources:Language.FileOriginPage_DeleteMod}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.DeleteOutline}"
ToolTip.Tip="{x:Static resources:Language.FileOriginPage_DeleteMod_ToolTip}" />

<controls:StandardButton x:Name="AddModButton"
Text="{x:Static resources:Language.FileOriginPage_AddMod}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.PlaylistAdd}"
ToolTip.Tip="{x:Static resources:Language.FileOriginPage_AddMod_ToolTip}" />

<controls:StandardButton x:Name="AddModAdvancedButton"
Text="{x:Static resources:Language.FileOriginPage_AddModAdvanced}"
Type="Tertiary"
Size="Small"
Fill="Weak"
<!-- Empty State -->

<controls:EmptyState x:Name="EmptyState" Grid.Row="1"
Header="{x:Static resources:Language.EmptyLibraryTitleText}">
<controls:EmptyState.Subtitle>
<StackPanel Orientation="Vertical" Spacing="16">
<TextBlock x:Name="EmptyLibraryTextBlock" Text="Subtitle" />
<controls:StandardButton x:Name="EmptyLibraryLinkButton"
Text="Open Nexus Mods"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.PlaylistAdd}"
ToolTip.Tip="{x:Static resources:Language.FileOriginPage_AddModAdvanced_ToolTip}" />

<Line />
LeftIcon="{x:Static icons:IconValues.Nexus}"
HorizontalAlignment="Center" />
</StackPanel>
</controls:EmptyState.Subtitle>

<Grid RowDefinitions="Auto, *">

<!-- Toolbar -->
<Border Grid.Row="0" Classes="Toolbar">
<StackPanel Orientation="Horizontal">

<controls:StandardButton x:Name="SwitchView"
Text="{x:Static resources:Language.FileOriginPage_SwitchView}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ToolTip.Tip="{x:Static resources:Language.FileOriginPage_SwitchView_ToolTip}" />
<Line />

<controls:StandardButton x:Name="RemoveModButton"
Text="{x:Static resources:Language.FileOriginPage_DeleteMod}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.DeleteOutline}"
ToolTip.Tip="{x:Static resources:Language.FileOriginPage_DeleteMod_ToolTip}" />

<controls:StandardButton x:Name="AddModButton"
Text="{x:Static resources:Language.FileOriginPage_AddMod}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.PlaylistAdd}"
ToolTip.Tip="{x:Static resources:Language.FileOriginPage_AddMod_ToolTip}" />

<controls:StandardButton x:Name="AddModAdvancedButton"
Text="{x:Static resources:Language.FileOriginPage_AddModAdvanced}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.PlaylistAdd}"
ToolTip.Tip="{x:Static resources:Language.FileOriginPage_AddModAdvanced_ToolTip}" />

<!-- Get Mods Section -->
<TextBlock Classes="NotTitle" Text="{x:Static resources:Language.FileOriginsPage_GetMods}" />
<Line />

<controls:StandardButton x:Name="GetModsFromDriveButton"
Text="{x:Static resources:Language.FileOriginsPage_FromDrive}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.HardDrive}"
ToolTip.Tip="{x:Static resources:Language.FileOriginsPage_FromDrive_ToolTip}" />

<controls:StandardButton x:Name="GetModsFromNexusButton"
Text="{x:Static resources:Language.FileOriginsPage_FromNexusMods}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.Nexus}"
ToolTip.Tip="{x:Static resources:Language.FileOriginsPage_FromNexus_ToolTip}" />
<!-- Get Mods Section -->
<TextBlock Classes="NotTitle" Text="{x:Static resources:Language.FileOriginsPage_GetMods}" />

</StackPanel>
</Border>

<!-- Empty State -->
<controls:EmptyState x:Name="EmptyState" Grid.Row="1"
Header="{x:Static resources:Language.EmptyLibraryTitleText}">
<controls:EmptyState.Subtitle>
<StackPanel Orientation="Vertical" Spacing="16">
<TextBlock x:Name="EmptyLibraryTextBlock" Text="Subtitle" />
<controls:StandardButton x:Name="EmptyLibraryLinkButton"
Text="Open Nexus Mods"
<controls:StandardButton x:Name="GetModsFromDriveButton"
Text="{x:Static resources:Language.FileOriginsPage_FromDrive}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.HardDrive}"
ToolTip.Tip="{x:Static resources:Language.FileOriginsPage_FromDrive_ToolTip}" />

<controls:StandardButton x:Name="GetModsFromNexusButton"
Text="{x:Static resources:Language.FileOriginsPage_FromNexusMods}"
Type="Tertiary"
Size="Small"
Fill="Weak"
ShowIcon="Left"
LeftIcon="{x:Static icons:IconValues.Nexus}"
HorizontalAlignment="Center" />
ToolTip.Tip="{x:Static resources:Language.FileOriginsPage_FromNexus_ToolTip}" />

</StackPanel>
</controls:EmptyState.Subtitle>

<Grid>
<TreeDataGrid x:Name="TreeDataGrid"
ShowColumnHeaders="True"
CanUserResizeColumns="True"
CanUserSortColumns="True"
HorizontalAlignment="Stretch" />
</Grid>

</controls:EmptyState>
</Grid>
</Border>

<TreeDataGrid Grid.Row="1" x:Name="TreeDataGrid"
ShowColumnHeaders="True"
CanUserResizeColumns="True"
CanUserSortColumns="True"
HorizontalAlignment="Stretch" />
</Grid>
</controls:EmptyState>
</Expander>
</Grid>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,31 @@
- ToggleButton#ExpanderHeader
- Border#ExpanderContent
-->

<Styles.Resources>
<!-- Header -->
<HorizontalAlignment x:Key="ExpanderHeaderHorizontalContentAlignment">Stretch</HorizontalAlignment>
<VerticalAlignment x:Key="ExpanderHeaderVerticalContentAlignment">Center</VerticalAlignment>
<Thickness x:Key="ExpanderHeaderPadding">16,0,0,0</Thickness>
<Thickness x:Key="ExpanderHeaderBorderThickness">0,0,0,1</Thickness>
<Thickness x:Key="ExpanderChevronBorderThickness">0</Thickness>
<Thickness x:Key="ExpanderChevronMargin">20,0,8,0</Thickness>
<x:Double x:Key="ExpanderChevronButtonSize">32</x:Double>
</Styles.Resources>


<Style Selector="Expander">

<Setter Property="Background" Value="{StaticResource SurfaceTransparentBrush}" />
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="CornerRadius" Value="{StaticResource Rounded-none}" />
<Setter Property="Padding" Value="0" />
<Setter Property="BorderThickness" Value="0,0,0,1" />

<Style Selector="^:down /template/ Border#ExpanderContent">
<Setter Property="BorderThickness" Value="0" />
</Style>

<Style Selector="^ StackPanel.ExpanderLibraryHeader">

<!-- <Setter Property="Background" Value="DarkSlateBlue" /> -->

<Style Selector="^ > icons|UnifiedIcon">
<Setter Property="Size" Value="20" />
</Style>
Expand All @@ -75,8 +84,8 @@
<Style Selector="^ /template/ ToggleButton#ExpanderHeader">
<!-- Copied from source -->
<Setter Property="Background" Value="{StaticResource SurfaceMidBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderHeaderBorderBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="{StaticResource BrandTranslucentDark300Brush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderHeaderBorderThickness}" />
<Setter Property="Foreground" Value="{DynamicResource ExpanderHeaderForeground}" />
<Setter Property="Padding" Value="24,0" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
Expand Down

0 comments on commit b4b0648

Please sign in to comment.