Skip to content
Permalink
Browse files

Home button and larger buttons in toolbar

  • Loading branch information
paulrouget committed Dec 4, 2019
1 parent 6e3c131 commit 193113037d49d0de13adc1042a6a65a016a8515b
Binary file not shown.
@@ -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) {
@@ -25,6 +25,8 @@ struct BrowserPage : BrowserPageT<BrowserPage> {
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 &);
@@ -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>
@@ -1,3 +1,3 @@
#pragma once

#define DEFAULT_URL L"https://servo.org/hl-home/";
#define DEFAULT_URL L"https://servo.org/hl-home/"
@@ -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" />
@@ -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" />

0 comments on commit 1931130

Please sign in to comment.
You can’t perform that action at this time.