Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixed issue where Git buttons were incorrectly shown in the status bar #12703

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Files.App/UserControls/StatusBarControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
x:Name="GitActionsPanel"
Grid.Column="1"
VerticalAlignment="Center"
x:Load="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay, Converter={StaticResource NullToFalseConverter}}"
x:Load="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}"
Orientation="Horizontal"
Spacing="4">

Expand Down Expand Up @@ -214,7 +214,7 @@
Background="Transparent"
BorderBrush="Transparent"
ToolTipService.ToolTip="{helpers:ResourceString Name=ManageBranches}"
Visibility="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay, Converter={StaticResource NullToVisibilityCollapsedConverter}}">
Visibility="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay, Converter={StaticResource NullToVisibilityCollapsedConverter}, FallbackValue=Collapsed}">

<Button.Content>
<StackPanel Orientation="Horizontal" Spacing="8">
Expand Down
5 changes: 4 additions & 1 deletion src/Files.App/UserControls/StatusBarControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public sealed partial class StatusBarControl : UserControl
{
public ICommandManager Commands { get; } = Ioc.Default.GetRequiredService<ICommandManager>();

public DirectoryPropertiesViewModel DirectoryPropertiesViewModel
public DirectoryPropertiesViewModel? DirectoryPropertiesViewModel
{
get => (DirectoryPropertiesViewModel)GetValue(DirectoryPropertiesViewModelProperty);
set => SetValue(DirectoryPropertiesViewModelProperty, value);
Expand Down Expand Up @@ -47,6 +47,9 @@ public StatusBarControl()

private void BranchesFlyout_Opening(object sender, object e)
{
if (DirectoryPropertiesViewModel is null)
return;

DirectoryPropertiesViewModel.ShowLocals = true;
DirectoryPropertiesViewModel.SelectedBranchIndex = DirectoryPropertiesViewModel.ACTIVE_BRANCH_INDEX;
}
Expand Down