Skip to content

Commit

Permalink
Code Quality: Fixed issue where run settings were shown for folders
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 committed Jan 12, 2025
1 parent 9d88cf5 commit 306be87
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 4 additions & 1 deletion src/Files.App/Views/Properties/ShortcutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@
Text="{x:Bind ViewModel.ShortcutItemWorkingDirEditedValue, Mode=TwoWay}" />
</Grid>

<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=StartWindow}" HorizontalAlignment="Stretch">
<settingsuc:SettingsBlockControl
Title="{helpers:ResourceString Name=StartWindow}"
HorizontalAlignment="Stretch"
x:Load="{x:Bind ViewModel.ShortcutItemWindowArgsVisibility, Mode=OneWay}">
<ComboBox ItemsSource="{x:Bind ViewModel.ShowWindowCommandTypes.Values, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.SelectedShowWindowCommand, Mode=TwoWay}" />
</settingsuc:SettingsBlockControl>

Expand Down

0 comments on commit 306be87

Please sign in to comment.