mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[New Utility]Crop And Lock (#27832)
* [CropAndLock]Original POC code dump * Project rename and delete solution * Remove unused architectures * Update cppwinrt to be in line with the solution * Add to PowerToys solution and fix build errors * Initial module interface empty project * Module skeleton based on AlwaysOnTop * Add loggers to module interface * Add crop and lock to the runner * Enable starts and disable kills the process * Events reacting to hotkeys * Main application reacting to events * Initialize unhandled exception handling * Singleton in line with other projects * Also exit when PowerToys exit is detected * Create Settings page * React to shortcut changes in Settings * Disable Crop and Lock through an Event * Disable running Crop and Lock standalone * Remove Crop and Lock tray icon * Module Interface dll version * Fix main app resource file to include version * Make pch conditional on CI build * Add to signing * Remove settings screen opened by removed tray icon * Fix spellcheck * Yet another fix for spellcheck * Fix disabling utility * Fix solution build configurations * Fix C++ analyzer errors * Try to fix pre-compiled header CI errors * Fix crash while exiting with an active reparent window * Fix missing reference when building in release CI * Add OOBE page * GPO: Add admx and adml file changes * GPO: react to changes in GPO * Add quick access flyout menu entry * Use Crop And Lock icon * Use actual images for Settings and OOBE * Module and app telemetry * Add entry to README.md * Add to process lists * Additional logging * Attribution in Settings page * Add attribution to Community.md * Fix spellcheck * Fix typo in strings * Fix crash when window handle is no longer valid * Update COMMUNITY.md * Fix supportedOS in manifest * Don't show msgbox if detecting second instance * Remove unused hotkey * Tweak attribution * Fix attribution spellcheck
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<Page
|
||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.CropAndLockPage"
|
||||
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:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="using:CommunityToolkit.WinUI.UI"
|
||||
AutomationProperties.LandmarkType="Main"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<controls:SettingsPageControl
|
||||
x:Uid="CropAndLock"
|
||||
IsTabStop="False"
|
||||
ModuleImageSource="ms-appx:///Assets/Settings/Modules/CropAndLock.png">
|
||||
<controls:SettingsPageControl.ModuleContent>
|
||||
<StackPanel Orientation="Vertical" ChildrenTransitions="{StaticResource SettingsCardsAnimations}">
|
||||
<labs:SettingsCard
|
||||
x:Uid="CropAndLock_EnableToggleControl_HeaderText"
|
||||
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/FluentIcons/FluentIconsCropAndLock.png}"
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured, Converter={StaticResource BoolNegationConverter}}">
|
||||
<ToggleSwitch
|
||||
x:Uid="ToggleSwitch"
|
||||
IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
|
||||
</labs:SettingsCard>
|
||||
<InfoBar
|
||||
x:Uid="GPO_IsSettingForced"
|
||||
IsClosable="False"
|
||||
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}"
|
||||
IsTabStop="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}"
|
||||
Severity="Informational" />
|
||||
<controls:SettingsGroup
|
||||
x:Uid="CropAndLock_Activation_GroupSettings"
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
|
||||
|
||||
<labs:SettingsCard
|
||||
x:Uid="CropAndLock_ThumbnailActivation_Shortcut"
|
||||
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
|
||||
Glyph=}">
|
||||
<controls:ShortcutControl
|
||||
AllowDisable="True"
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
HotkeySettings="{x:Bind Path=ViewModel.ThumbnailActivationShortcut, Mode=TwoWay}" />
|
||||
</labs:SettingsCard>
|
||||
<labs:SettingsCard
|
||||
x:Uid="CropAndLock_ReparentActivation_Shortcut"
|
||||
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
|
||||
Glyph=}">
|
||||
<controls:ShortcutControl
|
||||
AllowDisable="True"
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
HotkeySettings="{x:Bind Path=ViewModel.ReparentActivationShortcut, Mode=TwoWay}" />
|
||||
</labs:SettingsCard>
|
||||
</controls:SettingsGroup>
|
||||
</StackPanel>
|
||||
</controls:SettingsPageControl.ModuleContent>
|
||||
|
||||
<controls:SettingsPageControl.PrimaryLinks>
|
||||
<controls:PageLink
|
||||
x:Uid="LearnMore_CropAndLock"
|
||||
Link="https://aka.ms/PowerToysOverview_CropAndLock" />
|
||||
</controls:SettingsPageControl.PrimaryLinks>
|
||||
<controls:SettingsPageControl.SecondaryLinks>
|
||||
<controls:PageLink
|
||||
Link="https://github.com/robmikh"
|
||||
Text="Robert Mikhayelyan" />
|
||||
<controls:PageLink
|
||||
Link="https://github.com/kevinguo305"
|
||||
Text="Kevin Guo" />
|
||||
</controls:SettingsPageControl.SecondaryLinks>
|
||||
</controls:SettingsPageControl>
|
||||
</Page>
|
||||
@@ -0,0 +1,29 @@
|
||||
// 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.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
public sealed partial class CropAndLockPage : Page, IRefreshablePage
|
||||
{
|
||||
private CropAndLockViewModel ViewModel { get; set; }
|
||||
|
||||
public CropAndLockPage()
|
||||
{
|
||||
var settingsUtils = new SettingsUtils();
|
||||
ViewModel = new CropAndLockViewModel(settingsUtils, SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), SettingsRepository<CropAndLockSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage);
|
||||
DataContext = ViewModel;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void RefreshEnabledState()
|
||||
{
|
||||
ViewModel.RefreshEnabledState();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,6 +106,11 @@
|
||||
helpers:NavHelper.NavigateTo="views:ColorPickerPage"
|
||||
Icon="{ui:BitmapIcon Source=/Assets/Settings/FluentIcons/FluentIconsColorPicker.png}" />
|
||||
|
||||
<NavigationViewItem
|
||||
x:Uid="Shell_CropAndLock"
|
||||
helpers:NavHelper.NavigateTo="views:CropAndLockPage"
|
||||
Icon="{ui:BitmapIcon Source=/Assets/Settings/FluentIcons/FluentIconsCropAndLock.png}" />
|
||||
|
||||
<NavigationViewItem
|
||||
x:Uid="Shell_FancyZones"
|
||||
helpers:NavHelper.NavigateTo="views:FancyZonesPage"
|
||||
|
||||
Reference in New Issue
Block a user