Skip to content

Commit

Permalink
Merge pull request #76 from aschuhardt/develop
Browse files Browse the repository at this point in the history
1.4.5 - Fix tabs loaded on startup not being able to show prompts
  • Loading branch information
aschuhardt authored Dec 4, 2023
2 parents a5cb1bb + 9d5873b commit b8a2863
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
12 changes: 12 additions & 0 deletions Controls/TabCollection.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ protected override void OnApplyTemplate()
public event EventHandler BookmarkChanged;

Check warning on line 163 in Controls/TabCollection.xaml.cs

View workflow job for this annotation

GitHub Actions / Android Build

The event 'TabCollection.BookmarkChanged' is never used

Check warning on line 163 in Controls/TabCollection.xaml.cs

View workflow job for this annotation

GitHub Actions / Android Build

The event 'TabCollection.BookmarkChanged' is never used
public event EventHandler SelectedTabChanged;
public event EventHandler ReorderingChanged;
public event EventHandler ParentPageNeeded;

public void SelectTab(Tab tab)
{
Expand All @@ -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;
Expand Down Expand Up @@ -596,4 +603,9 @@ protected virtual void OnReorderingChanged()
{
ReorderingChanged?.Invoke(this, EventArgs.Empty);
}

protected virtual void OnParentPageNeeded()
{
ParentPageNeeded?.Invoke(this, EventArgs.Empty);
}
}
3 changes: 2 additions & 1 deletion Resources/Raw/whats-new.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
margin-top: 0!important;
}
</style>

<h4>Version 1.4.5 - December 3rd, 2023</h4>
<p>Fixed an issue that prevented tabs loaded on startup from showing prompts</p>
<h4>Version 1.4.4 - November 27th, 2023</h4>
<p>Fixed an issue that prevented non-Gemini links from opening correctly</p>
<h4>Version 1.4.3 - November 27th, 2023</h4>
Expand Down
3 changes: 2 additions & 1 deletion Views/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
VerticalOptions="End"
SelectedTabChanged="Tabs_SelectedTabChanged"
ZIndex="10"
IsVisible="{Binding TabsEnabled}" />
IsVisible="{Binding TabsEnabled}"
ParentPageNeeded="TabCollection_OnParentTabNeeded"/>
</AbsoluteLayout>
</ContentPage>
7 changes: 5 additions & 2 deletions Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down Expand Up @@ -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;
}
}

0 comments on commit b8a2863

Please sign in to comment.