From 7648a785e9b4dfc5279fd403e444d6369361454d Mon Sep 17 00:00:00 2001 From: Addison Schuhardt Date: Sun, 3 Dec 2023 23:23:57 -0800 Subject: [PATCH 1/2] ensure that the tab collection has a reference to MainPage when it actually needs it rather than much later --- Controls/TabCollection.xaml.cs | 12 ++++++++++++ Views/MainPage.xaml | 3 ++- Views/MainPage.xaml.cs | 7 +++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Controls/TabCollection.xaml.cs b/Controls/TabCollection.xaml.cs index 44fa15b..2381515 100644 --- a/Controls/TabCollection.xaml.cs +++ b/Controls/TabCollection.xaml.cs @@ -163,6 +163,7 @@ protected override void OnApplyTemplate() public event EventHandler BookmarkChanged; public event EventHandler SelectedTabChanged; public event EventHandler ReorderingChanged; + public event EventHandler ParentPageNeeded; public void SelectTab(Tab tab) { @@ -189,6 +190,12 @@ public void SelectTab(Tab tab) private void SetupTab(Tab tab) { + // if the parent page hasn't been assigned yet, then have MainPage set it for us; + // this is necessary for the tab views to display prompts, etc. but this method is + // called too early in startup for the value to have been properly set yet + if (ParentPage == null) + OnParentPageNeeded(); + tab.ParentPage = ParentPage; tab.OpeningUrlInNewTab += (_, arg) => AddTab(arg.Uri); tab.InitializedByTabCollection = true; @@ -596,4 +603,9 @@ protected virtual void OnReorderingChanged() { ReorderingChanged?.Invoke(this, EventArgs.Empty); } + + protected virtual void OnParentPageNeeded() + { + ParentPageNeeded?.Invoke(this, EventArgs.Empty); + } } \ No newline at end of file diff --git a/Views/MainPage.xaml b/Views/MainPage.xaml index 0e68fa4..88eaadf 100644 --- a/Views/MainPage.xaml +++ b/Views/MainPage.xaml @@ -161,6 +161,7 @@ VerticalOptions="End" SelectedTabChanged="Tabs_SelectedTabChanged" ZIndex="10" - IsVisible="{Binding TabsEnabled}" /> + IsVisible="{Binding TabsEnabled}" + ParentPageNeeded="TabCollection_OnParentTabNeeded"/> diff --git a/Views/MainPage.xaml.cs b/Views/MainPage.xaml.cs index 8925c7c..726fe1f 100644 --- a/Views/MainPage.xaml.cs +++ b/Views/MainPage.xaml.cs @@ -771,8 +771,6 @@ private async void MainPage_OnLoaded(object sender, EventArgs e) { AddMenuAnimations(); - TabCollection.ParentPage = this; - if (!TabCollection.Tabs.Any()) { if (!string.IsNullOrWhiteSpace(_settingsDatabase.LastVisitedUrl) && @@ -849,4 +847,9 @@ private void Tabs_SelectedTabChanged(object sender, EventArgs e) if (CurrentTab?.AfterSelected?.CanExecute(null) ?? false) CurrentTab.AfterSelected.Execute(null); } + + private void TabCollection_OnParentTabNeeded(object sender, EventArgs e) + { + TabCollection.ParentPage = this; + } } \ No newline at end of file From 9d5873b99d6baa06c7994c55b33f38def8bd34b4 Mon Sep 17 00:00:00 2001 From: Addison Schuhardt Date: Sun, 3 Dec 2023 23:25:33 -0800 Subject: [PATCH 2/2] updating whats-new --- Resources/Raw/whats-new.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Resources/Raw/whats-new.html b/Resources/Raw/whats-new.html index a9564e7..53b912d 100644 --- a/Resources/Raw/whats-new.html +++ b/Resources/Raw/whats-new.html @@ -9,7 +9,8 @@ margin-top: 0!important; } - +

Version 1.4.5 - December 3rd, 2023

+

Fixed an issue that prevented tabs loaded on startup from showing prompts

Version 1.4.4 - November 27th, 2023

Fixed an issue that prevented non-Gemini links from opening correctly

Version 1.4.3 - November 27th, 2023