Skip to content

Commit 4a92b04

Browse files
committed
Branches flyout
1 parent e6eec4f commit 4a92b04

File tree

3 files changed

+47
-19
lines changed

3 files changed

+47
-19
lines changed

src/Files.App/Strings/en-US/Resources.resw

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3278,9 +3278,12 @@
32783278
<value>Switch Branch</value>
32793279
</data>
32803280
<data name="Branches" xml:space="preserve">
3281-
<value>Branches:</value>
3281+
<value>Branches</value>
32823282
</data>
32833283
<data name="Switch" xml:space="preserve">
32843284
<value>Switch</value>
32853285
</data>
3286+
<data name="NewBranch" xml:space="preserve">
3287+
<value>New branch</value>
3288+
</data>
32863289
</root>

src/Files.App/UserControls/StatusBarControl.xaml

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,51 @@
6262
Content="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay}">
6363
<Button.Flyout>
6464
<Flyout Opening="Flyout_Opening">
65-
<Flyout.FlyoutPresenterStyle>
66-
<Style TargetType="FlyoutPresenter">
67-
<Setter Property="Padding" Value="8" />
68-
<Setter Property="CornerRadius" Value="{StaticResource OverlayCornerRadius}" />
69-
</Style>
70-
</Flyout.FlyoutPresenterStyle>
71-
<StackPanel
72-
Width="200"
73-
Height="200"
74-
LostFocus="StackPanel_LostFocus"
75-
Spacing="8">
76-
<TextBlock
77-
Margin="16,0,0,0"
78-
FontWeight="Bold"
79-
Text="{helpers:ResourceString Name=Branches}" />
65+
<Grid
66+
x:Name="BranchesGrid"
67+
Width="300"
68+
Height="340"
69+
Margin="-16"
70+
LostFocus="BranchesGrid_LostFocus">
71+
<Grid.RowDefinitions>
72+
<RowDefinition Height="Auto" />
73+
<RowDefinition Height="*" />
74+
</Grid.RowDefinitions>
75+
76+
<!-- Header -->
77+
<Grid
78+
Grid.Row="0"
79+
Padding="12"
80+
Background="{ThemeResource AcrylicBackgroundFillColorDefaultBrush}"
81+
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
82+
BorderThickness="0,0,0,1">
83+
<!-- Title -->
84+
<TextBlock
85+
VerticalAlignment="Center"
86+
FontSize="14"
87+
Text="{helpers:ResourceString Name=Branches}" />
88+
89+
<!-- New Branch Button -->
90+
<Button
91+
x:Name="NewBranchButton"
92+
Height="24"
93+
Padding="8,0"
94+
HorizontalAlignment="Right"
95+
x:Load="False"
96+
Content="{helpers:ResourceString Name=NewBranch}"
97+
FontSize="12"
98+
ToolTipService.ToolTip="{helpers:ResourceString Name=NewBranch}" />
99+
</Grid>
100+
101+
<!-- Branches List -->
80102
<ListView
103+
Grid.Row="1"
104+
Padding="4"
105+
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
81106
ItemsSource="{x:Bind DirectoryPropertiesViewModel.BranchesNames, Mode=OneWay}"
82107
SelectedIndex="{x:Bind DirectoryPropertiesViewModel.SelectedBranchIndex, Mode=TwoWay}"
83108
SelectionMode="Single" />
84-
</StackPanel>
109+
</Grid>
85110
</Flyout>
86111
</Button.Flyout>
87112
</Button>

src/Files.App/UserControls/StatusBarControl.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ private void Flyout_Opening(object sender, object e)
4949
DirectoryPropertiesViewModel.SelectedBranchIndex = DirectoryPropertiesViewModel.ActiveBranchIndex;
5050
}
5151

52-
private void StackPanel_LostFocus(object sender, RoutedEventArgs e)
52+
private void BranchesGrid_LostFocus(object sender, RoutedEventArgs e)
5353
{
54-
((Popup)((FlyoutPresenter)((StackPanel)sender).Parent).Parent).IsOpen = false;
54+
((Popup)((FlyoutPresenter)((Grid)sender).Parent).Parent).IsOpen = false;
5555
}
5656
}
5757
}

0 commit comments

Comments
 (0)