Skip to content

Commit f6e2fe3

Browse files
Reset message when got focus
1 parent 0c58c2b commit f6e2fe3

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Flow.Launcher/HotkeyControl.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
Margin="0,0,18,0"
4949
VerticalContentAlignment="Center"
5050
input:InputMethod.IsInputMethodEnabled="False"
51+
GotFocus="tbHotkey_GotFocus"
5152
LostFocus="tbHotkey_LostFocus"
5253
PreviewKeyDown="TbHotkey_OnPreviewKeyDown"
5354
TabIndex="100" />

Flow.Launcher/HotkeyControl.xaml.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ namespace Flow.Launcher
1414
{
1515
public partial class HotkeyControl : UserControl
1616
{
17-
private Brush tbMsgForegroundColorOriginal;
18-
19-
private string tbMsgTextOriginal;
20-
2117
public HotkeyModel CurrentHotkey { get; private set; }
2218
public bool CurrentHotkeyAvailable { get; private set; }
2319

@@ -28,8 +24,6 @@ public partial class HotkeyControl : UserControl
2824
public HotkeyControl()
2925
{
3026
InitializeComponent();
31-
tbMsgTextOriginal = tbMsg.Text;
32-
tbMsgForegroundColorOriginal = tbMsg.Foreground;
3327
}
3428

3529
private CancellationTokenSource hotkeyUpdateSource;
@@ -110,7 +104,17 @@ public Task SetHotkeyAsync(string keyStr, bool triggerValidate = true)
110104

111105
private void tbHotkey_LostFocus(object sender, RoutedEventArgs e)
112106
{
113-
tbMsg.Text = tbMsgTextOriginal;
107+
108+
}
109+
110+
private void tbHotkey_GotFocus(object sender, RoutedEventArgs e)
111+
{
112+
ResetMessage();
113+
}
114+
115+
private void ResetMessage()
116+
{
117+
tbMsg.Text = InternationalizationManager.Instance.GetTranslation("flowlauncherPressHotkey");
114118
tbMsg.SetResourceReference(TextBox.ForegroundProperty, "Color05B");
115119
}
116120
}

0 commit comments

Comments
 (0)