Auto merge of #24577 - paulrouget:transientThrobber, r=jdm

Add a loading indicator in transient mode

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24549 (GitHub issue number if applicable)
This commit is contained in:
bors-servo 2019-10-30 01:37:07 -04:00 committed by GitHub
commit de9c84f686
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -28,14 +28,17 @@ void BrowserPage::BindServoEvents() {
forwardButton().IsEnabled(forward);
});
servoControl().OnLoadStarted([=] {
throbber().IsActive(true);
urlbarLoadingIndicator().IsActive(true);
transientLoadingIndicator().IsIndeterminate(true);
reloadButton().IsEnabled(false);
reloadButton().Visibility(Visibility::Collapsed);
stopButton().IsEnabled(true);
stopButton().Visibility(Visibility::Visible);
});
servoControl().OnLoadEnded([=] {
throbber().IsActive(false);
urlbarLoadingIndicator().IsActive(false);
transientLoadingIndicator().IsIndeterminate(false);
reloadButton().IsEnabled(true);
reloadButton().Visibility(Visibility::Visible);
stopButton().IsEnabled(false);
@ -65,6 +68,8 @@ void BrowserPage::SetTransientMode(bool transient) {
servoControl().SetTransientMode(transient);
navigationBar().Visibility(transient ? Visibility::Collapsed
: Visibility::Visible);
transientLoadingIndicator().Visibility(transient ? Visibility::Visible
: Visibility::Collapsed);
}
void BrowserPage::SetArgs(hstring args) { servoControl().SetArgs(args); }

View file

@ -83,6 +83,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" x:Name="navigationBar" Background="{ThemeResource InkToolbarButtonBackgroundThemeBrush}">
<Grid.ColumnDefinitions>
@ -105,8 +106,9 @@
</Button>
</StackPanel>
<TextBox Text="" IsTabStop="true" InputScope="Url" PlaceholderText="Type a URL" x:Name="urlTextbox" Grid.Column="1" KeyUp="OnURLEdited" IsSpellCheckEnabled="False" Margin="3,0"/>
<ProgressRing x:Name="throbber" Grid.Column="2" Margin="10,0"/>
<ProgressRing x:Name="urlbarLoadingIndicator" Grid.Column="2" Margin="10,0"/>
</Grid>
<local:ServoControl TabIndex="0" x:Name="servoControl" Grid.Row="1"/>
<ProgressBar x:Name="transientLoadingIndicator" Visibility="Collapsed" Grid.Row="2"/>
</Grid>
</Page>