-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Clipboard History #151
base: main
Are you sure you want to change the base?
Conversation
This adds a magic helper to load icons for us. Any time you want an icon, just do this: ```xaml <Border Width="16" Height="16" Margin="4,4,4,4"> <Interactivity:Interaction.Behaviors> <cmdpalUI:LoadIconBehavior Source="{x:Bind ViewModel.PrimaryAction.Icon, Mode=OneWay}"/> </Interactivity:Interaction.Behaviors> </Border> ``` And that'll magically give us a border filled with the icon, and updating with the binding. I believe it'll also work with `IRandomAccessStreamReference`s, but I didn't actually test that with #151 yet. I didn't actually implement the "caching" bit of this yet. That'll involve doing some locking per-key inside the factory and I didn't want to futz with that in this initial PR to restore icons --------- Co-authored-by: Mike Griese <[email protected]>
For my own notes:
|
GAH we can't use randomaccessstreams in icons till #333 is fixed |
(cherry picked from commit 6eab9df)
go look at f25302a |
namespace Microsoft.CmdPal.UI.Deferred; | ||
|
||
/// <summary> | ||
/// Extensions to <see cref="TypedEventHandler{TSender, TResult}"/> for Deferred Events. |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
namespace Microsoft.CmdPal.UI.Deferred; | ||
|
||
/// <summary> | ||
/// Extensions to <see cref="TypedEventHandler{TSender, TResult}"/> for Deferred Events. |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
public static class TypedEventHandlerExtensions | ||
{ | ||
/// <summary> | ||
/// Use to invoke an async <see cref="TypedEventHandler{TSender, TResult}"/> using <see cref="DeferredEventArgs"/>. |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
public static class TypedEventHandlerExtensions | ||
{ | ||
/// <summary> | ||
/// Use to invoke an async <see cref="TypedEventHandler{TSender, TResult}"/> using <see cref="DeferredEventArgs"/>. |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
/// </summary> | ||
/// <typeparam name="S">Type of sender.</typeparam> | ||
/// <typeparam name="R"><see cref="EventArgs"/> type.</typeparam> | ||
/// <param name="eventHandler"><see cref="TypedEventHandler{TSender, TResult}"/> to be invoked.</param> |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
/// </summary> | ||
/// <typeparam name="S">Type of sender.</typeparam> | ||
/// <typeparam name="R"><see cref="EventArgs"/> type.</typeparam> | ||
/// <param name="eventHandler"><see cref="TypedEventHandler{TSender, TResult}"/> to be invoked.</param> |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
where R : DeferredEventArgs => InvokeAsync(eventHandler, sender, eventArgs, CancellationToken.None); | ||
|
||
/// <summary> | ||
/// Use to invoke an async <see cref="TypedEventHandler{TSender, TResult}"/> using <see cref="DeferredEventArgs"/> with a <see cref="CancellationToken"/>. |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
where R : DeferredEventArgs => InvokeAsync(eventHandler, sender, eventArgs, CancellationToken.None); | ||
|
||
/// <summary> | ||
/// Use to invoke an async <see cref="TypedEventHandler{TSender, TResult}"/> using <see cref="DeferredEventArgs"/> with a <see cref="CancellationToken"/>. |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
/// </summary> | ||
/// <typeparam name="S">Type of sender.</typeparam> | ||
/// <typeparam name="R"><see cref="EventArgs"/> type.</typeparam> | ||
/// <param name="eventHandler"><see cref="TypedEventHandler{TSender, TResult}"/> to be invoked.</param> |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
/// </summary> | ||
/// <typeparam name="S">Type of sender.</typeparam> | ||
/// <typeparam name="R"><see cref="EventArgs"/> type.</typeparam> | ||
/// <param name="eventHandler"><see cref="TypedEventHandler{TSender, TResult}"/> to be invoked.</param> |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.Unrecognized words (2)TResult These words are not needed and should be removedAVery mtu rsdkTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the [email protected]:zadjii-msft/PowerToys.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.24/apply.pl' |
perl - 'https://github.com/zadjii-msft/PowerToys/actions/runs/13156797219/attempts/1'
OR To have the bot accept them for you, comment in the PR quoting the following line: Errors (1)See the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
This is at a reasonable place right now, but still needs some TLC before it is finished... and I got a little stuck so switching gears for sanity's sake.
My primary issue was trying to figure out how to use IRandomAccessStream as a valid ctor param and wiring that all up... I tried... and I'm reverting back to this commit and PR.Here are the main things that need to be added:
CommandResult.Dismiss()
not giving the right level of focus back to the window before (e.g. Word has cursor focus, command palette is launched, command is invoked,dismiss()
is called, Word should have focus WITH the cursor again)ShowToast
result when copying