diff --git a/App.xaml.cpp b/App.xaml.cpp index deb390e7fbe8bc4f89ab744374679f798de542a9..c89f42329b27fd3a6d3ce916b1dafcd5d5b366cf 100644 --- a/App.xaml.cpp +++ b/App.xaml.cpp @@ -22,9 +22,11 @@ using namespace Windows::ApplicationModel::Core; using namespace Windows::Foundation; using namespace Windows::Graphics::Display; +using namespace Windows::UI; using namespace Windows::UI::Xaml; using namespace Windows::UI::Xaml::Controls; using namespace Windows::UI::Xaml::Interop; +using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::ViewManagement; using namespace RingClientUWP; @@ -49,4 +51,11 @@ App::OnLaunched(LaunchActivatedEventArgs^ e) Window::Current->Activate(); } else rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); + + CoreApplication::GetCurrentView()->TitleBar->ExtendViewIntoTitleBar = true; + ApplicationView::GetForCurrentView()->TitleBar->ButtonBackgroundColor = Colors::LightBlue; + ApplicationView::GetForCurrentView()->TitleBar->ButtonInactiveBackgroundColor = Colors::LightBlue; + ApplicationView::GetForCurrentView()->TitleBar->ForegroundColor = Colors::White; + ApplicationView::GetForCurrentView()->TitleBar->ButtonForegroundColor = Colors::White; + } \ No newline at end of file diff --git a/MainPage.xaml b/MainPage.xaml index 199583c61f4d3727f12e04ddb2a5fa6bba425d6b..7f30376e44138b05339defb6137eb5cc568a4e5d 100644 --- a/MainPage.xaml +++ b/MainPage.xaml @@ -23,8 +23,33 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - <SplitView x:Name="_outerSplitView_" - IsPaneOpen="False"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="32"/> + <RowDefinition Height="*"/> + </Grid.RowDefinitions> + <Grid Canvas.ZIndex="2" Grid.Row="0" Background="LightBlue"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="50"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + <!-- hamburger button. --> + <Button x:Name="_toggleSmartBoxButton_" + Grid.Row="0" + Content="" + Click="_toggleSmartBoxButton__Click" + HorizontalAlignment="Center" + Style="{StaticResource ButtonStyle2}"/> + <!-- _titleBar_ is used to move the window. --> + <Rectangle x:Name="_titleBar_" + Grid.Column="1" + Height="32" + VerticalAlignment="Top" + Fill="Transparent"/> + </Grid> + <SplitView x:Name="_outerSplitView_" + Grid.Row="1" + IsPaneOpen="False"> <SplitView.Pane> <Frame x:Name="_consolePanel_"/> </SplitView.Pane> @@ -48,4 +73,5 @@ </SplitView> </SplitView.Content> </SplitView> + </Grid> </Page> diff --git a/MainPage.xaml.cpp b/MainPage.xaml.cpp index 73165dc1220e5d637b9dbeb43f0f686c5da36a65..2cc2fd3ce916c73adde299c841ba8604b78c4e44 100644 --- a/MainPage.xaml.cpp +++ b/MainPage.xaml.cpp @@ -27,6 +27,7 @@ using namespace RingClientUWP; using namespace RingClientUWP::Views; using namespace Platform; +using namespace Windows::ApplicationModel::Core; using namespace Windows::Foundation; using namespace Windows::Foundation::Collections; using namespace Windows::UI::ViewManagement; @@ -37,7 +38,6 @@ using namespace Windows::UI::Core; using namespace Windows::UI::Xaml::Data; using namespace Windows::UI::Xaml::Input; using namespace Windows::UI::Xaml::Interop; -using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; using namespace Windows::ApplicationModel::Activation; using namespace Windows::Graphics::Display; @@ -47,6 +47,8 @@ MainPage::MainPage() { InitializeComponent(); + Window::Current->SetTitleBar(_titleBar_); + _welcomeFrame_->Navigate(TypeName(RingClientUWP::Views::WelcomePage::typeid)); _smartPanel_->Navigate(TypeName(RingClientUWP::Views::SmartPanel::typeid)); _consolePanel_->Navigate(TypeName(RingClientUWP::Views::RingConsolePanel::typeid)); @@ -59,4 +61,9 @@ MainPage::OnKeyDown(KeyRoutedEventArgs^ e) _outerSplitView_->OpenPaneLength = Window::Current->Bounds.Width; _outerSplitView_->IsPaneOpen = !_outerSplitView_->IsPaneOpen; } -} \ No newline at end of file +} + +void RingClientUWP::MainPage::_toggleSmartBoxButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) +{ + _innerSplitView_->IsPaneOpen = !_innerSplitView_->IsPaneOpen; +} diff --git a/MainPage.xaml.h b/MainPage.xaml.h index 0d04df24aa2fbc3cd6acdc9e500eb5ab409ca31f..868add8f38d8df6aa19306e426fb4c32a1da56e4 100644 --- a/MainPage.xaml.h +++ b/MainPage.xaml.h @@ -31,5 +31,7 @@ public: protected: virtual void OnKeyDown(KeyRoutedEventArgs^ e) override; +private: + void _toggleSmartBoxButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); }; } \ No newline at end of file diff --git a/Styles.xaml b/Styles.xaml index c3719da5d186245d4d05b6ee7d51899b876f7333..ba4e5cdd86ae607ab9658d8357e13dfb7da39c34 100644 --- a/Styles.xaml +++ b/Styles.xaml @@ -27,7 +27,30 @@ <Setter Property="Foreground" Value="Black"/> </Style> - + <Style x:Key="ButtonStyle1" + TargetType="Button"> + <Setter Property="Width" + Value="50"/> + <Setter Property="Height" + Value="50"/> + <Setter Property="FontFamily" + Value="Segoe MDL2 Assets"/> + <Setter Property="Foreground" + Value="White"/> + </Style> + <Style x:Key="ButtonStyle2" + TargetType="Button"> + <Setter Property="Width" + Value="50"/> + <Setter Property="Height" + Value="30"/> + <Setter Property="FontFamily" + Value="Segoe MDL2 Assets"/> + <Setter Property="Foreground" + Value="White"/> + <Setter Property="Background" + Value="Transparent"/> + </Style> <!-- styles for the console --> <Style x:Key="ConsoleScrollViewerStyle" TargetType="ScrollViewer">