Skip to content

Commit cbf75c7

Browse files
committed
Replace text with ShortcutControl rounded key rects
1 parent 06549fc commit cbf75c7

File tree

3 files changed

+20
-34
lines changed

3 files changed

+20
-34
lines changed

Text-Grab/Controls/ShortcutControl.xaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
xmlns:local="clr-namespace:Text_Grab.Controls"
77
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
88
d:DataContext="{d:DesignInstance Type=local:ShortcutControl}"
9-
d:DesignHeight="450"
10-
d:DesignWidth="800"
9+
d:DesignHeight="50"
10+
d:DesignWidth="200"
1111
mc:Ignorable="d">
1212
<UserControl.Resources>
1313
<BitmapImage x:Key="WinSymIcon" UriSource="/Text-Grab;component/Images/WinSym.png" />
@@ -28,11 +28,12 @@
2828
<Border
2929
Width="70"
3030
Height="24"
31-
Margin="8,0,0,0"
31+
Margin="8,0,8,0"
32+
Padding="6,0,0,1"
3233
Background="White"
3334
CornerRadius="5">
3435
<TextBlock
35-
HorizontalAlignment="Center"
36+
HorizontalAlignment="Left"
3637
VerticalAlignment="Center"
3738
FontSize="16"
3839
FontWeight="Medium"
@@ -42,9 +43,9 @@
4243
<Border
4344
Width="24"
4445
Height="24"
45-
Margin="8,0,0,0"
4646
Background="White"
47-
CornerRadius="5">
47+
CornerRadius="5"
48+
Visibility="Collapsed">
4849
<TextBox
4950
x:Name="ShorcutKey"
5051
Width="20"
Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
using System.Windows;
7-
using System.Windows.Controls;
8-
using System.Windows.Data;
9-
using System.Windows.Documents;
10-
using System.Windows.Input;
11-
using System.Windows.Media;
12-
using System.Windows.Media.Imaging;
13-
using System.Windows.Navigation;
14-
using System.Windows.Shapes;
1+
using System.Windows.Controls;
152

16-
namespace Text_Grab.Controls
3+
namespace Text_Grab.Controls;
4+
5+
/// <summary>
6+
/// Interaction logic for ShortcutControl.xaml
7+
/// </summary>
8+
public partial class ShortcutControl : UserControl
179
{
18-
/// <summary>
19-
/// Interaction logic for ShortcutControl.xaml
20-
/// </summary>
21-
public partial class ShortcutControl : UserControl
10+
public ShortcutControl()
2211
{
23-
public ShortcutControl()
24-
{
25-
InitializeComponent();
26-
}
12+
InitializeComponent();
2713
}
2814
}

Text-Grab/Views/SettingsWindow.xaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@
153153
<Run FontWeight="Bold">Global hotkeys (clear text to disable hotkey):</Run>
154154
</TextBlock>
155155
</CheckBox>
156-
<!--<controls:ShortcutControl />-->
157156
<StackPanel Margin="24,8,20,0" Orientation="Horizontal">
158-
<TextBlock Style="{StaticResource TextBodyNormal}" Text="- Win+Shift+" />
157+
<controls:ShortcutControl />
159158
<TextBox
160159
x:Name="FullScreenHotkeyTextBox"
161160
CharacterCasing="Upper"
@@ -168,7 +167,7 @@
168167
Text="new Full Screen Grab" />
169168
</StackPanel>
170169
<StackPanel Margin="24,8,20,0" Orientation="Horizontal">
171-
<TextBlock Style="{StaticResource TextBodyNormal}" Text="- Win+Shift+" />
170+
<controls:ShortcutControl />
172171
<TextBox
173172
x:Name="GrabFrameHotkeyTextBox"
174173
CharacterCasing="Upper"
@@ -181,7 +180,7 @@
181180
Text="new Grab Frame" />
182181
</StackPanel>
183182
<StackPanel Margin="24,8,20,0" Orientation="Horizontal">
184-
<TextBlock Style="{StaticResource TextBodyNormal}" Text="- Win+Shift+" />
183+
<controls:ShortcutControl />
185184
<TextBox
186185
x:Name="EditTextHotKeyTextBox"
187186
CharacterCasing="Upper"
@@ -194,7 +193,7 @@
194193
Text="new Edit Text Window" />
195194
</StackPanel>
196195
<StackPanel Margin="24,8,20,0" Orientation="Horizontal">
197-
<TextBlock Style="{StaticResource TextBodyNormal}" Text="- Win+Shift+" />
196+
<controls:ShortcutControl />
198197
<TextBox
199198
x:Name="LookupHotKeyTextBox"
200199
CharacterCasing="Upper"

0 commit comments

Comments
 (0)