Skip to content

Commit 7b5b2ff

Browse files
committed
Add Copy Path Command
1 parent 1073288 commit 7b5b2ff

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

Files UWP/GenericFileBrowser.xaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,18 @@
174174
</MenuFlyout.Items>
175175
</MenuFlyout>
176176
</Page.ContextFlyout>
177-
<Grid>
177+
178+
<Grid Name="RootGrid">
179+
<Grid.Resources>
180+
<Flyout x:Key="PathCopiedFlyout" x:Name="CopiedPathFlyout" AreOpenCloseAnimationsEnabled="False" Placement="Bottom">
181+
<Grid>
182+
<StackPanel Spacing="5" Orientation="Horizontal">
183+
<FontIcon Glyph="&#xE73E;"/>
184+
<TextBlock Text="Path copied to clipboard"/>
185+
</StackPanel>
186+
</Grid>
187+
</Flyout>
188+
</Grid.Resources>
178189
<Grid Tag="{x:Bind Tag, Mode=OneWay}" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" Padding="0,0,0,0" VerticalAlignment="Stretch">
179190
<Grid.RowDefinitions>
180191
<RowDefinition Height="35"/>
@@ -252,7 +263,9 @@
252263
<TextBox KeyDown="VisiblePath_TextChanged" Style="{StaticResource TextBoxStyleForPathBar}" BorderThickness="0" x:Name="VisiblePath" Text="{x:Bind local:App.PathText.Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontFamily="Segoe UI Black" FontWeight="Bold" FontSize="32" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" VerticalAlignment="Top" Margin="0,0,0,0" Grid.Row="1" PlaceholderText="Navigate to a path...">
253264
<uilib:TeachingTip.Attach>
254265
<uilib:TeachingTip Name="PathBarTip" BleedingImagePlacement="Bottom" Title="Access a location quickly with the Path Bar">
255-
266+
<uilib:TeachingTip.IconSource>
267+
<uilib:SymbolIconSource Symbol="Help"/>
268+
</uilib:TeachingTip.IconSource>
256269
<uilib:TeachingTip.BleedingImageContent>
257270
<Image Source="/Assets/PathbarTeachingTipVisual.gif"/>
258271
</uilib:TeachingTip.BleedingImageContent>

Files UWP/GenericFileBrowser.xaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public sealed partial class GenericFileBrowser : Page
3939
public static ContentDialog NameBox;
4040
public static TextBox inputFromRename;
4141
public static string inputForRename;
42-
42+
public static Flyout CopiedFlyout;
43+
public static Grid grid;
4344

4445

4546
public GenericFileBrowser()
@@ -71,7 +72,10 @@ public GenericFileBrowser()
7172
emptySpaceContext = EmptySpaceFlyout;
7273
RefreshEmptySpace.Click += NavigationActions.Refresh_Click;
7374
PasteEmptySpace.Click += Interaction.PasteItem_ClickAsync;
74-
//PathBarTip.IsOpen = true;
75+
CopiedFlyout = CopiedPathFlyout;
76+
grid = RootGrid;
77+
GetPath.Click += Interaction.GetPath_Click;
78+
PathBarTip.IsOpen = true;
7579
}
7680

7781

Files UWP/Interacts/Interaction.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using Windows.ApplicationModel;
2020
using System.Collections;
2121
using Windows.Foundation;
22+
using Windows.UI.Xaml.Controls.Primitives;
2223

2324
namespace Files.Interacts
2425
{
@@ -342,6 +343,16 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
342343

343344
}
344345

346+
public static void GetPath_Click(object sender, RoutedEventArgs e)
347+
{
348+
Clipboard.Clear();
349+
DataPackage data = new DataPackage();
350+
data.SetText(App.ViewModel.Universal.path);
351+
Clipboard.SetContent(data);
352+
Clipboard.Flush();
353+
354+
//GenericFileBrowser.CopiedFlyout.ShowAt(GenericFileBrowser.grid as FrameworkElement);
355+
}
345356

346357
public static async Task LaunchExe(string ApplicationPath)
347358
{

0 commit comments

Comments
 (0)