Skip to content

Commit fc7ed31

Browse files
Use reference when editing
1 parent 1296b0e commit fc7ed31

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

Flow.Launcher.Infrastructure/UserSettings/CustomShortcutModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public BuiltinShortcutModel(string key, string description, Func<string> expand)
5959
{
6060
Key = key;
6161
Description = description;
62-
Expand = expand ?? (() => { return Key; });
62+
Expand = expand ?? (() => { return ""; });
6363
}
6464
}
6565
}

Flow.Launcher/CustomShortcutSetting.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
LastChildFill="True">
118118
<Button
119119
x:Name="btnTestShortcut"
120+
Margin="0,0,10,0"
120121
Padding="10,5,10,5"
121122
Click="BtnTestShortcut_OnClick"
122123
Content="{DynamicResource preview}"

Flow.Launcher/SettingWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,6 +2520,7 @@
25202520
Text="{DynamicResource customQueryShortcut}" />
25212521
<ListView
25222522
Grid.Row="7"
2523+
Name="customShortcutView"
25232524
MinHeight="160"
25242525
Margin="0,6,0,0"
25252526
Background="{DynamicResource Color02B}"

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,9 @@ private void OnEditCustomShortCutClick(object sender, RoutedEventArgs e)
421421
var shortcutSettingWindow = new CustomShortcutSetting(item, settings);
422422
if (shortcutSettingWindow.ShowDialog() == true)
423423
{
424-
settings.CustomShortcuts.Remove(item);
425-
settings.CustomShortcuts.Add(shortcutSettingWindow.ShortCut);
424+
item.Key = shortcutSettingWindow.Key;
425+
item.Value = shortcutSettingWindow.Value;
426+
customShortcutView.Items.Refresh();
426427
}
427428
}
428429

0 commit comments

Comments
 (0)