From 76de3cb9a6dd9db117f205d80d8855420ebc11a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klenovszky=20=C3=81ron?= Date: Tue, 1 Aug 2023 18:38:14 +0200 Subject: [PATCH 01/12] Larger rename text box in list wiew --- .../Views/LayoutModes/GridViewBrowser.xaml | 7 ++++ .../Views/LayoutModes/GridViewBrowser.xaml.cs | 36 +++++++++++++++---- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index 7c913af3ecc1..6936c7857b04 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -247,6 +247,7 @@ () is null) { - textBlock.Visibility = Visibility.Visible; + textBlockName.Visibility = Visibility.Visible; + textBlockFormat.Visibility = Visibility.Visible; + textBlockSize.Visibility = Visibility.Visible; textBox.Visibility = Visibility.Collapsed; + gridMain.ColumnDefinitions[0].Width = GridLength.Auto; + gridMain.ColumnDefinitions[1].Width = new GridLength(64); return; } } @@ -247,9 +261,17 @@ protected override void EndRename(TextBox textBox) } else if (FolderSettings.LayoutMode == FolderLayoutModes.TilesView) { - TextBlock? textBlock = gridViewItem.FindDescendant("ItemName") as TextBlock; + TextBlock? textBlockName = gridViewItem.FindDescendant("ItemName") as TextBlock; + TextBlock? textBlockFormat = gridViewItem.FindDescendant("ItemFileFormat") as TextBlock; + TextBlock? textBlockSize = gridViewItem.FindDescendant("ItemSize") as TextBlock; + Grid? gridMain = gridViewItem.FindDescendant("MainGrid") as Grid; + textBox.Visibility = Visibility.Collapsed; - textBlock!.Visibility = Visibility.Visible; + textBlockName!.Visibility = Visibility.Visible; + textBlockFormat!.Visibility = Visibility.Visible; + textBlockSize!.Visibility = Visibility.Visible; + gridMain.ColumnDefinitions[0].Width = GridLength.Auto; + gridMain.ColumnDefinitions[1].Width = new GridLength(64); } textBox!.LostFocus -= RenameTextBox_LostFocus; From 92ac7cf5a5b10c90eca53f2d5d733925593c7f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klenovszky=20=C3=81ron?= Date: Wed, 2 Aug 2023 14:39:10 +0200 Subject: [PATCH 02/12] Biger textbox in GridView, del padding --- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml | 3 +-- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index 6936c7857b04..b611e1c00020 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -402,8 +402,7 @@ Date: Wed, 2 Aug 2023 14:50:12 +0200 Subject: [PATCH 03/12] Formatting --- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index b611e1c00020..7fb043d5470c 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -402,13 +402,13 @@ Date: Tue, 1 Aug 2023 18:38:14 +0200 Subject: [PATCH 04/12] Larger rename text box in list wiew --- .../Views/LayoutModes/GridViewBrowser.xaml | 7 ++++ .../Views/LayoutModes/GridViewBrowser.xaml.cs | 36 +++++++++++++++---- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index 7c3adadd35d1..6bd69c27c272 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -247,6 +247,7 @@ () is null) { - textBlock.Visibility = Visibility.Visible; + textBlockName.Visibility = Visibility.Visible; + textBlockFormat.Visibility = Visibility.Visible; + textBlockSize.Visibility = Visibility.Visible; textBox.Visibility = Visibility.Collapsed; + gridMain.ColumnDefinitions[0].Width = GridLength.Auto; + gridMain.ColumnDefinitions[1].Width = new GridLength(64); return; } } @@ -247,9 +261,17 @@ protected override void EndRename(TextBox textBox) } else if (FolderSettings.LayoutMode == FolderLayoutModes.TilesView) { - TextBlock? textBlock = gridViewItem.FindDescendant("ItemName") as TextBlock; + TextBlock? textBlockName = gridViewItem.FindDescendant("ItemName") as TextBlock; + TextBlock? textBlockFormat = gridViewItem.FindDescendant("ItemFileFormat") as TextBlock; + TextBlock? textBlockSize = gridViewItem.FindDescendant("ItemSize") as TextBlock; + Grid? gridMain = gridViewItem.FindDescendant("MainGrid") as Grid; + textBox.Visibility = Visibility.Collapsed; - textBlock!.Visibility = Visibility.Visible; + textBlockName!.Visibility = Visibility.Visible; + textBlockFormat!.Visibility = Visibility.Visible; + textBlockSize!.Visibility = Visibility.Visible; + gridMain.ColumnDefinitions[0].Width = GridLength.Auto; + gridMain.ColumnDefinitions[1].Width = new GridLength(64); } textBox!.LostFocus -= RenameTextBox_LostFocus; From 4c2c8d9412f345aafcd2f44386c9c769dda07121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klenovszky=20=C3=81ron?= Date: Wed, 2 Aug 2023 14:39:10 +0200 Subject: [PATCH 05/12] Biger textbox in GridView, del padding --- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml | 3 +-- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index 6bd69c27c272..87b276f50ab8 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -402,8 +402,7 @@ Date: Wed, 2 Aug 2023 14:50:12 +0200 Subject: [PATCH 06/12] Formatting --- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index 87b276f50ab8..9793b8066efc 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -402,13 +402,13 @@ Date: Mon, 7 Aug 2023 11:22:16 +0200 Subject: [PATCH 07/12] Simpler code, deleting unnecessary names, and visibility changes --- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml | 4 ++-- .../Views/LayoutModes/GridViewBrowser.xaml.cs | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index 9793b8066efc..5c3fcf9da85c 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -403,16 +403,17 @@ () is null) { textBlockName.Visibility = Visibility.Visible; - textBlockFormat.Visibility = Visibility.Visible; - textBlockSize.Visibility = Visibility.Visible; textBox.Visibility = Visibility.Collapsed; gridMain.ColumnDefinitions[0].Width = GridLength.Auto; gridMain.ColumnDefinitions[1].Width = new GridLength(64); @@ -268,14 +261,10 @@ protected override void EndRename(TextBox textBox) else if (FolderSettings.LayoutMode == FolderLayoutModes.TilesView) { TextBlock? textBlockName = gridViewItem.FindDescendant("ItemName") as TextBlock; - TextBlock? textBlockFormat = gridViewItem.FindDescendant("ItemFileFormat") as TextBlock; - TextBlock? textBlockSize = gridViewItem.FindDescendant("ItemSize") as TextBlock; Grid? gridMain = gridViewItem.FindDescendant("MainGrid") as Grid; textBox.Visibility = Visibility.Collapsed; textBlockName!.Visibility = Visibility.Visible; - textBlockFormat!.Visibility = Visibility.Visible; - textBlockSize!.Visibility = Visibility.Visible; gridMain.ColumnDefinitions[0].Width = GridLength.Auto; gridMain.ColumnDefinitions[1].Width = new GridLength(64); } From 1c757b2ac9dcf569f84f4648fc79f6231db807c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klenovszky=20=C3=81ron?= Date: Mon, 7 Aug 2023 11:45:49 +0200 Subject: [PATCH 08/12] Revert name changes --- .../Views/LayoutModes/GridViewBrowser.xaml.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs index b2fe52bb8741..7aed15e3172b 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs @@ -194,21 +194,21 @@ override public void StartRenameItem() } else { - TextBlock textBlockName = gridViewItem.FindDescendant("ItemName") as TextBlock; + TextBlock textBlock = gridViewItem.FindDescendant("ItemName") as TextBlock; textBox = gridViewItem.FindDescendant("TileViewTextBoxItemName") as TextBox; Grid gridMain = gridViewItem.FindDescendant("MainGrid") as Grid; - textBox.Text = textBlockName.Text; - OldItemName = textBlockName.Text; + textBox.Text = textBlock.Text; + OldItemName = textBlock.Text; - textBlockName.Visibility = Visibility.Collapsed; + textBlock.Visibility = Visibility.Collapsed; textBox.Visibility = Visibility.Visible; gridMain.ColumnDefinitions[0].Width = new GridLength(0); gridMain.ColumnDefinitions[1].Width = new GridLength(0); if (textBox.FindParent() is null) { - textBlockName.Visibility = Visibility.Visible; + textBlock.Visibility = Visibility.Visible; textBox.Visibility = Visibility.Collapsed; gridMain.ColumnDefinitions[0].Width = GridLength.Auto; gridMain.ColumnDefinitions[1].Width = new GridLength(64); @@ -260,11 +260,11 @@ protected override void EndRename(TextBox textBox) } else if (FolderSettings.LayoutMode == FolderLayoutModes.TilesView) { - TextBlock? textBlockName = gridViewItem.FindDescendant("ItemName") as TextBlock; + TextBlock? textBlock = gridViewItem.FindDescendant("ItemName") as TextBlock; Grid? gridMain = gridViewItem.FindDescendant("MainGrid") as Grid; textBox.Visibility = Visibility.Collapsed; - textBlockName!.Visibility = Visibility.Visible; + textBlock!.Visibility = Visibility.Visible; gridMain.ColumnDefinitions[0].Width = GridLength.Auto; gridMain.ColumnDefinitions[1].Width = new GridLength(64); } From 0e3ec36a8b870c62c670b6dc29a60a7ce5a38cc3 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Thu, 21 Sep 2023 16:01:24 -0400 Subject: [PATCH 09/12] Update GridViewBrowser.xaml.cs --- .../Views/LayoutModes/GridViewBrowser.xaml.cs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs index c076a351cca0..16c280b79793 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs @@ -183,35 +183,25 @@ override public void StartRenameItem() { Popup popup = gridViewItem.FindDescendant("EditPopup") as Popup; TextBlock textBlock = gridViewItem.FindDescendant("ItemName") as TextBlock; - Grid gridMain = gridViewItem.FindDescendant("GridViewBrowserListedItem") as Grid; - textBox = popup.Child as TextBox; textBox.Text = textBlock.Text; textBlock.Opacity = 0; popup.IsOpen = true; OldItemName = textBlock.Text; - gridMain.RowDefinitions[0].Height = new GridLength(0); } else { TextBlock textBlock = gridViewItem.FindDescendant("ItemName") as TextBlock; textBox = gridViewItem.FindDescendant("TileViewTextBoxItemName") as TextBox; - Grid gridMain = gridViewItem.FindDescendant("MainGrid") as Grid; - textBox.Text = textBlock.Text; OldItemName = textBlock.Text; - textBlock.Visibility = Visibility.Collapsed; textBox.Visibility = Visibility.Visible; - gridMain.ColumnDefinitions[0].Width = new GridLength(0); - gridMain.ColumnDefinitions[1].Width = new GridLength(0); if (textBox.FindParent() is null) { textBlock.Visibility = Visibility.Visible; textBox.Visibility = Visibility.Collapsed; - gridMain.ColumnDefinitions[0].Width = GridLength.Auto; - gridMain.ColumnDefinitions[1].Width = new GridLength(64); return; } } @@ -252,21 +242,14 @@ protected override void EndRename(TextBox textBox) { Popup? popup = gridViewItem.FindDescendant("EditPopup") as Popup; TextBlock? textBlock = gridViewItem.FindDescendant("ItemName") as TextBlock; - Grid? gridMain = gridViewItem.FindDescendant("GridViewBrowserListedItem") as Grid; - popup!.IsOpen = false; textBlock!.Opacity = (textBlock.DataContext as ListedItem)!.Opacity; - gridMain.RowDefinitions[0].Height = GridLength.Auto; } else if (FolderSettings.LayoutMode == FolderLayoutModes.TilesView) { TextBlock? textBlock = gridViewItem.FindDescendant("ItemName") as TextBlock; - Grid? gridMain = gridViewItem.FindDescendant("MainGrid") as Grid; - textBox.Visibility = Visibility.Collapsed; textBlock!.Visibility = Visibility.Visible; - gridMain.ColumnDefinitions[0].Width = GridLength.Auto; - gridMain.ColumnDefinitions[1].Width = new GridLength(64); } textBox!.LostFocus -= RenameTextBox_LostFocus; @@ -548,4 +531,4 @@ private void UpdateCheckboxVisibility(object sender, bool isPointerOver) } } -} +} \ No newline at end of file From 8146b8c5317ef4a292352d23fb25e2fd413ba09c Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Thu, 21 Sep 2023 16:08:38 -0400 Subject: [PATCH 10/12] Cleanup xaml --- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml | 2 +- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index b43d73bda123..04b4f57ef156 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -407,7 +407,7 @@ Grid.Row="0" Grid.RowSpan="3" MaxHeight="60" - HorizontalAlignment="Left" + HorizontalAlignment="Stretch" BeforeTextChanging="ItemNameTextBox_BeforeTextChanging" Canvas.ZIndex="1" ScrollViewer.VerticalScrollBarVisibility="Auto" diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs index 16c280b79793..9b741eae5277 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs @@ -2,8 +2,6 @@ // Licensed under the MIT License. See the LICENSE. using CommunityToolkit.WinUI.UI; -using Files.App.Data.Commands; -using Files.App.Data.EventArguments; using Files.App.UserControls.Selection; using Microsoft.UI.Input; using Microsoft.UI.Xaml; From 879bab80bacda92fadc7229009792f4a1d824e5e Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Thu, 21 Sep 2023 16:09:02 -0400 Subject: [PATCH 11/12] Update GridViewBrowser.xaml --- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index 04b4f57ef156..95735a5c8efd 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -248,7 +248,6 @@ Date: Thu, 21 Sep 2023 16:09:58 -0400 Subject: [PATCH 12/12] Update GridViewBrowser.xaml --- src/Files.App/Views/LayoutModes/GridViewBrowser.xaml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index 95735a5c8efd..71c6778a9cf0 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -409,7 +409,6 @@ HorizontalAlignment="Stretch" BeforeTextChanging="ItemNameTextBox_BeforeTextChanging" Canvas.ZIndex="1" - ScrollViewer.VerticalScrollBarVisibility="Auto" Text="{x:Bind Name, Mode=OneWay}" TextWrapping="Wrap" Visibility="Collapsed" />