Skip to content

Commit

Permalink
Auto merge of #24577 - paulrouget:transientThrobber, r=jdm
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
bors-servo committed Oct 30, 2019
2 parents c918b72 + 50929d7 commit de9c84f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions support/hololens/ServoApp/BrowserPage.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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); }
Expand Down
4 changes: 3 additions & 1 deletion support/hololens/ServoApp/BrowserPage.xaml
Expand Up @@ -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>
Expand All @@ -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>

0 comments on commit de9c84f

Please sign in to comment.