Skip to content

Commit 6b4ec12

Browse files
committed
UX improuvment
1 parent da684f6 commit 6b4ec12

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

GUI/WPF/MainWindow.xaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
ResizeMode="CanMinimize"
1313
WindowStartupLocation="CenterScreen"
1414
Height="140" Width="500">
15+
<Window.CommandBindings>
16+
<CommandBinding Command="Open" Executed="_openDatabase_MenuItem_Click"/>
17+
<CommandBinding Command="New" Executed="_newUser_MenuItem_Click"/>
18+
</Window.CommandBindings>
19+
<Window.InputBindings>
20+
<KeyBinding Key="O" Modifiers="Control" Command="Open"/>
21+
<KeyBinding Key="N" Modifiers="Control" Command="New"/>
22+
</Window.InputBindings>
1523
<StackPanel>
1624
<Menu>
1725
<Menu.ItemsPanel>
@@ -20,8 +28,12 @@
2028
</ItemsPanelTemplate>
2129
</Menu.ItemsPanel>
2230
<MenuItem Header="_Open database"
31+
Command="Open"
32+
InputGestureText="Ctrl+O"
2333
Click="_openDatabase_MenuItem_Click"/>
2434
<MenuItem Header="_New User"
35+
Command="New"
36+
InputGestureText="Ctrl+N"
2537
Click="_newUser_MenuItem_Click"/>
2638
<MenuItem Header="_Generate random Password"
2739
HorizontalAlignment="Right"

GUI/WPF/Views/UserSettingsView.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
<StackPanel>
4444
<StackPanel Orientation="Horizontal">
4545
<Label>Username :</Label>
46-
<TextBox Width="400"
46+
<TextBox Name="_username_TB"
47+
Width="400"
4748
Text="{Binding Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
4849
</StackPanel>
4950
<Controls:UserPasswordsContainer x:Name="_passwordsContainer"/>

GUI/WPF/Views/UserSettingsView.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public UserSettingsView()
3939
MainViewModel.Database.DatabaseClosed += _database_DatabaseClosed;
4040
}
4141

42+
_username_TB.SelectAll();
43+
_ = _username_TB.Focus();
44+
4245
Loaded += (s, e) => this.PostLoadSetup();
4346
}
4447

0 commit comments

Comments
 (0)