Skip to content

Commit 18a4934

Browse files
Fix showing hot keys in setting panel for transparent and whiteboard.
1 parent 90afc53 commit 18a4934

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Riter/Core/UI/SettingPanel.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<ContentControl Width="16" Height="16" Content="{StaticResource Icon_Transparent}" VerticalAlignment="Center" />
8383
<Label Content="Enable Transparent" Padding="8,6,22,2" FontSize="12" />
8484
</StackPanel>
85-
<Label Grid.Column="1" Content="[ Shift + T ]" FontSize="12" Opacity="0.5" VerticalAlignment="Center" HorizontalAlignment="Right"/>
85+
<Label Grid.Column="1" x:Name="TransparentLable" Content="[ Shift + T ]" FontSize="12" Opacity="0.5" VerticalAlignment="Center" HorizontalAlignment="Right"/>
8686
</Grid>
8787
</Border>
8888
</Grid>
@@ -111,7 +111,7 @@
111111
<ContentControl Width="16" Height="16" Content="{StaticResource Icon_WhiteBoard}" VerticalAlignment="Center" />
112112
<Label Content="Enable Whiteboard" Padding="8,6,22,2" FontSize="12" />
113113
</StackPanel>
114-
<Label Grid.Column="1" Content="[ Shift + W ]" FontSize="12" Opacity="0.5" VerticalAlignment="Center" HorizontalAlignment="Right"/>
114+
<Label x:Name="WhiteBoatdLable" Grid.Column="1" Content="[ Shift + W ]" FontSize="12" Opacity="0.5" VerticalAlignment="Center" HorizontalAlignment="Right"/>
115115
</Grid>
116116
</Border>
117117
</Grid>
@@ -140,7 +140,7 @@
140140
<ContentControl Width="16" Height="16" Content="{StaticResource Icon_BlackBoard}" VerticalAlignment="Center" />
141141
<Label Content="Enable Blackboard" Padding="8,6,22,2" FontSize="12" />
142142
</StackPanel>
143-
<Label Grid.Column="1" Content="[ Shift + B ]" FontSize="12" Opacity="0.5" VerticalAlignment="Center" HorizontalAlignment="Right"/>
143+
<Label x:Name="BlackBoatdLable" Grid.Column="1" Content="[ Shift + B ]" FontSize="12" Opacity="0.5" VerticalAlignment="Center" HorizontalAlignment="Right"/>
144144
</Grid>
145145
</Border>
146146
</Grid>

src/Riter/Core/UI/SettingPanel.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Diagnostics;
22
using System.Windows.Controls;
33
using System.Windows.Media;
4+
using Microsoft.Extensions.DependencyInjection;
45

56
namespace Riter.Core.UI;
67

@@ -9,12 +10,18 @@ namespace Riter.Core.UI;
910
/// </summary>
1011
public partial class SettingPanel : UserControl
1112
{
13+
private readonly AppSettings _appSettings;
14+
1215
/// <summary>
1316
/// Initializes a new instance of the <see cref="SettingPanel"/> class.
1417
/// </summary>
1518
public SettingPanel()
1619
{
1720
InitializeComponent();
21+
_appSettings = App.ServiceProvider.GetService<AppSettings>();
22+
TransparentLable.Content = _appSettings.HotKeysConfig.FirstOrDefault(x => x.Key == HotKey.TransparentBackground.ToString()).Value;
23+
WhiteBoatdLable.Content = _appSettings.HotKeysConfig.FirstOrDefault(x => x.Key == HotKey.WhiteboardBackground.ToString()).Value;
24+
BlackBoatdLable.Content = _appSettings.HotKeysConfig.FirstOrDefault(x => x.Key == HotKey.BlackboardBackground.ToString()).Value;
1825
}
1926

2027
/// <summary>

0 commit comments

Comments
 (0)