diff options
author | Paul Rouget <me@paulrouget.com> | 2019-12-04 08:08:08 +0100 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2019-12-04 08:09:13 +0100 |
commit | 193113037d49d0de13adc1042a6a65a016a8515b (patch) | |
tree | e481f347c6c9b81a98a27374c475f94f5ebe2de4 | |
parent | 6e3c131139c412031a4d288aa1ffd048ca0311c3 (diff) | |
download | servo-193113037d49d0de13adc1042a6a65a016a8515b.tar.gz servo-193113037d49d0de13adc1042a6a65a016a8515b.zip |
Home button and larger buttons in toolbar
-rw-r--r-- | support/hololens/ServoApp/Assets/UI/home.png | bin | 0 -> 2038 bytes | |||
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.cpp | 6 | ||||
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.h | 2 | ||||
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.xaml | 19 | ||||
-rw-r--r-- | support/hololens/ServoApp/DefaultUrl.h | 2 | ||||
-rw-r--r-- | support/hololens/ServoApp/ServoApp.vcxproj | 1 | ||||
-rw-r--r-- | support/hololens/ServoApp/ServoApp.vcxproj.filters | 3 |
7 files changed, 24 insertions, 9 deletions
diff --git a/support/hololens/ServoApp/Assets/UI/home.png b/support/hololens/ServoApp/Assets/UI/home.png Binary files differnew file mode 100644 index 00000000000..9d7ce16571b --- /dev/null +++ b/support/hololens/ServoApp/Assets/UI/home.png diff --git a/support/hololens/ServoApp/BrowserPage.cpp b/support/hololens/ServoApp/BrowserPage.cpp index 2cf98b7452b..b940d42019c 100644 --- a/support/hololens/ServoApp/BrowserPage.cpp +++ b/support/hololens/ServoApp/BrowserPage.cpp @@ -6,6 +6,7 @@ #include "logs.h" #include "BrowserPage.h" #include "BrowserPage.g.cpp" +#include "DefaultUrl.h" using namespace std::placeholders; using namespace winrt::Windows::Foundation; @@ -127,6 +128,11 @@ void BrowserPage::OnStopButtonClicked(IInspectable const &, servoControl().Stop(); } +void BrowserPage::OnHomeButtonClicked(IInspectable const &, + RoutedEventArgs const &) { + servoControl().LoadURIOrSearch(DEFAULT_URL); +} + void BrowserPage::OnURLEdited(IInspectable const &, Input::KeyRoutedEventArgs const &e) { if (e.Key() == Windows::System::VirtualKey::Enter) { diff --git a/support/hololens/ServoApp/BrowserPage.h b/support/hololens/ServoApp/BrowserPage.h index f4585fd8321..f5fe8b3566b 100644 --- a/support/hololens/ServoApp/BrowserPage.h +++ b/support/hololens/ServoApp/BrowserPage.h @@ -25,6 +25,8 @@ public: Windows::UI::Xaml::RoutedEventArgs const &); void OnStopButtonClicked(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &); + void OnHomeButtonClicked(Windows::Foundation::IInspectable const &, + Windows::UI::Xaml::RoutedEventArgs const &); void OnURLEdited(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::Input::KeyRoutedEventArgs const &); void OnURLFocused(Windows::Foundation::IInspectable const &); diff --git a/support/hololens/ServoApp/BrowserPage.xaml b/support/hololens/ServoApp/BrowserPage.xaml index 9990c0dab6c..c0b2839da7d 100644 --- a/support/hololens/ServoApp/BrowserPage.xaml +++ b/support/hololens/ServoApp/BrowserPage.xaml @@ -14,9 +14,9 @@ <Setter Property="BorderBrush" Value="{ThemeResource ButtonBorderBrush}"/> <Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}"/> <Setter Property="Padding" Value="0"/> - <Setter Property="Margin" Value="10,2"/> - <Setter Property="MinWidth" Value="30"/> - <Setter Property="MinHeight" Value="30"/> + <Setter Property="Margin" Value="5,0"/> + <Setter Property="MinWidth" Value="40"/> + <Setter Property="MinHeight" Value="40"/> <Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> @@ -94,31 +94,34 @@ </Grid.ColumnDefinitions> <StackPanel Orientation="Horizontal" Grid.Column="0"> <Button Style="{StaticResource NavigationBarButton}" x:Name="backButton" IsTabStop="true" IsEnabled="false" Click="OnBackButtonClicked" AutomationProperties.Name="Back" ToolTipService.ToolTip="Back"> - <Image Source="Assets/UI/back.png" Height="12"></Image> + <Image Source="Assets/UI/back.png" Height="18"></Image> <Button.KeyboardAccelerators> <KeyboardAccelerator Key="Left" Modifiers="Menu" /> </Button.KeyboardAccelerators> </Button> <Button Style="{StaticResource NavigationBarButton}" x:Name="forwardButton" IsTabStop="true" IsEnabled="false" Click="OnForwardButtonClicked" AutomationProperties.Name="Forward" ToolTipService.ToolTip="Forward"> - <Image Source="Assets/UI/forward.png" Height="12"></Image> + <Image Source="Assets/UI/forward.png" Height="18"></Image> <Button.KeyboardAccelerators> <KeyboardAccelerator Key="Right" Modifiers="Menu" /> </Button.KeyboardAccelerators> </Button> <Button Style="{StaticResource NavigationBarButton}" x:Name="reloadButton" IsTabStop="true" IsEnabled="false" Visibility="Visible" Click="OnReloadButtonClicked" AutomationProperties.Name="Reload" ToolTipService.ToolTip="Reload"> - <Image Source="Assets/UI/reload.png" Height="12"></Image> + <Image Source="Assets/UI/reload.png" Height="18"></Image> <Button.KeyboardAccelerators> <KeyboardAccelerator Key="R" Modifiers="Control" /> </Button.KeyboardAccelerators> </Button> <Button Style="{StaticResource NavigationBarButton}" x:Name="stopButton" IsTabStop="true" IsEnabled="false" Visibility="Collapsed" Click="OnStopButtonClicked" AutomationProperties.Name="Stop" ToolTipService.ToolTip="Stop"> - <Image Source="Assets/UI/stop.png" Height="12"></Image> + <Image Source="Assets/UI/stop.png" Height="18"></Image> <Button.KeyboardAccelerators> <KeyboardAccelerator Key="Escape" Modifiers="None" /> </Button.KeyboardAccelerators> </Button> + <Button Style="{StaticResource NavigationBarButton}" x:Name="homeButton" IsTabStop="true" Click="OnHomeButtonClicked" AutomationProperties.Name="Home" ToolTipService.ToolTip="Home"> + <Image Source="Assets/UI/home.png" Height="18"></Image> + </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" KeyboardAcceleratorPlacementMode="Hidden"> + <TextBox Text="" IsTabStop="true" InputScope="Url" PlaceholderText="Type a URL" x:Name="urlTextbox" VerticalAlignment="Center" Grid.Column="1" KeyUp="OnURLEdited" IsSpellCheckEnabled="False" Margin="3,0" KeyboardAcceleratorPlacementMode="Hidden"> <TextBox.KeyboardAccelerators> <KeyboardAccelerator Key="L" Modifiers="Control" Invoked="OnURLKeyboardAccelerator"/> </TextBox.KeyboardAccelerators> diff --git a/support/hololens/ServoApp/DefaultUrl.h b/support/hololens/ServoApp/DefaultUrl.h index 3a586fcb4dc..35fbe247930 100644 --- a/support/hololens/ServoApp/DefaultUrl.h +++ b/support/hololens/ServoApp/DefaultUrl.h @@ -1,3 +1,3 @@ #pragma once -#define DEFAULT_URL L"https://servo.org/hl-home/"; +#define DEFAULT_URL L"https://servo.org/hl-home/" diff --git a/support/hololens/ServoApp/ServoApp.vcxproj b/support/hololens/ServoApp/ServoApp.vcxproj index e3869ca1f97..f752011dff0 100644 --- a/support/hololens/ServoApp/ServoApp.vcxproj +++ b/support/hololens/ServoApp/ServoApp.vcxproj @@ -908,6 +908,7 @@ <Image Include="Assets\StoreLogo.scale-400.png" /> <Image Include="Assets\UI\back.png" /> <Image Include="Assets\UI\forward.png" /> + <Image Include="Assets\UI\home.png" /> <Image Include="Assets\UI\reload.png" /> <Image Include="Assets\UI\stop.png" /> <Image Include="Assets\Wide310x150Logo.scale-100.png" /> diff --git a/support/hololens/ServoApp/ServoApp.vcxproj.filters b/support/hololens/ServoApp/ServoApp.vcxproj.filters index 06630e046af..3cf5c9555d5 100644 --- a/support/hololens/ServoApp/ServoApp.vcxproj.filters +++ b/support/hololens/ServoApp/ServoApp.vcxproj.filters @@ -153,6 +153,9 @@ <Image Include="Assets\UI\stop.png"> <Filter>Assets\UI</Filter> </Image> + <Image Include="Assets\UI\home.png"> + <Filter>Assets\UI</Filter> + </Image> </ItemGroup> <ItemGroup> <AppxManifest Include="Package.appxmanifest" /> |