UI: return to vanilla title bar and bind hamburger button
- removes the custom title bar area
- makes the hamburger toggle the smartpanel correctly
Change-Id: I0692581924529dba7c4db3cec6feca115008d066
Tuleap: #1002
diff --git a/App.xaml.cpp b/App.xaml.cpp
index e3f6a8d..7239a55 100644
--- a/App.xaml.cpp
+++ b/App.xaml.cpp
@@ -53,9 +53,10 @@
} else
rootFrame->Navigate(TypeName(Views::LoadingPage::typeid), e->Arguments);
- CoreApplication::GetCurrentView()->TitleBar->ExtendViewIntoTitleBar = true;
ApplicationView::GetForCurrentView()->TitleBar->ButtonBackgroundColor = Colors::LightBlue;
+ ApplicationView::GetForCurrentView()->TitleBar->InactiveBackgroundColor = Colors::LightBlue;
ApplicationView::GetForCurrentView()->TitleBar->ButtonInactiveBackgroundColor = Colors::LightBlue;
+ ApplicationView::GetForCurrentView()->TitleBar->BackgroundColor = 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 718f292..ba9061d 100644
--- a/MainPage.xaml
+++ b/MainPage.xaml
@@ -28,10 +28,14 @@
<RowDefinition Height="32"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
- <Grid Canvas.ZIndex="2" Grid.Row="0" Background="LightBlue">
+ <Grid x:Name="_hamburgerButtonBar_"
+ Canvas.ZIndex="2"
+ Grid.Row="0"
+ Background="LightBlue"
+ Width="320"
+ HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="50"/>
- <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<!-- hamburger button. -->
<Button x:Name="_toggleSmartBoxButton_"
@@ -39,13 +43,7 @@
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"/>
+ Style="{StaticResource HamburgerButtonStyle}"/>
</Grid>
<SplitView x:Name="_outerSplitView_"
Grid.Row="1"
diff --git a/MainPage.xaml.cpp b/MainPage.xaml.cpp
index aa7c13d..d6b4bb9 100644
--- a/MainPage.xaml.cpp
+++ b/MainPage.xaml.cpp
@@ -51,8 +51,6 @@
{
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));
@@ -80,6 +78,14 @@
void RingClientUWP::MainPage::_toggleSmartBoxButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
_innerSplitView_->IsPaneOpen = !_innerSplitView_->IsPaneOpen;
+ if (_innerSplitView_->IsPaneOpen) {
+ dynamic_cast<SmartPanel^>(_smartPanel_->Content)->setMode(Views::SmartPanel::Mode::Normal);
+ _hamburgerButtonBar_->Width = 320;
+ }
+ else {
+ dynamic_cast<SmartPanel^>(_smartPanel_->Content)->setMode(Views::SmartPanel::Mode::Minimized);
+ _hamburgerButtonBar_->Width = 60;
+ }
}
void
diff --git a/SmartPanel.xaml.h b/SmartPanel.xaml.h
index 4cd1268..29e6a56 100644
--- a/SmartPanel.xaml.h
+++ b/SmartPanel.xaml.h
@@ -25,7 +25,6 @@
delegate void SumonMessageTextPage();
delegate void SumonVideoPage();
-
namespace Views
{
public ref class SmartPanel sealed
diff --git a/Styles.xaml b/Styles.xaml
index 3a87cd9..f512b97 100644
--- a/Styles.xaml
+++ b/Styles.xaml
@@ -80,6 +80,19 @@
<Setter Property="Foreground"
Value="White"/>
</Style>
+ <Style x:Key="HamburgerButtonStyle"
+ 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>
<Style x:Key="ButtonStyle2"
TargetType="Button">
<Setter Property="Width"