@@ -29,6 +29,7 @@ private void RootGrid_PointerEntered(object sender, PointerRoutedEventArgs e)
29
29
{
30
30
VisualStateManager . GoToState ( ( UserControl ) sender , PointerOverState , true ) ;
31
31
32
+ // Make edit button visible on pointer in
32
33
if ( sender is UserControl userControl &&
33
34
userControl . FindChild ( PART_EditButton ) is Button editButton &&
34
35
userControl . DataContext is ModifiableCommandHotKeyItem item &&
@@ -40,6 +41,7 @@ private void RootGrid_PointerExited(object sender, PointerRoutedEventArgs e)
40
41
{
41
42
VisualStateManager . GoToState ( ( UserControl ) sender , NormalState , true ) ;
42
43
44
+ // Make edit button invisible on pointer out
43
45
if ( sender is UserControl userControl &&
44
46
userControl . FindChild ( PART_EditButton ) is Button editButton &&
45
47
userControl . DataContext is ModifiableCommandHotKeyItem item &&
@@ -51,7 +53,7 @@ private void EditButton_Click(object sender, RoutedEventArgs e)
51
53
{
52
54
if ( sender is Button button && button . DataContext is ModifiableCommandHotKeyItem item )
53
55
{
54
- // Hide the add-new section grid
56
+ // Hide the add command grid
55
57
ViewModel . ShowAddNewShortcutGrid = false ;
56
58
57
59
// Reset the selected item's info
@@ -61,14 +63,14 @@ private void EditButton_Click(object sender, RoutedEventArgs e)
61
63
ViewModel . SelectedNewShortcutItem = null ;
62
64
}
63
65
64
- // Reset edit mode for each item
66
+ // Reset edit mode of every item
65
67
foreach ( var hotkey in ViewModel . ValidKeyboardShortcuts )
66
68
{
67
69
hotkey . IsEditMode = false ;
68
70
hotkey . HotKeyText = hotkey . HotKey . LocalizedLabel ;
69
71
}
70
72
71
- // Enter edit mode
73
+ // Enter edit mode for the item
72
74
item . IsEditMode = true ;
73
75
}
74
76
}
@@ -107,9 +109,9 @@ GeneralSettingsService.Actions is not null
107
109
var newHotKey = HotKey . Parse ( item . HotKeyText ) ;
108
110
var modifiedCollection = HotKeyCollection . Empty ;
109
111
110
- if ( ! item . IsCustomized )
112
+ if ( item . IsDefaultKey )
111
113
{
112
- // The first time to customize
114
+ // The first time to customize in the user setting
113
115
if ( string . IsNullOrEmpty ( storedKeys ) )
114
116
{
115
117
// Replace with new one
@@ -140,7 +142,7 @@ GeneralSettingsService.Actions is not null
140
142
foreach ( var action in ViewModel . ValidKeyboardShortcuts )
141
143
{
142
144
if ( action . CommandCode == item . CommandCode )
143
- action . IsCustomized = ! item . DefaultHotKeyCollection . Contains ( action . HotKey ) ;
145
+ action . IsDefaultKey = item . DefaultHotKeyCollection . Contains ( action . HotKey ) ;
144
146
}
145
147
146
148
// Exit edit mode
@@ -175,7 +177,7 @@ GeneralSettingsService.Actions is not null
175
177
foreach ( var action in ViewModel . ValidKeyboardShortcuts )
176
178
{
177
179
if ( action . CommandCode == item . CommandCode )
178
- action . IsCustomized = ! item . DefaultHotKeyCollection . Contains ( action . HotKey ) ;
180
+ action . IsDefaultKey = item . DefaultHotKeyCollection . Contains ( action . HotKey ) ;
179
181
}
180
182
181
183
// Exit edit mode
@@ -209,10 +211,9 @@ GeneralSettingsService.Actions is not null
209
211
// Initialize
210
212
var modifiedCollection = HotKeyCollection . Empty ;
211
213
212
- // The first time to customize
213
- if ( ! item . IsCustomized )
214
+ if ( item . IsDefaultKey )
214
215
{
215
- // The first time to customize
216
+ // The first time to customize in the user setting
216
217
if ( string . IsNullOrEmpty ( storedKeys ) )
217
218
{
218
219
// Replace with new one
0 commit comments