Skip to content

Commit

Permalink
Miscellaneous UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrabbers committed Mar 3, 2024
1 parent e3f9ed9 commit 9080940
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions BnbnavNetClient/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<Setter Property="Margin" Value="2"/>
<Setter Property="Padding" Value="0"/>
</Style>
<Style Selector=":is(Button).icon PathIcon">
<Setter Property="RenderTransform" Value="scale(0.875)"/>
</Style>
<Style Selector="ComboBox">
<Setter Property="Margin" Value="2"/>
</Style>
Expand Down
13 changes: 9 additions & 4 deletions BnbnavNetClient/Views/MainView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@

<Grid>
<!-- Main UI -->
<Grid RowDefinitions="* Auto Auto Auto">
<Grid Name="MainUiGrid" RowDefinitions="* Auto Auto Auto" Classes="">
<Grid.Styles>
<Style Selector="Grid.blur">
<Setter Property="Effect" Value="blur(5)"/>
</Style>
</Grid.Styles>
<!-- Map -->
<ProgressBar IsIndeterminate="{Binding MapViewModel, Converter={x:Static ObjectConverters.IsNull}}"
IsVisible="{Binding MapViewModel, Converter={x:Static ObjectConverters.IsNull}}" Width="0" />
Expand Down Expand Up @@ -82,8 +87,8 @@
<Button.Flyout>
<Flyout>
<StackPanel>
<ToggleButton Content="{str:Tr Key=FOLLOW_ME}" IsChecked="{Binding FollowMeEnabled}" />
<Button Content="{str:Tr Key=LOG_OUT}" Command="{Binding LogoutPressed}" />
<ToggleButton HorizontalAlignment="Stretch" Content="{str:Tr Key=FOLLOW_ME}" IsChecked="{Binding FollowMeEnabled}" />
<Button HorizontalAlignment="Stretch" Content="{str:Tr Key=LOG_OUT}" Command="{Binding LogoutPressed}" />
</StackPanel>
</Flyout>
</Button.Flyout>
Expand All @@ -102,7 +107,7 @@
<!-- Popup -->
<Grid IsVisible="{Binding Popup, Converter={x:Static ObjectConverters.IsNotNull}}" ColumnDefinitions="15 6* 15"
RowDefinitions="* Auto *" Background="#7f000000">
<Border MaxWidth="400" CornerRadius="3" Grid.Column="1" Grid.Row="1" BoxShadow="0 0 200 0 Black"
<Border MaxWidth="400" CornerRadius="3" Grid.Column="1" Grid.Row="1"
Background="{DynamicResource SystemControlBackgroundAltHighBrush}">
<UserControl Content="{Binding Popup}"/>
</Border>
Expand Down
8 changes: 8 additions & 0 deletions BnbnavNetClient/Views/MainView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public async void ViewLoaded(object sender, RoutedEventArgs e)
MapPanel.Children.Add(new MapView { DataContext = vm.MapViewModel });
WorldSelectComboBox.IsVisible = true;
vm.RaisePropertyChanged(nameof(MainViewModel.PanText));

vm.WhenAnyValue<MainViewModel, ViewModel?>(x => x.Popup).Subscribe(p =>
{
if (p is null)
MainUiGrid.Classes.Clear();
else
MainUiGrid.Classes.Add("blur");
});
}

public async void ColorModeSwitch(object? _, RoutedEventArgs? __)
Expand Down

0 comments on commit 9080940

Please sign in to comment.