mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[New PowerToy] OCR PowerToy (#19172)
* Init commit * Fix unintended GUID change of Microsoft.PowerToys.Run.Plugin.TimeZone.UnitTests * Region and click word working * Code style * Close even when there is no result from the OCR * Fix spelling concerns, and make overlay black to match snipping tool * increase opacity of overlay to match snipping tool * Code Style and cleanup * Code style * Create Logos and hook them into the project file * Make the PowerOCR VCXProj more like Awake VCXProj * Rename MainWindow to OCROverlay * Add WindowUtilities and WindowForms * Remove fsg to fix spelling error * launch OCR Overlay on every screen * Add PowerOCR to Runner Main.cpp * Add PowerOCR Settings and Properties * Add PowerOcrViewModel * Fix wrong setting reference in PowerOcrSettingsVM * Try to clean up the Cpp project for PowerOCR * Went to ARM64 was x64 thanks @snickler * Clean up PowerOCR C++ Proj with file refs * Rewrite C++ dllmain comparing to awake * Changes for spelling issues. The rest will stay * Create PowerOcr Settings Page and add to settings shell * Fix PowerOcr Settings * Fix multi-monitor scaling issue * Add close all overlays when escaping * Update src/runner/main.cpp to call correct Power OCR dll Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> * Update expect.txt * Add many files from Color Picker for hotkey activation * Organize project into helper folder * Use new hotkey activation and keep process alive * Fix bug where scalebmp wasn't working * Add The file headers and dispose app.xaml.cs * Code style changes * Fix bug where PowerOCR was toggling Awake * Unsubscribe from keyboard events making they don't fire twice * Add SndPowerOcrSetting and add to SettingsVM * Trying to make the runner close PowerOCR when runner closes * Fix app_name * Update spellcheck expect * use mutex on PowerOCR app to keep to single instance * Rebuild the module interface using ColorPicker as a template. Process still stays alive. * Fix project names of the module interface * Put app startup args back to 0 like color picker * Runner now finds and enables/disables PowerOCR * remove unneeded item groups from settings proj, per stefansjfw * Add PowerOCR Screenshots * Revert changed project GUID * Add OOBE content for PowerOCR * Keep cursor on one screen since the OCR window does not span screens. * reload settings when activation key is pressed * New screenshots and OOBE text * Add PowerOCR as a case in the settings App.xaml.cs OnLaunched * Settings and OOBE Text Changes * Using using on bitmaps and change OCR overlay to stay open if no result * Keyboard activation is handled is true * Remove unused start PowerOCR OOBE Method * [PowerOCR]Add some telemetry * Add some logging * Don't recreate the OCR overlay Windows more times * Add to BugReportTool to get event viewer errors * Fix wrong comment * Fix another comment * Add files to installer * Add to signing * Don't take Esc away from other apps * Default to Win Shift R * Use low level keyboard hook from runner * Remove esc from local low level keyboard hook * Fix some nits * Default to Win Shift T
This commit is contained in:
44
src/settings-ui/Settings.UI/Views/PowerOcrPage.xaml
Normal file
44
src/settings-ui/Settings.UI/Views/PowerOcrPage.xaml
Normal file
@@ -0,0 +1,44 @@
|
||||
<Page
|
||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerOcrPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
AutomationProperties.LandmarkType="Main"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<controls:SettingsPageControl x:Uid="PowerOCR" ModuleImageSource="ms-appx:///Assets/Modules/PowerOCR.png">
|
||||
<controls:SettingsPageControl.ModuleContent>
|
||||
<StackPanel Orientation="Vertical">
|
||||
|
||||
<controls:Setting x:Uid="PowerOCR_EnableToggleControl_HeaderText">
|
||||
<controls:Setting.Icon>
|
||||
<BitmapIcon ShowAsMonochrome="False" UriSource="ms-appx:///Assets/FluentIcons/FluentIconsPowerOcr.png" />
|
||||
</controls:Setting.Icon>
|
||||
<controls:Setting.ActionContent>
|
||||
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
|
||||
</controls:Setting.ActionContent>
|
||||
</controls:Setting>
|
||||
|
||||
<controls:SettingsGroup x:Uid="Shortcut" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
|
||||
<controls:Setting x:Uid="Activation_Shortcut" Icon="">
|
||||
<controls:Setting.ActionContent>
|
||||
<controls:ShortcutControl MinWidth="{StaticResource SettingActionControlMinWidth}" HotkeySettings="{x:Bind Path=ViewModel.ActivationShortcut, Mode=TwoWay}" />
|
||||
</controls:Setting.ActionContent>
|
||||
</controls:Setting>
|
||||
|
||||
</controls:SettingsGroup>
|
||||
|
||||
</StackPanel>
|
||||
</controls:SettingsPageControl.ModuleContent>
|
||||
|
||||
<controls:SettingsPageControl.PrimaryLinks>
|
||||
<controls:PageLink x:Uid="LearnMore_PowerOcr" Link="https://aka.ms/PowerToysOverview_PowerOCR" />
|
||||
</controls:SettingsPageControl.PrimaryLinks>
|
||||
<controls:SettingsPageControl.SecondaryLinks>
|
||||
<controls:PageLink Text="Based upon Joseph Finney's Text Grab" Link="https://github.com/TheJoeFin/Text-Grab"/>
|
||||
</controls:SettingsPageControl.SecondaryLinks>
|
||||
</controls:SettingsPageControl>
|
||||
</Page>
|
||||
26
src/settings-ui/Settings.UI/Views/PowerOcrPage.xaml.cs
Normal file
26
src/settings-ui/Settings.UI/Views/PowerOcrPage.xaml.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.ViewModels;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
public sealed partial class PowerOcrPage : Page
|
||||
{
|
||||
private PowerOcrViewModel ViewModel { get; set; }
|
||||
|
||||
public PowerOcrPage()
|
||||
{
|
||||
var settingsUtils = new SettingsUtils();
|
||||
ViewModel = new PowerOcrViewModel(
|
||||
settingsUtils,
|
||||
SettingsRepository<GeneralSettings>.GetInstance(settingsUtils),
|
||||
ShellPage.SendDefaultIPCMessage);
|
||||
DataContext = ViewModel;
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,14 @@
|
||||
ShowAsMonochrome="False" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem x:Uid="Shell_PowerOcr"
|
||||
helpers:NavHelper.NavigateTo="views:PowerOcrPage">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsPowerOcr.png"
|
||||
ShowAsMonochrome="False" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem x:Uid="Shell_PowerLauncher"
|
||||
helpers:NavHelper.NavigateTo="views:PowerLauncherPage">
|
||||
|
||||
Reference in New Issue
Block a user