Skip to content

Commit

Permalink
Replace text with ShortcutControl rounded key rects
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJoeFin committed Jan 21, 2023
1 parent 06549fc commit cbf75c7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 34 deletions.
13 changes: 7 additions & 6 deletions Text-Grab/Controls/ShortcutControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
xmlns:local="clr-namespace:Text_Grab.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DataContext="{d:DesignInstance Type=local:ShortcutControl}"
d:DesignHeight="450"
d:DesignWidth="800"
d:DesignHeight="50"
d:DesignWidth="200"
mc:Ignorable="d">
<UserControl.Resources>
<BitmapImage x:Key="WinSymIcon" UriSource="/Text-Grab;component/Images/WinSym.png" />
Expand All @@ -28,11 +28,12 @@
<Border
Width="70"
Height="24"
Margin="8,0,0,0"
Margin="8,0,8,0"
Padding="6,0,0,1"
Background="White"
CornerRadius="5">
<TextBlock
HorizontalAlignment="Center"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="16"
FontWeight="Medium"
Expand All @@ -42,9 +43,9 @@
<Border
Width="24"
Height="24"
Margin="8,0,0,0"
Background="White"
CornerRadius="5">
CornerRadius="5"
Visibility="Collapsed">
<TextBox
x:Name="ShorcutKey"
Width="20"
Expand Down
32 changes: 9 additions & 23 deletions Text-Grab/Controls/ShortcutControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Controls;

namespace Text_Grab.Controls
namespace Text_Grab.Controls;

/// <summary>
/// Interaction logic for ShortcutControl.xaml
/// </summary>
public partial class ShortcutControl : UserControl
{
/// <summary>
/// Interaction logic for ShortcutControl.xaml
/// </summary>
public partial class ShortcutControl : UserControl
public ShortcutControl()
{
public ShortcutControl()
{
InitializeComponent();
}
InitializeComponent();
}
}
9 changes: 4 additions & 5 deletions Text-Grab/Views/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,8 @@
<Run FontWeight="Bold">Global hotkeys (clear text to disable hotkey):</Run>
</TextBlock>
</CheckBox>
<!--<controls:ShortcutControl />-->
<StackPanel Margin="24,8,20,0" Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBodyNormal}" Text="- Win+Shift+" />
<controls:ShortcutControl />
<TextBox
x:Name="FullScreenHotkeyTextBox"
CharacterCasing="Upper"
Expand All @@ -168,7 +167,7 @@
Text="new Full Screen Grab" />
</StackPanel>
<StackPanel Margin="24,8,20,0" Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBodyNormal}" Text="- Win+Shift+" />
<controls:ShortcutControl />
<TextBox
x:Name="GrabFrameHotkeyTextBox"
CharacterCasing="Upper"
Expand All @@ -181,7 +180,7 @@
Text="new Grab Frame" />
</StackPanel>
<StackPanel Margin="24,8,20,0" Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBodyNormal}" Text="- Win+Shift+" />
<controls:ShortcutControl />
<TextBox
x:Name="EditTextHotKeyTextBox"
CharacterCasing="Upper"
Expand All @@ -194,7 +193,7 @@
Text="new Edit Text Window" />
</StackPanel>
<StackPanel Margin="24,8,20,0" Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBodyNormal}" Text="- Win+Shift+" />
<controls:ShortcutControl />
<TextBox
x:Name="LookupHotKeyTextBox"
CharacterCasing="Upper"
Expand Down

0 comments on commit cbf75c7

Please sign in to comment.