Skip to content

Commit

Permalink
Fix page overlay not showing up in deduplicator
Browse files Browse the repository at this point in the history
  • Loading branch information
Guerra24 committed May 1, 2022
1 parent 6f22b5b commit 55e8226
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 128 deletions.
2 changes: 1 addition & 1 deletion LRReader.Avalonia/LRReader.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="Avalonia" Version="0.10.13" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.13" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.13" />
<PackageReference Include="FluentAvaloniaUI" Version="1.3.2" />
<PackageReference Include="FluentAvaloniaUI" Version="1.3.4" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
</ItemGroup>
<ItemGroup>
Expand Down
229 changes: 112 additions & 117 deletions LRReader.Avalonia/Resources/AvaloniaTemplates.axaml

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion LRReader.Avalonia/Views/Controls/CustomTab.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
using Aura.UI.Controls;
using Avalonia;
using Avalonia.Styling;
using FluentAvalonia.UI.Controls;
using LRReader.Shared.Models;
using System;

namespace LRReader.Avalonia
{
public class CustomTab : AuraTabItem, ICustomTab, IStyleable
{
Type IStyleable.StyleKey => typeof(AuraTabItem);
Type IStyleable.StyleKey => typeof(CustomTab);

public Symbol CustomTabIcon
{
get => (Symbol)GetValue(CustomTabIconProperty)!;
set => SetValue(CustomTabIconProperty, value);
}

public object CustomTabControl
{
Expand All @@ -22,6 +29,12 @@ public string CustomTabId
set => SetValue(CustomTabIdProperty, value);
}

public bool CustomTabIsClosable
{
get => (bool)GetValue(CustomTabIsClosableProperty);
set => SetValue(CustomTabIsClosableProperty, value);
}

public virtual void Unload()
{
}
Expand All @@ -33,5 +46,7 @@ public virtual bool BackRequested()

public static readonly AvaloniaProperty<object> CustomTabControlProperty = AvaloniaProperty.Register<CustomTab, object>("CustomTabControl");
public static readonly AvaloniaProperty<string> CustomTabIdProperty = AvaloniaProperty.Register<CustomTab, string>("CustomTabId");
public static readonly AvaloniaProperty<Symbol> CustomTabIconProperty = AvaloniaProperty.Register<CustomTab, Symbol>("CustomTabIcon");
public static readonly AvaloniaProperty<bool> CustomTabIsClosableProperty = AvaloniaProperty.Register<CustomTab, bool>("CustomTabIsClosable", true);
}
}
2 changes: 2 additions & 0 deletions LRReader.Avalonia/Views/Tabs/ArchivesTab.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
x:Class="LRReader.Avalonia.Views.Tabs.ArchivesTab"
Header="{loc:LocalizedString Key=/Tabs/Archives/Tab/Header}"
CustomTabId="Archives"
CustomTabIcon="Library"
CustomTabIsClosable="False"
Height="34">
<content:Archives />
</tabs:CustomTab>
1 change: 0 additions & 1 deletion LRReader.Avalonia/Views/Tabs/Content/Archives.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
x:CompileBindings="True"
x:DataType="vm:ArchivesPageViewModel"
x:Class="LRReader.Avalonia.Views.Tabs.Content.Archives"
Background="{DynamicResource SolidBackgroundFillColorBase}"
DataContext="{ReflectionBinding ArchivesPageInstance, Source={StaticResource Locator}}"
AttachedToVisualTree="Archives_AttachedToVisualTree">

Expand Down
1 change: 1 addition & 0 deletions LRReader.Avalonia/Views/Tabs/SettingsTab.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="LRReader.Avalonia.Views.Tabs.SettingsTab"
CustomTabId="Settings"
CustomTabIcon="Settings"
Header="{loc:LocalizedString Key=/Tabs/Settings/Tab/Header}">

</tabs:CustomTab>
4 changes: 2 additions & 2 deletions LRReader.Shared/LRReader.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.5.0" Condition="'$(TargetFramework)' == 'uap10.0.17763'" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.5.1" Condition="'$(TargetFramework)' == 'uap10.0.17763'" />
<PackageReference Include="Caching.dll" Version="2.0.0.1" />
<PackageReference Include="KeyedSemaphores" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
Expand All @@ -24,7 +24,7 @@
<PackageReference Include="RestSharp" Version="107.3.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="107.3.0" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.1" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions LRReader.Shared/ViewModels/LoadingPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private async Task Connect()
StatusSub = "";
Retry = false;
Active = true;
if (!Api.RefreshSettings(Settings.Profile))
if (!Api.RefreshSettings(Settings.Profile!))
{
Status = Platform.GetLocalizedString("Pages/LoadingPage/InvalidAddress");
StatusSub = Platform.GetLocalizedString("Pages/LoadingPage/InvalidAddressSub");
Expand All @@ -113,7 +113,7 @@ private async Task Connect()
var serverInfo = await ServerProvider.GetServerInfo();
if (serverInfo == null)
{
var address = Settings.Profile.ServerAddress;
var address = Settings.Profile!.ServerAddress;
if (address.Contains("127.0.0.") || address.Contains("localhost"))
{
Status = Platform.GetLocalizedString("Pages/LoadingPage/NoConnectionLocalHost");
Expand Down
6 changes: 3 additions & 3 deletions LRReader.UWP/LRReader.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AppCenter.Crashes">
<Version>4.5.0</Version>
<Version>4.5.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging">
<Version>6.0.0</Version>
Expand All @@ -428,10 +428,10 @@
<Version>7.1.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.8.0-prerelease.220118001</Version>
<Version>2.8.0-prerelease.220413001</Version>
</PackageReference>
<PackageReference Include="Microsoft.Web.WebView2">
<Version>1.0.1150.38</Version>
<Version>1.0.1185.39</Version>
</PackageReference>
<PackageReference Include="NReco.Logging.File">
<Version>1.1.4</Version>
Expand Down
3 changes: 2 additions & 1 deletion LRReader.UWP/Views/Items/ArchiveImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
Root = GetTemplateChild("Root") as Grid;
VisualStateManager.GoToState(this, "Hidden", false);
if (!KeepOverlayOpen)
VisualStateManager.GoToState(this, "Hidden", false);
}

private async void UserControl_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
Expand Down

0 comments on commit 55e8226

Please sign in to comment.