Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Fixed bug making gpu usage high. #62

Merged
merged 3 commits into from
Aug 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</Border>
<Border x:Name="activeEntryLoading" Background="#016FB3" CornerRadius="14" HorizontalAlignment="Left" VerticalAlignment="Bottom">
<StackPanel Margin="10,6,12,6" Orientation="Horizontal">
<elements:NanoSpinner HorizontalAlignment="Right" VerticalAlignment="Center" IsLoading="True"/>
<elements:NanoSpinner x:Name="loadingSpinner" HorizontalAlignment="Right" VerticalAlignment="Center" IsLoading="False" d:IsLoading="True"/>
<TextBlock Text="{DynamicResource LibraryTileSyncing}" FontSize="12" FontWeight="Bold" Margin="7,0,0,0" VerticalAlignment="Center" Foreground="White"/>
</StackPanel>
</Border>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public bool IsLoading
isLoading = value;

activeEntryLoading.Visibility = value ? Visibility.Visible : Visibility.Hidden;
loadingSpinner.IsLoading = value;
activeEntryActive.Visibility = value ? Visibility.Hidden : Visibility.Visible;
activeEntryReloadButton.Visibility = value ? Visibility.Hidden : Visibility.Visible;
}
Expand Down
2 changes: 1 addition & 1 deletion AllInOneLauncher/Pages/Subpages/Offline/Offline_News.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<Grid Name="WebView2Grid">
<Wpf:WebView2 x:Name="newsPage" NavigationCompleted="OnNavigationCompleted" DefaultBackgroundColor="Transparent" Visibility="Visible"/>
<Image x:Name="newsPageImage" Stretch="Fill"/>
<Image x:Name="newsPageImage" Stretch="Fill" Visibility="Hidden"/>
<elements:NoConnection x:Name="noConnection" Visibility="Hidden"/>
</Grid>
</UserControl>
9 changes: 5 additions & 4 deletions AllInOneLauncher/Pages/Subpages/Offline/Offline_News.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ public Offline_News()

private void SetNewsVisibility(bool isVisible)
{
if (isVisible && newsPage.Height == 0)
if (isVisible && newsPage.Visibility == System.Windows.Visibility.Hidden)
{
newsPageImage.Visibility = System.Windows.Visibility.Hidden;
newsPage.Height = double.NaN;
newsPage.Visibility = System.Windows.Visibility.Visible;
}
else if (!isVisible && newsPage.Height != 0)
else if (!isVisible && newsPage.Visibility == System.Windows.Visibility.Visible)
{
newsPageImage.Visibility = System.Windows.Visibility.Visible;
newsPage.Height = 0;
newsPage.Visibility = System.Windows.Visibility.Hidden;
}
}

Expand All @@ -56,6 +56,7 @@ public void Load(BfmeGame AvailableBFMEGame)
newsPage.Visibility = System.Windows.Visibility.Visible;
noConnection.Visibility = System.Windows.Visibility.Hidden;

newsPageImage.Source = null;
newsPage.Source = GetNewsPage(AvailableBFMEGame);
}

Expand Down
Loading