Skip to content

Commit 30a2160

Browse files
committed
Code Quality: Fixed issue where run settings were shown for folders
1 parent 9d88cf5 commit 30a2160

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs

+7
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,13 @@ public bool ShortcutItemArgumentsVisibility
635635
get => shortcutItemArgumentsVisibility;
636636
set => SetProperty(ref shortcutItemArgumentsVisibility, value);
637637
}
638+
639+
private bool shortcutItemWindowArgsVisibility = false;
640+
public bool ShortcutItemWindowArgsVisibility
641+
{
642+
get => shortcutItemWindowArgsVisibility;
643+
set => SetProperty(ref shortcutItemWindowArgsVisibility, value);
644+
}
638645

639646
private RelayCommand shortcutItemOpenLinkCommand;
640647
public RelayCommand ShortcutItemOpenLinkCommand

src/Files.App/ViewModels/Properties/Items/FileProperties.cs

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public override void GetBaseProperties()
6767
ViewModel.ShortcutItemArguments = shortcutItem.Arguments;
6868
ViewModel.ShowWindowCommand = shortcutItem.ShowWindowCommand;
6969
ViewModel.ShortcutItemArgumentsVisibility = Item.IsLinkItem || shortcutItem.IsSymLink ? false : true;
70+
ViewModel.ShortcutItemWindowArgsVisibility = Item.IsLinkItem || shortcutItem.IsSymLink ? false : true;
7071

7172
if (isApplication)
7273
ViewModel.RunAsAdmin = shortcutItem.RunAsAdmin;

src/Files.App/ViewModels/Properties/Items/FolderProperties.cs

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public override void GetBaseProperties()
5959
ViewModel.ShortcutItemWorkingDirVisibility = false;
6060
ViewModel.ShortcutItemArguments = shortcutItem.Arguments;
6161
ViewModel.ShortcutItemArgumentsVisibility = false;
62+
ViewModel.ShortcutItemWindowArgsVisibility = false;
6263
ViewModel.ShortcutItemOpenLinkCommand = new RelayCommand(async () =>
6364
{
6465
await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(

src/Files.App/Views/Properties/ShortcutPage.xaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@
137137
Text="{x:Bind ViewModel.ShortcutItemWorkingDirEditedValue, Mode=TwoWay}" />
138138
</Grid>
139139

140-
<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=StartWindow}" HorizontalAlignment="Stretch">
140+
<settingsuc:SettingsBlockControl
141+
x:Name="WindowArgsSetting"
142+
Title="{helpers:ResourceString Name=StartWindow}"
143+
HorizontalAlignment="Stretch"
144+
x:Load="{x:Bind ViewModel.ShortcutItemWindowArgsVisibility, Mode=OneWay}">
141145
<ComboBox ItemsSource="{x:Bind ViewModel.ShowWindowCommandTypes.Values, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.SelectedShowWindowCommand, Mode=TwoWay}" />
142146
</settingsuc:SettingsBlockControl>
143147

0 commit comments

Comments
 (0)