Skip to content

Commit

Permalink
Fixed titlebar bug. Added progressring on scan.
Browse files Browse the repository at this point in the history
  • Loading branch information
josephbeattie committed Mar 8, 2022
1 parent bba9f60 commit 514f959
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Rise Media Player Dev/Settings/AllSettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

</StackPanel>

<uc:ExtendedTitleBar Title="App settings" HorizontalAlignment="Stretch" FontSize="14" Margin="54,0,275,0" x:Name="TitleBar" ShowIcon="False" />
<uc:ExtendedTitleBar Title="App settings" HorizontalAlignment="Stretch" FontSize="14" Margin="42,0,275,0" x:Name="TitleBar" ShowIcon="False" />

<Button VerticalAlignment="Top" x:Name="SyncButton"
CornerRadius="5"
Expand Down
5 changes: 3 additions & 2 deletions Rise Media Player Dev/UserControls/ExtendedTitleBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
d:DesignWidth="400"
mc:Ignorable="d">

<Border Background="Transparent" IsHitTestVisible="True">
<Border x:Name="AppTitleBar" x:FieldModifier="public" Background="Transparent" IsHitTestVisible="True">
<StackPanel
x:Name="AppData"
Width="Auto"
Expand All @@ -29,7 +29,8 @@
IsTextSelectionEnabled="False"
VerticalAlignment="Center">
<Paragraph>
<Bold FontWeight="SemiBold">Rise</Bold> Media Player
<Bold FontWeight="Bold">Rise</Bold>
<Bold FontWeight="SemiBold">Media Player</Bold>
</Paragraph>
</RichTextBlock>

Expand Down
6 changes: 5 additions & 1 deletion Rise Media Player Dev/UserControls/ExtendedTitleBar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public sealed partial class ExtendedTitleBar : UserControl
/// <summary>
/// The icon displayed on the titlebar.
/// </summary>
///

public static ExtendedTitleBar Current;

public string Icon
{
get => (string)GetValue(IconProperty);
Expand Down Expand Up @@ -94,7 +98,7 @@ public ExtendedTitleBar()
public void SetupTitleBar()
{
ApplicationViewTitleBar bar = ApplicationView.GetForCurrentView().TitleBar;

Current = this;
bar.ButtonBackgroundColor = Colors.Transparent;
bar.ButtonInactiveBackgroundColor = Colors.Transparent;

Expand Down
4 changes: 3 additions & 1 deletion Rise Media Player Dev/Views/CurrentlyPlayingPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ private void Queue_Click(object sender, RoutedEventArgs e)

private async void Button_Click(object sender, RoutedEventArgs e)
{
MainPage.Current.AppTitleBar.Visibility = Visibility.Visible;
UserControls.ExtendedTitleBar.Current.AppTitleBar.IsHitTestVisible = true;
var preferences = ViewModePreferences.CreateDefault(ApplicationViewMode.CompactOverlay);
preferences.CustomSize = new Size(600, 700);
_ = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default, preferences);
MainPage.Current.AppTitleBar.Visibility = Visibility.Visible;
MainPage.Current.AppTitleBar.SetupTitleBar();
}

}
Expand Down
2 changes: 1 addition & 1 deletion Rise Media Player Dev/Views/FullNowPlayingPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

</StackPanel>

<uc:ExtendedTitleBar x:FieldModifier="public" Title="Now Playing" HorizontalAlignment="Stretch" FontSize="14" Margin="54,0,275,0" x:Name="TitleBar" ShowIcon="False" />
<uc:ExtendedTitleBar x:FieldModifier="public" Title="Now Playing" HorizontalAlignment="Stretch" FontSize="14" Margin="42,0,275,0" x:Name="TitleBar" ShowIcon="False" />

<Button VerticalAlignment="Top" x:Name="PopOutWindow"
CornerRadius="5"
Expand Down
7 changes: 5 additions & 2 deletions Rise Media Player Dev/Windows/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@
ToolTipService.ToolTip="Sync centre"
Style="{StaticResource TransparentButton}">
<Button.Content>
<FontIcon Glyph="&#xE117;" Height="24" />
<StackPanel>
<FontIcon x:Name="OpenSync" Glyph="&#xE117;" Height="24" />
<muxc:ProgressRing x:Name="IsScanning" IsActive="True" Height="20" Width="20" />
</StackPanel>
</Button.Content>
<Button.Flyout>
<Flyout>
Expand Down Expand Up @@ -292,7 +295,7 @@
</Button.Content>

<Button.Flyout>
<MenuFlyout>
<MenuFlyout x:Name="ProfileMenu">
<MenuFlyoutItem x:Uid="/Information/Accounts" FontWeight="SemiBold" FontSize="14" Margin="3" Height="44" x:Name="Acc" Click="Account_Click">
<MenuFlyoutItem.Background>
<ImageBrush ImageSource="/Assets/Unavailable/MissingAccPic.png"/>
Expand Down
6 changes: 6 additions & 0 deletions Rise Media Player Dev/Windows/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public sealed partial class MainPage : Page
public MainPage()
{
InitializeComponent();
var titleBar = ApplicationView.GetForCurrentView().TitleBar;
Current = this;
SDialog.Content = new SettingsPage();
Loaded += MainPage_Loaded;
Expand Down Expand Up @@ -692,7 +693,12 @@ private async void Button_Click(object sender, RoutedEventArgs e)

private async void StartScan_Click(object sender, RoutedEventArgs e)
{
ProfileMenu.Hide();
OpenSync.Visibility = Visibility.Collapsed;
IsScanning.Visibility = Visibility.Visible;
await App.MViewModel.StartFullCrawlAsync();
IsScanning.Visibility = Visibility.Collapsed;
OpenSync.Visibility = Visibility.Visible;
}

private void OpenSettings_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit 514f959

Please sign in to comment.