Compare commits

...

7 Commits

Author SHA1 Message Date
Leilei Zhang
b94bf4fdae update value 2025-12-05 22:07:22 +08:00
Leilei Zhang
2d18303f0a Merge branch 'main' of https://github.com/microsoft/PowerToys into leilzh/fixupdate 2025-12-05 21:44:06 +08:00
Niels Laute
cdf66a70e9 [AdvancedPaste] Fix outdated string in Settings (#44099)
Updating and removing outdated strings.

Updated string:

<img width="1565" height="323" alt="image"
src="https://github.com/user-attachments/assets/3dcad3b9-7ba9-4d87-ab36-405a8e1705db"
/>
2025-12-05 21:33:59 +08:00
Valentin Arthur Thomas
9dcddfd4b8 Quotation mark (#30481)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Add Quotation mark
Add local quotation based on ~~VK_OEM_7(0xDE)~~ VK_OEM_COMMA(0xBC) key.
Not all quotes have been added, only `‟ „ ” « » ‚ , ‘ ’ › ‹ '「 」 《 》 『
』〈 〉″ ‴ ⁗`
Why not added :
- ` ⹂ ⌜ ⌝ ❛ ❜ ❝ ❞ 🙶 🙷 🙸 ' 「 」 ` its redundant and would make too much
and not readable.
- ` ﹁ ﹂ ﹃ ﹄ `  I did not put them because there use for horizontal text


<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: https://github.com/microsoft/PowerToys/issues/29371
https://github.com/microsoft/PowerToys/issues/24832
- [ ] **Communication:** I've discussed this with core contributors
already. If work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end user facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places (None)
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed
or any additional comments/features here -->
This PR is currently a draft, I still need to know if adding
language-related keyboard management is a good idea or specifying the
use of a gobal key to make it easier to manage all the keyboards in one.
Some languages ​​can use different keyboards, I think this would become
problematic if the keyboard does not match the key used by default.
However, using a universal key can also pose an issue to finding the
key. that remains to be discussed
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2025-12-05 11:57:01 +01:00
Copilot
503bcbdf2d Restore missing "Quick access" menu item in tray icon context menu (#42676)
## Summary
Restores the "Quick access" menu item that was accidentally removed from
the PowerToys tray icon context menu.

## Issue
Fixes #[issue_number]

The "Quick access" menu item was missing from the tray icon's
right-click context menu, preventing users from accessing this feature
via the tray menu.

**Expected menu:**

![Expected
menu](https://github.com/user-attachments/assets/805b1436-5a08-42e7-a34d-b9848fd9a235)

**Actual menu (before this fix):**

![Actual
menu](https://github.com/user-attachments/assets/7584035d-e893-4f73-acc3-84d789e31e81)

## Changes
- Added the missing `MENUITEM "Quick access\tLeft-click",
ID_QUICK_ACCESS_MENU_COMMAND` entry as the first menu item in the
`ID_TRAY_MENU` definition in `src/runner/runner.base.rc`

## Details
The menu item was accidentally removed in commit
f5797a065a. This PR restores it to its
correct position as the first item in the tray menu.

All supporting code was already in place:
- The resource ID `ID_QUICK_ACCESS_MENU_COMMAND` (40006) is defined in
`resource.base.h`
- The resource string `QUICK_ACCESS_MENU_TEXT` is defined in
`Resources.resx`
- The menu command handler in `tray_icon.cpp` opens the Quick Access
flyout window
- The localization code updates the menu text at runtime

## Testing
-  Verified the menu item syntax is correct and matches existing
patterns
-  Confirmed all supporting resource IDs and handler code exist
-  CI build verification pending

After this fix, the tray menu will correctly display:
1. Quick access (Left-click)
2. Settings (Double-click)
3. Documentation
4. Report Bug
5. Close

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Quick Access missing in tray menu</issue_title>
> <issue_description>### Microsoft PowerToys version
> 
> 0.95.0
> 
> ### Installation method
> 
> PowerToys auto-update
> 
> ### Area(s) with issue?
> 
> System tray interaction
> 
> ### Steps to reproduce
> 
> 1. Right click the tray icon
> 2. Look at the list of items which can be selected
> 3. Notice that the "Quick access" is missing
> 
> Expected menu ("Exit" is now "Close" I took this image from initial
implementation):
> 
> <img width="234" height="127" alt="Image"
src="https://github.com/user-attachments/assets/805b1436-5a08-42e7-a34d-b9848fd9a235"
/>
> 
> Actual menu right now:
> 
> <img width="239" height="105" alt="Image"
src="https://github.com/user-attachments/assets/7584035d-e893-4f73-acc3-84d789e31e81"
/>
> 
> ### ✔️ Expected Behavior
> 
> The "Quick access" menu item should be there
> 
> ###  Actual Behavior
> 
> The menu item is missing
> 
> ### Additional Information
> 
> Windows 10 Pro 22H2 19045.6332
> 
> (Also it is the same on my other computers)
> 
> ### Other Software
> 
> _No response_</issue_description>
> 
> <agent_instructions>restore
> 
> MENUITEM "Quick access\tLeft-click", ID_QUICK_ACCESS_MENU_COMMAND
> 
> as first menu item of ID_TRAY_MENU MENU in
src/runner/runner.base.rc</agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> <comment_new><author>@niels9001</author><body>
> @davidegiacometti is this a regression from the PR where we updated
the string names?</body></comment_new>
> <comment_new><author>@davidegiacometti</author><body>
> Hi @niels9001 
> I just realized that the menu was missing in
https://github.com/microsoft/PowerToys/pull/40714 screenshots, but the
regression was caused by
f5797a065a.
> Unfortunately, many of the `.rc` files in the PT codebase have
UTF16-LE encoding and GitHub doesn't show diff.</body></comment_new>
> </comments>
> 


</details>

Fixes microsoft/PowerToys#42618

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start
the survey.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: davidegiacometti <25966642+davidegiacometti@users.noreply.github.com>
2025-12-05 07:33:37 +01:00
Leilei Zhang
abf5e5bf8d fix build error 2025-11-28 14:43:03 +08:00
Leilei Zhang
e1e74b8fab fix update 2025-11-27 21:35:40 +08:00
6 changed files with 152 additions and 65 deletions

View File

@@ -16,9 +16,54 @@
namespace registry
{
namespace detail
{
struct on_exit
{
std::function<void()> f;
on_exit(std::function<void()> f) :
f{ std::move(f) } {}
~on_exit() { f(); }
};
template<class... Ts>
struct overloaded : Ts...
{
using Ts::operator()...;
};
template<class... Ts>
overloaded(Ts...) -> overloaded<Ts...>;
inline const wchar_t* getScopeName(HKEY scope)
{
if (scope == HKEY_LOCAL_MACHINE)
{
return L"HKLM";
}
else if (scope == HKEY_CURRENT_USER)
{
return L"HKCU";
}
else if (scope == HKEY_CLASSES_ROOT)
{
return L"HKCR";
}
else
{
return L"HK??";
}
}
}
namespace install_scope
{
const wchar_t INSTALL_SCOPE_REG_KEY[] = L"Software\\Classes\\powertoys\\";
const wchar_t UNINSTALL_REG_KEY[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
// Bundle UpgradeCode from PowerToys.wxs (with braces as stored in registry)
const wchar_t BUNDLE_UPGRADE_CODE[] = L"{6341382D-C0A9-4238-9188-BE9607E3FAB2}";
enum class InstallScope
{
@@ -26,8 +71,67 @@ namespace registry
PerUser,
};
// Helper function to find PowerToys bundle in Windows Uninstall registry by BundleUpgradeCode
inline bool find_powertoys_bundle_in_uninstall_registry(HKEY rootKey)
{
HKEY uninstallKey{};
if (RegOpenKeyExW(rootKey, UNINSTALL_REG_KEY, 0, KEY_READ, &uninstallKey) != ERROR_SUCCESS)
{
return false;
}
detail::on_exit closeUninstallKey{ [uninstallKey] { RegCloseKey(uninstallKey); } };
DWORD index = 0;
wchar_t subKeyName[256];
// Enumerate all subkeys under Uninstall
while (RegEnumKeyW(uninstallKey, index++, subKeyName, 256) == ERROR_SUCCESS)
{
HKEY productKey{};
if (RegOpenKeyExW(uninstallKey, subKeyName, 0, KEY_READ, &productKey) != ERROR_SUCCESS)
{
continue;
}
detail::on_exit closeProductKey{ [productKey] { RegCloseKey(productKey); } };
// Check BundleUpgradeCode value (specific to WiX Bundle installations)
wchar_t bundleUpgradeCode[256]{};
DWORD bundleUpgradeCodeSize = sizeof(bundleUpgradeCode);
if (RegQueryValueExW(productKey, L"BundleUpgradeCode", nullptr, nullptr,
reinterpret_cast<LPBYTE>(bundleUpgradeCode), &bundleUpgradeCodeSize) == ERROR_SUCCESS)
{
if (_wcsicmp(bundleUpgradeCode, BUNDLE_UPGRADE_CODE) == 0)
{
return true;
}
}
}
return false;
}
inline const InstallScope get_current_install_scope()
{
// 1. Check HKCU Uninstall registry first (user-level bundle)
// Note: MSI components are always in HKLM regardless of install scope,
// but the Bundle entry will be in HKCU for per-user installations
if (find_powertoys_bundle_in_uninstall_registry(HKEY_CURRENT_USER))
{
Logger::info(L"Found user-level PowerToys bundle via BundleUpgradeCode in HKCU");
return InstallScope::PerUser;
}
// 2. Check HKLM Uninstall registry (machine-level bundle)
if (find_powertoys_bundle_in_uninstall_registry(HKEY_LOCAL_MACHINE))
{
Logger::info(L"Found machine-level PowerToys bundle via BundleUpgradeCode in HKLM");
return InstallScope::PerMachine;
}
// 3. Fallback to legacy custom registry key detection
Logger::info(L"PowerToys bundle not found in Uninstall registry, falling back to legacy detection");
// Open HKLM key
HKEY perMachineKey{};
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
@@ -45,6 +149,7 @@ namespace registry
&perUserKey) != ERROR_SUCCESS)
{
// both keys are missing
Logger::warn(L"No PowerToys installation detected, defaulting to PerMachine");
return InstallScope::PerMachine;
}
else
@@ -96,47 +201,6 @@ namespace registry
template<class>
inline constexpr bool always_false_v = false;
namespace detail
{
struct on_exit
{
std::function<void()> f;
on_exit(std::function<void()> f) :
f{ std::move(f) } {}
~on_exit() { f(); }
};
template<class... Ts>
struct overloaded : Ts...
{
using Ts::operator()...;
};
template<class... Ts>
overloaded(Ts...) -> overloaded<Ts...>;
inline const wchar_t* getScopeName(HKEY scope)
{
if (scope == HKEY_LOCAL_MACHINE)
{
return L"HKLM";
}
else if (scope == HKEY_CURRENT_USER)
{
return L"HKCU";
}
else if (scope == HKEY_CLASSES_ROOT)
{
return L"HKCR";
}
else
{
return L"HK??";
}
}
}
struct ValueChange
{
using value_t = std::variant<DWORD, std::wstring>;

View File

@@ -224,7 +224,7 @@ namespace PowerAccent.Core
LetterKey.VK_X => new[] { "ẋ", "×" },
LetterKey.VK_Y => new[] { "ẏ", "ꝡ" },
LetterKey.VK_Z => new[] { "ʒ", "ǯ", "" },
LetterKey.VK_COMMA => new[] { "∙", "₋", "⁻", "", "√" }, // is in VK_MINUS for other languages, but not VK_COMMA, so we add it here.
LetterKey.VK_COMMA => new[] { "∙", "₋", "⁻", "", "√", "‟", "《", "》", "", "〈", "〉", "″", "‴", "⁗" }, // is in VK_MINUS for other languages, but not VK_COMMA, so we add it here.
LetterKey.VK_PERIOD => new[] { "…", "⁝", "\u0300", "\u0301", "\u0302", "\u0303", "\u0304", "\u0308", "\u030B", "\u030C" },
LetterKey.VK_MINUS => new[] { "~", "", "", "", "—", "―", "", "", "⸺", "⸻", "∓" },
LetterKey.VK_SLASH_ => new[] { "÷", "√" },
@@ -302,6 +302,7 @@ namespace PowerAccent.Core
LetterKey.VK_E => new[] { "€" },
LetterKey.VK_S => new[] { "š" },
LetterKey.VK_Z => new[] { "ž" },
LetterKey.VK_COMMA => new[] { "„", "“", "»", "«" },
_ => Array.Empty<string>(),
};
}
@@ -317,6 +318,7 @@ namespace PowerAccent.Core
LetterKey.VK_U => new[] { "ü" },
LetterKey.VK_Z => new[] { "ž" },
LetterKey.VK_S => new[] { "š" },
LetterKey.VK_COMMA => new[] { "„", "“", "«", "»" },
_ => Array.Empty<string>(),
};
}
@@ -344,6 +346,7 @@ namespace PowerAccent.Core
LetterKey.VK_A => new[] { "ä", "å" },
LetterKey.VK_E => new[] { "€" },
LetterKey.VK_O => new[] { "ö" },
LetterKey.VK_COMMA => new[] { "”", "", "»" },
_ => Array.Empty<string>(),
};
}
@@ -360,6 +363,7 @@ namespace PowerAccent.Core
LetterKey.VK_O => new[] { "ô", "ö", "ó", "ò", "õ", "œ" },
LetterKey.VK_U => new[] { "û", "ù", "ü", "ú" },
LetterKey.VK_Y => new[] { "ÿ", "ý" },
LetterKey.VK_COMMA => new[] { "«", "»", "", "", "“", "”", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -376,6 +380,7 @@ namespace PowerAccent.Core
LetterKey.VK_U => new[] { "ú" },
LetterKey.VK_Y => new[] { "ý" },
LetterKey.VK_T => new[] { "þ" },
LetterKey.VK_COMMA => new[] { "„", "“", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -393,7 +398,7 @@ namespace PowerAccent.Core
LetterKey.VK_N => new[] { "ñ" },
LetterKey.VK_O => new[] { "ó" },
LetterKey.VK_U => new[] { "ú", "ü" },
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!" },
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!", "«", "»", "“", "”", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -411,7 +416,7 @@ namespace PowerAccent.Core
LetterKey.VK_O => new[] { "ò", "ó" },
LetterKey.VK_U => new[] { "ù", "ú", "ü" },
LetterKey.VK_L => new[] { "·" },
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!" },
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!", "«", "»", "“", "”", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -427,6 +432,7 @@ namespace PowerAccent.Core
LetterKey.VK_O => new[] { "ō" },
LetterKey.VK_S => new[] { "$" },
LetterKey.VK_U => new[] { "ū" },
LetterKey.VK_COMMA => new[] { "“", "”", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -443,6 +449,7 @@ namespace PowerAccent.Core
LetterKey.VK_N => new[] { "ñ" },
LetterKey.VK_O => new[] { "ó", "ö", "ô" },
LetterKey.VK_U => new[] { "ú", "ü", "û" },
LetterKey.VK_COMMA => new[] { "“", "„", "”", "", ",", "" },
_ => Array.Empty<string>(),
};
}
@@ -469,6 +476,7 @@ namespace PowerAccent.Core
LetterKey.VK_V => new[] { "ü", "ǖ", "ǘ", "ǚ", "ǜ" },
LetterKey.VK_Y => new[] { "¥" },
LetterKey.VK_Z => new[] { "ẑ" },
LetterKey.VK_COMMA => new[] { "“", "”", "", "", "「", "」", "『", "』" },
_ => Array.Empty<string>(),
};
}
@@ -505,6 +513,7 @@ namespace PowerAccent.Core
LetterKey.VK_S => new[] { "ş" },
LetterKey.VK_T => new[] { "₺" },
LetterKey.VK_U => new[] { "ü", "û" },
LetterKey.VK_COMMA => new[] { "“", "”", "", "", "«", "»", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -522,6 +531,7 @@ namespace PowerAccent.Core
LetterKey.VK_O => new[] { "ó" },
LetterKey.VK_S => new[] { "ś" },
LetterKey.VK_Z => new[] { "ż", "ź" },
LetterKey.VK_COMMA => new[] { "„", "”", "", "", "»", "«" },
_ => Array.Empty<string>(),
};
}
@@ -539,7 +549,7 @@ namespace PowerAccent.Core
LetterKey.VK_P => new[] { "π" },
LetterKey.VK_S => new[] { "$" },
LetterKey.VK_U => new[] { "ú" },
LetterKey.VK_COMMA => new[] { "≤", "≥", "≠", "≈", "≙", "±", "₊", "⁺" },
LetterKey.VK_COMMA => new[] { "≤", "≥", "≠", "≈", "≙", "±", "₊", "⁺", "“", "”", "", "", "«", "»" },
_ => Array.Empty<string>(),
};
}
@@ -594,6 +604,7 @@ namespace PowerAccent.Core
LetterKey.VK_U => new[] { "ú" },
LetterKey.VK_Y => new[] { "ý" },
LetterKey.VK_Z => new[] { "ž" },
LetterKey.VK_COMMA => new[] { "„", "“", "", "", "»", "«", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -608,6 +619,7 @@ namespace PowerAccent.Core
LetterKey.VK_I => new[] { "í" },
LetterKey.VK_O => new[] { "ó" },
LetterKey.VK_U => new[] { "ú" },
LetterKey.VK_COMMA => new[] { "“", "”", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -623,6 +635,7 @@ namespace PowerAccent.Core
LetterKey.VK_O => new[] { "ò" },
LetterKey.VK_P => new[] { "£" },
LetterKey.VK_U => new[] { "ù" },
LetterKey.VK_COMMA => new[] { "“", "”", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -645,6 +658,7 @@ namespace PowerAccent.Core
LetterKey.VK_U => new[] { "ů", "ú" },
LetterKey.VK_Y => new[] { "ý" },
LetterKey.VK_Z => new[] { "ž" },
LetterKey.VK_COMMA => new[] { "„", "“", "", "", "»", "«", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -659,6 +673,7 @@ namespace PowerAccent.Core
LetterKey.VK_O => new[] { "ö" },
LetterKey.VK_S => new[] { "ß" },
LetterKey.VK_U => new[] { "ü" },
LetterKey.VK_COMMA => new[] { "„", "“", "", "", "»", "«", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -689,6 +704,7 @@ namespace PowerAccent.Core
LetterKey.VK_X => new string[] { "ξ" },
LetterKey.VK_Y => new string[] { "υ" },
LetterKey.VK_Z => new string[] { "ζ" },
LetterKey.VK_COMMA => new[] { "“", "”", "«", "»", },
_ => Array.Empty<string>(),
};
}
@@ -710,7 +726,7 @@ namespace PowerAccent.Core
LetterKey.VK_U => new[] { "וֹ", "וּ", "װ", "\u05b9" },
LetterKey.VK_X => new[] { "\u05b6", "\u05b1" },
LetterKey.VK_Y => new[] { "ױ" },
LetterKey.VK_COMMA => new[] { "”", "", "״", "׳" },
LetterKey.VK_COMMA => new[] { "”", "", "'", "״", "׳" },
LetterKey.VK_PERIOD => new[] { "\u05ab", "\u05bd", "\u05bf" },
LetterKey.VK_MINUS => new[] { "", "־" },
_ => Array.Empty<string>(),
@@ -727,6 +743,7 @@ namespace PowerAccent.Core
LetterKey.VK_I => new[] { "í" },
LetterKey.VK_O => new[] { "ó", "ő", "ö" },
LetterKey.VK_U => new[] { "ú", "ű", "ü" },
LetterKey.VK_COMMA => new[] { "„", "”", "»", "«" },
_ => Array.Empty<string>(),
};
}
@@ -740,6 +757,7 @@ namespace PowerAccent.Core
LetterKey.VK_I => new[] { "î" },
LetterKey.VK_S => new[] { "ș" },
LetterKey.VK_T => new[] { "ț" },
LetterKey.VK_COMMA => new[] { "„", "”", "«", "»" },
_ => Array.Empty<string>(),
};
}
@@ -754,6 +772,7 @@ namespace PowerAccent.Core
LetterKey.VK_I => new[] { "ì", "í" },
LetterKey.VK_O => new[] { "ò", "ó" },
LetterKey.VK_U => new[] { "ù", "ú" },
LetterKey.VK_COMMA => new[] { "«", "»", "“", "”", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -772,6 +791,7 @@ namespace PowerAccent.Core
LetterKey.VK_R => new[] { "ř" },
LetterKey.VK_S => new[] { "ş" },
LetterKey.VK_U => new[] { "û", "ü" },
LetterKey.VK_COMMA => new[] { "«", "»", "“", "”" },
_ => Array.Empty<string>(),
};
}
@@ -789,6 +809,7 @@ namespace PowerAccent.Core
LetterKey.VK_U => new[] { "û", "ü", "ù", "ú" },
LetterKey.VK_Y => new[] { "ŷ", "ÿ", "ỳ", "ý" },
LetterKey.VK_W => new[] { "ŵ", "ẅ", "ẁ", "ẃ" },
LetterKey.VK_COMMA => new[] { "", "", "“", "“" },
_ => Array.Empty<string>(),
};
}
@@ -801,6 +822,7 @@ namespace PowerAccent.Core
LetterKey.VK_A => new[] { "å", "ä" },
LetterKey.VK_E => new[] { "é" },
LetterKey.VK_O => new[] { "ö" },
LetterKey.VK_COMMA => new[] { "”", "", "»", "«" },
_ => Array.Empty<string>(),
};
}
@@ -814,6 +836,7 @@ namespace PowerAccent.Core
LetterKey.VK_D => new[] { "đ" },
LetterKey.VK_S => new[] { "š" },
LetterKey.VK_Z => new[] { "ž" },
LetterKey.VK_COMMA => new[] { "„", "“", "", "", "»", "«", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -838,6 +861,7 @@ namespace PowerAccent.Core
{
LetterKey.VK_E => new[] { "ѐ" },
LetterKey.VK_I => new[] { "ѝ" },
LetterKey.VK_COMMA => new[] { "„", "“", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -869,6 +893,7 @@ namespace PowerAccent.Core
LetterKey.VK_E => new[] { "€", "é" },
LetterKey.VK_O => new[] { "ø" },
LetterKey.VK_S => new[] { "$" },
LetterKey.VK_COMMA => new[] { "«", "»", ",", "", "", "„", "“" },
_ => Array.Empty<string>(),
};
}
@@ -881,6 +906,7 @@ namespace PowerAccent.Core
LetterKey.VK_A => new[] { "å", "æ" },
LetterKey.VK_E => new[] { "€" },
LetterKey.VK_O => new[] { "ø" },
LetterKey.VK_COMMA => new[] { "»", "«", "“", "”", "", "", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -897,6 +923,7 @@ namespace PowerAccent.Core
LetterKey.VK_S => new[] { "š" },
LetterKey.VK_U => new[] { "ų", "ū" },
LetterKey.VK_Z => new[] { "ž" },
LetterKey.VK_COMMA => new[] { "„", "“", "", "" },
_ => Array.Empty<string>(),
};
}
@@ -910,6 +937,7 @@ namespace PowerAccent.Core
LetterKey.VK_E => new[] { "€" },
LetterKey.VK_S => new[] { "š" },
LetterKey.VK_Z => new[] { "ž" },
LetterKey.VK_COMMA => new[] { "„", "“", "»", "«" },
_ => Array.Empty<string>(),
};
}

