Skip to content

Commit

Permalink
Merge pull request #2299 from Nexus-Mods/fix-collection-scrolling-bug
Browse files Browse the repository at this point in the history
Fixed scrolling in collection download view
  • Loading branch information
Al12rs authored Nov 26, 2024
2 parents f48b4c1 + 1d84e92 commit 17c2d09
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,29 @@
</MenuFlyout>
</reactiveUi:ReactiveUserControl.Resources>

<StackPanel x:Name="Body">
<DockPanel x:Name="Body">

<!-- first row (header) -->
<Border x:Name="HeaderBorderBackground">
<Border x:Name="HeaderBorderBackground" DockPanel.Dock="Top">
<Border x:Name="HeaderBorder">

<StackPanel x:Name="Header">

<!-- first header row (image and metadata) -->
<Border x:Name="MainContentBorder">
<Grid x:Name="MainContent" ColumnDefinitions="Auto, *" >
<Grid x:Name="MainContent" ColumnDefinitions="Auto, *">

<!-- left column (image) -->
<Border Grid.Column="0" x:Name="CollectionImageBorder">
<Image x:Name="CollectionImage" />
</Border>

<!-- right column (metadata) -->
<Grid Grid.Column="1" x:Name="CollectionDetails" RowDefinitions="Auto,Auto,Auto,*" ColumnDefinitions="Auto">
<Grid Grid.Column="1" x:Name="CollectionDetails" RowDefinitions="Auto,Auto,Auto,*"
ColumnDefinitions="Auto">
<TextBlock Grid.Row="0" x:Name="Title">COLLECTION DOWNLOAD</TextBlock>
<TextBlock Grid.Row="1" x:Name="Heading" />
<Border Grid.Row="2" x:Name="TagsPanelBorder">
<TextBlock Grid.Row="1" x:Name="Heading" />
<Border Grid.Row="2" x:Name="TagsPanelBorder">
<StackPanel x:Name="TagsPanel">
<TextBlock x:Name="Revision" />
<StackPanel x:Name="AuthorStackPanel">
Expand All @@ -80,7 +81,7 @@
</StackPanel>
</StackPanel>
</Border>
<TextBlock Grid.Row="3" x:Name="Summary" />
<TextBlock Grid.Row="3" x:Name="Summary" />
</Grid>

</Grid>
Expand All @@ -106,7 +107,8 @@
<TextBlock x:Name="TotalSize" />
</StackPanel>
<StackPanel x:Name="OverallRatingPanel">
<icons:UnifiedIcon x:Name="OverallRatingIcon" Value="{x:Static icons:IconValues.CheckCircle}" />
<icons:UnifiedIcon x:Name="OverallRatingIcon"
Value="{x:Static icons:IconValues.CheckCircle}" />
<TextBlock x:Name="OverallRating" />
</StackPanel>
</StackPanel>
Expand All @@ -116,12 +118,13 @@
</Border>

<!-- second row (buttons) -->
<Border x:Name="ListHeaderRowBorder">
<Border x:Name="ListHeaderRowBorder" DockPanel.Dock="Top">
<panels:FlexPanel x:Name="ListHeaderRow">
<TextBlock x:Name="CollectionStatusText"/>
<TextBlock x:Name="CollectionStatusText" />
<controls:StandardButton x:Name="InstallButton" Text="Install" />
<controls:StandardButton x:Name="DownloadAllButton" Text="Download All"/>
<controls:StandardButton x:Name="FlyoutMenuButton" Flyout="{StaticResource CollectionMenuFlyout}" Text="..."/>
<controls:StandardButton x:Name="DownloadAllButton" Text="Download All" />
<controls:StandardButton x:Name="FlyoutMenuButton" Flyout="{StaticResource CollectionMenuFlyout}"
Text="..." />
</panels:FlexPanel>
</Border>

Expand All @@ -136,7 +139,6 @@
</Border>
</StackPanel>
</TabItem.Header>

<TreeDataGrid x:Name="RequiredDownloadsTree" />
</TabItem>
<TabItem x:Name="OptionalTab">
Expand All @@ -151,7 +153,6 @@
<TreeDataGrid x:Name="OptionalDownloadsTree" />
</TabItem>
</TabControl>

</StackPanel>
</DockPanel>

</reactiveUi:ReactiveUserControl>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
xmlns:panels="clr-namespace:Avalonia.Labs.Panels;assembly=Avalonia.Labs.Panels"
xmlns:collections="clr-namespace:NexusMods.App.UI.Pages.CollectionDownload;assembly=NexusMods.App.UI"
xmlns:icons="clr-namespace:NexusMods.Icons;assembly=NexusMods.Icons">

<Design.PreviewWith>
<Border Width="500" Height="500">
<Border Width="800" Height="500">
<Border.Resources>
<collections:CollectionDownloadDesignViewModel x:Key="CollectionDownloadPageDesignViewModel" />
</Border.Resources>
Expand All @@ -21,27 +22,19 @@
</LinearGradientBrush>
</Style.Resources>

<Style Selector="^ StackPanel#Body">
<Setter Property="Orientation" Value="Vertical" />

<Style Selector="^ DockPanel#Body">
<Style Selector="^ Border#HeaderBorderBackground">

<Style Selector="^ Border#HeaderBorder">
<!-- <Setter Property="MaxWidth" Value="628" /> -->
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Padding" Value="24,24,24,16" />
<Setter Property="Background" Value="{StaticResource HeaderImageLinearGradientBrush}" />


<Style Selector="^ StackPanel#Header">
<!-- -->
<!-- <Setter Property="HorizontalAlignment" Value="Left"/> -->

<!-- NOTE(insomnious): Some weird stuff happening here with max width and backgrounds. Layout wise

<!-- NOTE(insomnious): Some weird stuff happening here with max width and backgrounds. Layout wise
it's working, as things are aligned correctly, but the background is not being applied correctly.
After chatting with @Al12rs, we are leaving this for now as we can't fully test this (yet) and we
don't want to add extra layout code for no reason -->


<Style Selector="^ StackPanel#Header">
<Style Selector="^ Border#MainContentBorder">
<!-- <Setter Property="Background" Value="DarkGoldenrod" /> -->
<Setter Property="Padding" Value="0, 0, 0, 24" />
Expand Down Expand Up @@ -133,7 +126,7 @@
Value="{StaticResource NeutralTranslucentSubduedBrush}" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
</Style>
</Style>

</Style>

Expand Down

0 comments on commit 17c2d09

Please sign in to comment.