mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-14 23:29:58 +01:00
Compare commits
2 Commits
copilot/fi
...
shawn/fixP
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b71bce9c6c | ||
|
|
753689309e |
@@ -1 +0,0 @@
|
||||
.
|
||||
@@ -107,7 +107,7 @@ public partial class AliasManager : ObservableObject
|
||||
}
|
||||
|
||||
// Look for the alias belonging to another command, and remove it
|
||||
if (newAlias is not null && kv.Value.Alias == newAlias.Alias)
|
||||
if (newAlias is not null && kv.Value.Alias == newAlias.Alias && kv.Value.CommandId != commandId)
|
||||
{
|
||||
toRemove.Add(kv.Value);
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <common/utils/resources.h>
|
||||
#include <Settings.h>
|
||||
#include <trace.h>
|
||||
#include <ImageResizerConstants.h>
|
||||
|
||||
#include <wil/win32_helpers.h>
|
||||
#include <wrl/module.h>
|
||||
@@ -121,16 +120,6 @@ public:
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Check if the extension is actually supported by Image Resizer
|
||||
// This prevents showing the menu for file types like .psd that Windows
|
||||
// perceives as images but Image Resizer cannot process
|
||||
if (!ImageResizerConstants::IsSupportedImageExtension(pszExt))
|
||||
{
|
||||
CoTaskMemFree(pszPath);
|
||||
*cmdState = ECS_HIDDEN;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// TODO: Instead, detect whether there's a WIC codec installed that can handle this file
|
||||
AssocGetPerceivedType(pszExt, &type, &flag, NULL);
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
namespace ImageResizerConstants
|
||||
{
|
||||
@@ -12,27 +10,4 @@ namespace ImageResizerConstants
|
||||
inline const std::wstring ModuleOldSaveFolderKey = L"ImageResizer";
|
||||
inline const std::wstring ModuleSaveFolderKey = L"Image Resizer";
|
||||
inline const std::wstring ModulePackageDisplayName = L"ImageResizerContextMenu";
|
||||
|
||||
// List of supported image extensions that Image Resizer can process
|
||||
// This must match the list in RuntimeRegistration.h
|
||||
// Note: All extensions must be in lowercase for case-insensitive comparison
|
||||
inline const std::vector<std::wstring> SupportedImageExtensions = {
|
||||
L".bmp", L".dib", L".gif", L".jfif", L".jpe", L".jpeg", L".jpg",
|
||||
L".jxr", L".png", L".rle", L".tif", L".tiff", L".wdp"
|
||||
};
|
||||
|
||||
// Helper function to check if a file extension is supported by Image Resizer
|
||||
inline bool IsSupportedImageExtension(LPCWSTR extension)
|
||||
{
|
||||
if (extension == nullptr || wcslen(extension) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Convert to lowercase for case-insensitive comparison
|
||||
std::wstring ext(extension);
|
||||
std::transform(ext.begin(), ext.end(), ext.begin(), ::towlower);
|
||||
|
||||
return std::find(SupportedImageExtensions.begin(), SupportedImageExtensions.end(), ext) != SupportedImageExtensions.end();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include <Settings.h>
|
||||
#include <trace.h>
|
||||
#include <ImageResizerConstants.h>
|
||||
|
||||
#include <common/themes/icon_helpers.h>
|
||||
#include <common/utils/process_path.h>
|
||||
@@ -98,15 +97,6 @@ HRESULT CContextMenuHandler::QueryContextMenu(_In_ HMENU hmenu, UINT indexMenu,
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Check if the extension is actually supported by Image Resizer
|
||||
// This prevents showing the menu for file types like .psd that Windows
|
||||
// perceives as images but Image Resizer cannot process
|
||||
if (!ImageResizerConstants::IsSupportedImageExtension(pszExt))
|
||||
{
|
||||
free(pszPath);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// TODO: Instead, detect whether there's a WIC codec installed that can handle this file
|
||||
AssocGetPerceivedType(pszExt, &type, &flag, NULL);
|
||||
|
||||
@@ -427,16 +417,6 @@ HRESULT __stdcall CContextMenuHandler::GetState(IShellItemArray* psiItemArray, B
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Check if the extension is actually supported by Image Resizer
|
||||
// This prevents showing the menu for file types like .psd that Windows
|
||||
// perceives as images but Image Resizer cannot process
|
||||
if (!ImageResizerConstants::IsSupportedImageExtension(pszExt))
|
||||
{
|
||||
CoTaskMemFree(pszPath);
|
||||
*pCmdState = ECS_HIDDEN;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// TODO: Instead, detect whether there's a WIC codec installed that can handle this file
|
||||
AssocGetPerceivedType(pszExt, &type, &flag, NULL);
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
IsMaximizable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
IsShownInSwitchers="False"
|
||||
IsTitleBarVisible="False"
|
||||
mc:Ignorable="d">
|
||||
<Grid Background="#1A000000">
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.UI.Windowing;
|
||||
using Windows.Graphics;
|
||||
@@ -24,6 +25,17 @@ namespace PowerDisplay.PowerDisplayXAML
|
||||
{
|
||||
InitializeComponent();
|
||||
NumberText.Text = displayText;
|
||||
try
|
||||
{
|
||||
this.SetIsShownInSwitchers(false);
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
// WinUI will throw if explorer is not running, safely ignore
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
// Configure window style
|
||||
ConfigureWindow();
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
IsMaximizable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
IsShownInSwitchers="False"
|
||||
IsTitleBarVisible="False">
|
||||
<winuiex:WindowEx.SystemBackdrop>
|
||||
<DesktopAcrylicBackdrop />
|
||||
|
||||
@@ -71,6 +71,10 @@ namespace PowerDisplay
|
||||
_hotkeyService.Initialize(this);
|
||||
Logger.LogTrace("MainWindow constructor: HotkeyService initialized");
|
||||
|
||||
Logger.LogTrace("MainWindow constructor: Setting IsShownInSwitchers property");
|
||||
this.SetIsShownInSwitchers(false);
|
||||
Logger.LogTrace("MainWindow constructor: Set IsShownInSwitchers property successfully");
|
||||
|
||||
// Note: ViewModel handles all async initialization internally.
|
||||
// We listen to InitializationCompleted event to know when data is ready.
|
||||
// No duplicate initialization here - single responsibility in ViewModel.
|
||||
|
||||
Reference in New Issue
Block a user