View File

@@ -20,6 +20,7 @@ public partial class PowerAccent : IDisposable
// Keys that show a description (like dashes) when ShowCharacterInfoSetting is 1
private readonly LetterKey[] _letterKeysShowingDescription = new LetterKey[] { LetterKey.VK_O };
private const double ScreenMinPadding = 150;
private bool _visible;
private string[] _characters = Array.Empty<string>();
@@ -332,6 +333,11 @@ public partial class PowerAccent : IDisposable
return Calculation.GetRawCoordinatesFromPosition(position, screen, window);
}
public double GetDisplayMaxWidth()
{
return WindowsFunctions.GetActiveDisplay().Size.Width - ScreenMinPadding;
}
public Position GetToolbarPosition()
{
return _settingService.Position;

View File

@@ -59,6 +59,7 @@ public partial class Selector : FluentWindow, IDisposable, INotifyPropertyChange
_selectedIndex = index;
characters.SelectedIndex = _selectedIndex;
characterName.Text = _powerAccent.CharacterDescriptions[_selectedIndex];
characters.ScrollIntoView(character);
}
private void PowerAccent_OnChangeDisplay(bool isActive, string[] chars)
@@ -73,6 +74,7 @@ public partial class Selector : FluentWindow, IDisposable, INotifyPropertyChange
characters.ItemsSource = chars;
characters.SelectedIndex = _selectedIndex;
this.UpdateLayout(); // Required for filling the actual width/height before positioning.
SetWindowsSize();
SetWindowPosition();
Show();
Microsoft.PowerToys.Telemetry.PowerToysTelemetry.Log.WriteEvent(new PowerAccent.Core.Telemetry.PowerAccentShowAccentMenuEvent());
@@ -96,6 +98,11 @@ public partial class Selector : FluentWindow, IDisposable, INotifyPropertyChange
this.Top = position.Y;
}
private void SetWindowsSize()
{
this.characters.MaxWidth = _powerAccent.GetDisplayMaxWidth();
}
protected override void OnClosed(EventArgs e)
{
_powerAccent.SaveUsageInfo();

Binary file not shown.

View File

@@ -638,9 +638,6 @@ Please review the placeholder content that represents the final terms and usage
<data name="AdvancedPaste_EnableAIDialogAcceptanceCheckBox.Content" xml:space="preserve">
<value>I have read and accept the information above.</value>
</data>
<data name="AdvancedPaste_EnableAdvancedAIModerationToggle.Content" xml:space="preserve">
<value>Enable OpenAI content moderation</value>
</data>
<data name="AdvancedPaste_EnablePasteAIModerationToggle.Header" xml:space="preserve">
<value>Enable OpenAI content moderation</value>
</data>
@@ -2092,9 +2089,6 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="TranscodeToMp4.Header" xml:space="preserve">
<value>Transcode to .mp4 (H.264/AAC)</value>
</data>
<data name="AdvancedPaste_EnableAIDialogOpenAIApiKey.Text" xml:space="preserve">
<value>OpenAI API key:</value>
</data>
<data name="EnableAIDialog_SaveBtnText" xml:space="preserve">
<value>Save</value>
</data>
@@ -4029,7 +4023,7 @@ Activate by holding the key for the character you want to add an accent to, then
<comment>Product name: Navigation view item name for Advanced Paste</comment>
</data>
<data name="AdvancedPaste.ModuleDescription" xml:space="preserve">
<value>A tool to quickly format clipboard content into plain text, Markdown, JSON, and more. An AI-powered option requiring an OpenAI API key is available for advanced formatting.</value>
<value>Formats clipboard content into plain text, Markdown, JSON, and more. Advanced formatting can use an online or local language model endpoint.</value>
</data>
<data name="AdvancedPaste.ModuleTitle" xml:space="preserve">
<value>Advanced Paste</value>
@@ -4559,18 +4553,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="TermsLink.Text" xml:space="preserve">
<value>OpenAI Terms</value>
</data>
<data name="AdvancedPaste_EnableAIDialog_Description.Text" xml:space="preserve">
<value>Paste with AI allows you to format your clipboard content into any format you need. Learn more about the terms of conditions while using OpenAI and privacy at Microsoft:</value>
</data>
<data name="AdvancedPaste_EnableAIDialog_LoginIntoText.Text" xml:space="preserve">
<value>• Login into your</value>
</data>
<data name="AdvancedPaste_EnableAIDialog_ConfigureOpenAIKey.Text" xml:space="preserve">
<value>Configure OpenAI key</value>
</data>
<data name="AdvancedPaste_EnableAIDialog_OpenAIApiKeysOverviewText.Text" xml:space="preserve">
<value>OpenAI API keys overview</value>
</data>
<data name="AdvancedPaste_EnableAIDialog_CreateNewKeyText.Text" xml:space="preserve">
<value>• Create a new secret key and paste it in the field below</value>
</data>
@@ -4588,9 +4573,6 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="Peek_SourceCode_FontSize.Header" xml:space="preserve">
<value>Font size</value>
</data>
<data name="AdvancedPaste_EnableAIDialog_NoteAICreditsText.Text" xml:space="preserve">
<value>• NOTE: You need to have available paid credits in your OpenAI account to use this feature. If you do not have credits you will see an 'API key quota exceeded' error</value>
</data>
<data name="AdvancedPaste_EnableAIDialog_NoteAICreditsErrorText.Text" xml:space="preserve">
<value>If you do not have credits you will see an 'API key quota exceeded' error</value>
</data>