From 646681936627efac0280bf0a90228a73b38c95c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20B=C3=A1lint=20Hunor?= Date: Thu, 15 Oct 2026 14:45:51 +0300 Subject: [PATCH] Fix: Fixed an issue where renaming in the Cards layout showed a black box Keep the rename editor in the filename header instead of stretching it across every detail row. Size the header to its content so the editor and file type fit while retaining the existing text-control theme resources. Apply inline rename colours before making the editor visible. Co-Authored-By: OpenAI Codex --- .../Views/Layouts/GridLayoutPage.xaml | 87 +++++++++---------- .../Views/Layouts/GridLayoutPage.xaml.cs | 5 +- 2 files changed, 44 insertions(+), 48 deletions(-) diff --git a/src/Files.App/Views/Layouts/GridLayoutPage.xaml b/src/Files.App/Views/Layouts/GridLayoutPage.xaml index 20125d9820cd..ea4059f7e061 100644 --- a/src/Files.App/Views/Layouts/GridLayoutPage.xaml +++ b/src/Files.App/Views/Layouts/GridLayoutPage.xaml @@ -557,29 +557,54 @@ Height="{Binding ElementName=PageRoot, Path=CardsViewDetailsBoxHeight, Mode=OneWay}" Padding="12,4,12,4"> - - - - + - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - diff --git a/src/Files.App/Views/Layouts/GridLayoutPage.xaml.cs b/src/Files.App/Views/Layouts/GridLayoutPage.xaml.cs index ac2be4a9efad..d2497ccb921b 100644 --- a/src/Files.App/Views/Layouts/GridLayoutPage.xaml.cs +++ b/src/Files.App/Views/Layouts/GridLayoutPage.xaml.cs @@ -648,7 +648,6 @@ override public void StartRenameItem() textBox.Text = editText; OldItemName = editText; textBlock.Visibility = Visibility.Collapsed; - textBox.Visibility = Visibility.Visible; if (textBox.FindParent() is null) { @@ -666,18 +665,20 @@ override public void StartRenameItem() textBox.Text = editText; OldItemName = editText; - textBox.Visibility = Visibility.Visible; if (textBox.FindParent() is null) { textBox.Visibility = Visibility.Collapsed; return; } + + textBlock.Visibility = Visibility.Collapsed; } var activeTextBox = textBox ?? throw new InvalidOperationException("The rename text box is not available for the selected layout."); ApplyRenameBoxColors(activeTextBox); + activeTextBox.Visibility = Visibility.Visible; activeTextBox.Focus(FocusState.Pointer); activeTextBox.LostFocus += RenameTextBox_LostFocus; activeTextBox.KeyDown += RenameTextBox_KeyDown;