-
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #472 from TheJoeFin/dev
v4.5
- Loading branch information
Showing
28 changed files
with
943 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<Window | ||
x:Class="Text_Grab.Controls.NotifyIconWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:WpfUiIcon="http://schemas.lepo.co/wpfui/2022/xaml/tray" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Text_Grab.Controls" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml" | ||
Title="NotifyIconWindow" | ||
Width="0" | ||
Height="0" | ||
Activated="Window_Activated" | ||
Background="Transparent" | ||
IsHitTestVisible="False" | ||
Left="-50" | ||
Opacity="0" | ||
ShowInTaskbar="True" | ||
ToolTip="Text Grab" | ||
Top="-50" | ||
WindowStyle="ToolWindow" | ||
mc:Ignorable="d"> | ||
<Grid> | ||
<WpfUiIcon:NotifyIcon | ||
x:Name="NotifyIcon" | ||
Icon="/Images/TealSelect40.png" | ||
IsVisibleChanged="NotifyIcon_IsVisibleChanged" | ||
LeftClick="NotifyIcon_LeftClick" | ||
ToolTip="Text Grab"> | ||
<WpfUiIcon:NotifyIcon.Menu> | ||
<ContextMenu> | ||
<MenuItem | ||
x:Name="SettingsMenuItem" | ||
Click="SettingsMenuItem_Click" | ||
Header="Settings"> | ||
<MenuItem.Icon> | ||
<wpfui:SymbolIcon Symbol="Settings24" /> | ||
</MenuItem.Icon> | ||
</MenuItem> | ||
<Separator /> | ||
<MenuItem | ||
x:Name="LastGrabMenuItem" | ||
Click="LastGrabMenuItem_Click" | ||
Header="Edit Last Grab"> | ||
<MenuItem.Icon> | ||
<wpfui:SymbolIcon Symbol="ImageEdit24" /> | ||
</MenuItem.Icon> | ||
</MenuItem> | ||
<MenuItem | ||
x:Name="LookupMenuItem" | ||
Click="LookupMenuItem_Click" | ||
Header="Quick Simple Lookup"> | ||
<MenuItem.Icon> | ||
<wpfui:SymbolIcon Symbol="TextBulletListSquareSearch20" /> | ||
</MenuItem.Icon> | ||
</MenuItem> | ||
<MenuItem | ||
x:Name="PreviousRegionMenuItem" | ||
Click="PreviousRegionMenuItem_Click" | ||
Header="Grab Previous Region"> | ||
<MenuItem.Icon> | ||
<wpfui:SymbolIcon Symbol="History24" /> | ||
</MenuItem.Icon> | ||
</MenuItem> | ||
<Separator /> | ||
<MenuItem | ||
x:Name="FullscreenGrabMenuItem" | ||
Click="FullscreenGrabMenuItem_Click" | ||
Header="Fullscreen Grab"> | ||
<MenuItem.Icon> | ||
<wpfui:SymbolIcon Symbol="SlideAdd24" /> | ||
</MenuItem.Icon> | ||
</MenuItem> | ||
<MenuItem | ||
x:Name="GrabFrameMenuItem" | ||
Click="GrabFrameMenuItem_Click" | ||
Header="Grab Frame"> | ||
<MenuItem.Icon> | ||
<wpfui:SymbolIcon Symbol="PanelBottom20" /> | ||
</MenuItem.Icon> | ||
</MenuItem> | ||
<MenuItem | ||
x:Name="EditWindowMenuItem" | ||
Click="EditWindowMenuItem_Click" | ||
Header="Edit Text Window"> | ||
<MenuItem.Icon> | ||
<wpfui:SymbolIcon Symbol="WindowEdit20" /> | ||
</MenuItem.Icon> | ||
</MenuItem> | ||
<Separator /> | ||
<MenuItem | ||
x:Name="CloseMenuItem" | ||
Click="Exit_Click" | ||
Header="Close Text Grab"> | ||
<MenuItem.Icon> | ||
<wpfui:SymbolIcon Symbol="Dismiss24" /> | ||
</MenuItem.Icon> | ||
</MenuItem> | ||
</ContextMenu> | ||
</WpfUiIcon:NotifyIcon.Menu> | ||
</WpfUiIcon:NotifyIcon> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using System.Windows; | ||
using Text_Grab.Services; | ||
using Text_Grab.Utilities; | ||
using Text_Grab.Views; | ||
using Wpf.Ui.Tray.Controls; | ||
|
||
namespace Text_Grab.Controls; | ||
/// <summary> | ||
/// Interaction logic for NotifyIconWindow.xaml | ||
/// </summary> | ||
public partial class NotifyIconWindow : Window | ||
{ | ||
public NotifyIconWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Exit_Click(object sender, RoutedEventArgs e) | ||
{ | ||
App.Current.Shutdown(); | ||
} | ||
|
||
private void NotifyIcon_LeftClick(NotifyIcon sender, RoutedEventArgs e) | ||
{ | ||
e.Handled = true; | ||
App.DefaultLaunch(); | ||
} | ||
|
||
private void Window_Activated(object sender, System.EventArgs e) | ||
{ | ||
Hide(); | ||
NotifyIcon.Visibility = Visibility.Visible; | ||
} | ||
|
||
private void EditWindowMenuItem_Click(object sender, RoutedEventArgs e) | ||
{ | ||
EditTextWindow etw = new(); etw.Show(); | ||
} | ||
|
||
private void GrabFrameMenuItem_Click(object sender, RoutedEventArgs e) | ||
{ | ||
GrabFrame gf = new(); gf.Show(); | ||
} | ||
|
||
private void FullscreenGrabMenuItem_Click(object sender, RoutedEventArgs e) | ||
{ | ||
WindowUtilities.LaunchFullScreenGrab(); | ||
} | ||
|
||
private async void PreviousRegionMenuItem_Click(object sender, RoutedEventArgs e) | ||
{ | ||
await OcrUtilities.GetTextFromPreviousFullscreenRegion(); | ||
} | ||
|
||
private void LookupMenuItem_Click(object sender, RoutedEventArgs e) | ||
{ | ||
QuickSimpleLookup qsl = new(); qsl.Show(); | ||
} | ||
|
||
private void LastGrabMenuItem_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Singleton<HistoryService>.Instance.GetLastHistoryAsGrabFrame(); | ||
} | ||
|
||
private void SettingsMenuItem_Click(object sender, RoutedEventArgs e) | ||
{ | ||
SettingsWindow sw = new(); sw.Show(); | ||
} | ||
|
||
private void NotifyIcon_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) | ||
{ | ||
if (!NotifyIcon.IsVisible) | ||
NotifyIcon.Visibility = Visibility.Visible; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.