diff options
author | Paul Rouget <me@paulrouget.com> | 2019-10-29 08:25:50 +0100 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2019-10-29 08:25:50 +0100 |
commit | 50929d7992692364f9c9bcdf60ce75a240c3b60c (patch) | |
tree | c0c2aabcc4e997cc55edc860cddec04edece4733 | |
parent | f78ca5794a905dca45f479ac5bca6975b93b64ab (diff) | |
download | servo-50929d7992692364f9c9bcdf60ce75a240c3b60c.tar.gz servo-50929d7992692364f9c9bcdf60ce75a240c3b60c.zip |
Add a loading indicator in transient mode
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.cpp | 9 | ||||
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.xaml | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/support/hololens/ServoApp/BrowserPage.cpp b/support/hololens/ServoApp/BrowserPage.cpp index 558b403a43d..61341dfcc29 100644 --- a/support/hololens/ServoApp/BrowserPage.cpp +++ b/support/hololens/ServoApp/BrowserPage.cpp @@ -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); } diff --git a/support/hololens/ServoApp/BrowserPage.xaml b/support/hololens/ServoApp/BrowserPage.xaml index 5255b3a4ab5..386a20accac 100644 --- a/support/hololens/ServoApp/BrowserPage.xaml +++ b/support/hololens/ServoApp/BrowserPage.xaml @@ -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> |