From 30a21606cad01b310a83d737595c56b407a8041c Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Sun, 12 Jan 2025 11:14:46 -0500 Subject: [PATCH] Code Quality: Fixed issue where run settings were shown for folders --- .../Data/Models/SelectedItemsPropertiesViewModel.cs | 7 +++++++ .../ViewModels/Properties/Items/FileProperties.cs | 1 + .../ViewModels/Properties/Items/FolderProperties.cs | 1 + src/Files.App/Views/Properties/ShortcutPage.xaml | 6 +++++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs b/src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs index ef7a7e7ea9d9..a89c7113a4a1 100644 --- a/src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs +++ b/src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs @@ -635,6 +635,13 @@ public bool ShortcutItemArgumentsVisibility get => shortcutItemArgumentsVisibility; set => SetProperty(ref shortcutItemArgumentsVisibility, value); } + + private bool shortcutItemWindowArgsVisibility = false; + public bool ShortcutItemWindowArgsVisibility + { + get => shortcutItemWindowArgsVisibility; + set => SetProperty(ref shortcutItemWindowArgsVisibility, value); + } private RelayCommand shortcutItemOpenLinkCommand; public RelayCommand ShortcutItemOpenLinkCommand diff --git a/src/Files.App/ViewModels/Properties/Items/FileProperties.cs b/src/Files.App/ViewModels/Properties/Items/FileProperties.cs index 914f794b00f4..d0de82a45d27 100644 --- a/src/Files.App/ViewModels/Properties/Items/FileProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/FileProperties.cs @@ -67,6 +67,7 @@ public override void GetBaseProperties() ViewModel.ShortcutItemArguments = shortcutItem.Arguments; ViewModel.ShowWindowCommand = shortcutItem.ShowWindowCommand; ViewModel.ShortcutItemArgumentsVisibility = Item.IsLinkItem || shortcutItem.IsSymLink ? false : true; + ViewModel.ShortcutItemWindowArgsVisibility = Item.IsLinkItem || shortcutItem.IsSymLink ? false : true; if (isApplication) ViewModel.RunAsAdmin = shortcutItem.RunAsAdmin; diff --git a/src/Files.App/ViewModels/Properties/Items/FolderProperties.cs b/src/Files.App/ViewModels/Properties/Items/FolderProperties.cs index f9992d79e2b5..0dd47ef2610a 100644 --- a/src/Files.App/ViewModels/Properties/Items/FolderProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/FolderProperties.cs @@ -59,6 +59,7 @@ public override void GetBaseProperties() ViewModel.ShortcutItemWorkingDirVisibility = false; ViewModel.ShortcutItemArguments = shortcutItem.Arguments; ViewModel.ShortcutItemArgumentsVisibility = false; + ViewModel.ShortcutItemWindowArgsVisibility = false; ViewModel.ShortcutItemOpenLinkCommand = new RelayCommand(async () => { await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync( diff --git a/src/Files.App/Views/Properties/ShortcutPage.xaml b/src/Files.App/Views/Properties/ShortcutPage.xaml index 7af26b51d0b2..d32cded4812c 100644 --- a/src/Files.App/Views/Properties/ShortcutPage.xaml +++ b/src/Files.App/Views/Properties/ShortcutPage.xaml @@ -137,7 +137,11 @@ Text="{x:Bind ViewModel.ShortcutItemWorkingDirEditedValue, Mode=TwoWay}" /> - +