Commit Graph

6346 Commits

Author SHA1 Message Date
Yawen Hou
b075c00f2b
[Peek] Add cancellation token OnFilePropertyChanged (#22643)
* Cancel file loading before opening another file

* Add omitted cancellation checks

* Catch task cancelled exception; Add more cancellation checkpoints

* Add cancellation checkpoint beofre GetBitmapFromHBitmapAsync

* Correct typo

* Update to pass cancellation token individually to each async methods

* Add lost cancellationToken source

* Add cancellation token to PngPreviewer

Co-authored-by: Yawen Hou <yawenhou@microsoft.com>
2022-12-09 11:25:51 -05:00
Samuel Chapleau
496220f77e
[Peek] Window foregrounding simplification and fixes + keep window visible if FE single selection changed (#22657)
* Use different apis to bring to foreground removing remote thread wait and work as well as library loading

* Keep window open if single selected file in FE is different

* Removed unused methods
2022-12-08 22:38:52 -08:00
Robson
195f14a3c7
Add full image quality support (#22654) 2022-12-08 17:45:39 -08:00
Jojo Zhou
60bf86825b
[Peek] Add tooltip to File (#22640)
* Add tooltip to File

* Add placeholder text for no tooltip

* Address comments

* Use StringBuilder

Co-authored-by: Jojo Zhou <yizzho@microsoft.com>
2022-12-08 15:55:28 -08:00
sujessie
4ef3f23897
[Peek] Unsupported File Previewer - Setting Window Size (#22645)
* Adding setting for unsupported file window

* Fix
2022-12-08 15:44:42 -08:00
Robson
5bd9dd5935
[Peek] add extra logic to properly render PNG files with transparency (#22613)
* [Peek] added extra logic to render PNG files with proper transparency

* Moved logic to ThumbnailHelper
Cleanup

* Created a separated previewer for PNG to only load the preview image with thumbnail logic

* removed unused code

* Updated state loading change
2022-12-08 15:42:38 -08:00
Michael Salmon
5590eb9484
[Peek] New File Explorer tabs break Shell API to get selected files (#22641)
* fix FE tab bug

* remove unnecessary unsafe keyword
2022-12-08 15:39:14 -08:00
Jojo Zhou
6f06f76784
[Peek] Refine titlebar adaptive width (#22642)
* Adjust adaptive width of titlebar

* Remove visualstate setters for AppTitle_FileCount

Co-authored-by: Jojo Zhou <yizzho@microsoft.com>
2022-12-08 15:06:16 -08:00
Robson
5981d0e81e
[Peek] add PDF viewing support (#22636)
* [Peek] add PDF viewing support

* Fixed issue which would redirect some HTML and PDF files to external browser

* Fixed refactored interface name
2022-12-08 13:41:02 -08:00
Michael Salmon
539a4e5678
[Peek] ImagePreviewer - Handle error states (#22637)
* add better preview state handling

* add error handling in imagepreviewer and better state handling

* fix error handling so exception is not bubbled up

* improve performance and hook up unsupported previewer on error

* remove commented code

* address pr comments
2022-12-08 11:25:29 -08:00
Daniel Chau
aea217ddca
[Peek] Fix foregrounding (#22633)
* Fixing foregrounding

* Get window handle inside BringToForeground extension method

Co-authored-by: Daniel Chau <dancha@microsoft.com>
Co-authored-by: Samuel Chapleau <sachaple@microsoft.com>
2022-12-08 10:11:24 -08:00
sujessie
d001a4c0e0
[Peek] Unsupported File Previewer - Formatting string from resources (#22609)
* Moving to string resource usage

* Moving ReadableStringHelper to common project

* Fix comments
2022-12-08 09:49:00 -08:00
Samuel Chapleau
5712123598 Fix titlebar draggable region and interactive region (bump WinAppSdk to latest) 2022-12-07 22:57:45 -08:00
Samuel Chapleau
e504653323 Update titlebar filecount text 2022-12-07 20:47:35 -08:00
Esteban Margaron
b46b8d176f Make CurrentItemIndex setter private 2022-12-07 18:51:02 -08:00
Esteban Margaron
b98f233b75 Fix wrong thread exception 2022-12-07 18:45:11 -08:00
Samuel Chapleau
083ec27a45 Fix crash 2022-12-07 18:02:26 -08:00
Yawen Hou
bca780f886
[Peek] Add customized title bar (#22600)
* Add basic button UI

* Add function to get default app name and to open file in default app

* Correct error output

* Add filename to titlebar

* Remove titlebar text from Resw

* Add basic button UI

* Add function to get default app name and to open file in default app

* Add filename to titlebar

* Correct error output

* Remove titlebar text from Resw

* Add SetDragRectangles

* Correct logic, update function name

* Add localization

* Cleanup and adaptive width

* Add fileIndex/NumberOfFiles for multiple files activation

* Refine titlebar styles

* Update error message; Return HResult from native methods; Update variable initialisation and string null testing

* Titlebar height and adaptive width refinement

* Add fallback to launch app picker if fail to open default app

* Temp change to hide AppTitle_FileCount

* Update launch button to command; Add keyboard accelerator

* Update titlebar inactive background color

* Update tooltip to add keyboard accelerator

* Add comments to resw file

* Fix accidental deletion from previous merge

Co-authored-by: Jojo Zhou <yizzho@microsoft.com>
Co-authored-by: Yawen Hou <yawenhou@microsoft.com>
2022-12-07 16:56:01 -08:00
estebanm123
d4e618cdc9
[Peek] Add basic file querying and navigation (#22589)
* Refactor to facilitate file data initialization

* Extract file-related code to new FileManager class

* Add temp basic version

* Clean + add todo for cancellations

* Fix various nav-related issues

* Temp - start moving iteration-related code to bg thread

* Minor tweaks

* Add FEHelper todo

* Rename FileManager + various tweaks

* Add basic throttling

* Improve bg thread synchronization

* Clean

* Clean

* Rename based on feedback

* Rename FileQuery

* Rename properties

* Rename remaining fields

* Add todos for nav success/failures

Co-authored-by: Esteban Margaron <emargaron@microsoft.com>
2022-12-07 15:03:50 -08:00
Robson
e1cb01d188
[Peek] Add WebView2 integration (#22506)
* First commit with WIP logic to support WV2 in Peek module

* Minor code cleanup and try/catch block

* Added control to wrap WebView2 logic

* Cleanup

* Added logic to handle HTML previewing
Properly update FilePreview according to file type

* Code cleanup
Updated comments

* Updated comment

* Removed comment

* Code cleanup

* Improved opening of web browser preview to avoid "blank" or "seeing previous page" issue
Removed unused method
Added xaml fallback to guarantee default/starting state

* Removed folder

* Updated factory logic to match master

* address code review

* addressed PR review

* address PR review

* Address PR review

* address PR review

* Address PR review
2022-12-07 14:24:18 -08:00
sujessie
bddfe42d39
[Peek] Adding unsupported file previewer (#22598)
* Unsupported file previewer

* Fix file display info

* Fix property store calls

* Update TODO
2022-12-07 13:07:21 -08:00
Daniel Chau
30d346c93f
[Peek] Enable PropertyStore for offline files (#22567)
* Enabling PropertyStore for offline files

Co-authored-by: Daniel Chau <dancha@microsoft.com>
2022-12-07 11:20:39 -05:00
Samuel Chapleau
899b5016b9
[Peek] Fix installer builds, project configs and update assets (#22540)
* Update installer

* Fix installer errors

* Fix peek vcxproj

* Add package signing

* Add peek to arm64

* Add back ARM64 toMeasureToolUI

* Add versions to project

* Update assets and icons

* Add correct icon
2022-12-06 18:14:57 -08:00
Samuel Chapleau
0d05089316
Add scale awareness to window centering (#22541) 2022-12-06 17:52:38 -08:00
jth-ms
6295ed86ca
Juliata/filetypes (#22538)
* Using the same list of file extensions as Lightbox's AppxManifest, and ensuring we convert file extension to lowercase

* Add IsFileTypeSupported to IPreviewer

* respond to PR comments
2022-12-06 17:18:20 -08:00
Daniel Chau
73925885dd
[Peek] Fetching image size through PropertyStore (#22530)
* Fetching metadata from PropertySTore

* Releasing objects to fix crash

* Creating new PropertyHelper

Co-authored-by: Daniel Chau <dancha@microsoft.com>
2022-12-06 15:28:48 -08:00
Michael Salmon
437d2dd5f7
[Peek] Plugin pattern to enable any file type previewing (#22475) 2022-12-06 11:24:21 -08:00
Samuel Chapleau
a4bd09a2c8 Bump Microsoft.Windows.SDK.BuildTools version 2022-12-05 16:00:31 -08:00
Samuel Chapleau
c2aae52bba
Peek (#22498)
* Add peek dll project

* add spacebar preview and launch on hotkey press

* add todo

* add process handle to handle continuous press of hotkey

* add tool to stop all powertoys processes

* Add a blank Peek page and update nav menu

* Add some initial content to Peek page including a toggle

* refactor settings parsing

* rename spacebar peek to peek viewer

* rename script to stop powertoys processes

* remove tool

* Adding FileUtils for retrieving selected file in File Explorer

* Remove unnecessary SndPeekSettings

* Add shortcut setting

* Set the shortcut to ctrl+space

* Launching viewer with selected FE file

* Add PeekUI WinUI3 project with interop events

* Moving FileTypeUtils into PeekFileUtils project

* execute winui3 app on hotkey

* Fix paths with spaces

* remove winui3 project

* Resolve comment

* add wpf app with toggle visibility on hotkey

* fix visibility on startup

* remove window properties and add todos

* Fixed hidden extension and system file handling

* wip

* Add working WPF app with FileExplorer querying

* remove c++ projects

* Move native awaiter

* Working Image control with image files

* Resize and move window based on explorer monitor

* Image render, window positioning and sizing clean up

* add window management logic and selection logic

* add extension methods to add circular iterating capability to linkedlistnode

* Add OnArrowKeyPresshandler

* Added titlebar with file name and scaling with titlebar height

* fix flashing window on startup and process kept alive when powertoys exits

* remove wait for debugger loop in ui

* Add KeyIsDown method

* Fix KeyDown issue with Key handled and check for repeat

* Add thumbnail logic

* Add all folder items if only one item is selected

* File type helper

* Using hresult

* Add cancellation and rotation handling

* Use extension instead of path

* fIX CONFLICTS

* Fixing some file type checks

* Add new icon for Peek

* Update page with the new Peek icon

* Initialize IsEnabled and hook ActivationShortcut to dllmain

* add icon to taskbar and titlebar

* Add theme sensitive backgrounds

* rename event handlers

* add settings image

* Move window data into obserable object

* Refactor viewmodel, interop and helpers

* Clean up

* Add loading spinner

* Add todos

* Fix conflicts

* Move native code into its own folder

* Add peek to installer

* Fix building peek and peekui projects

* Replace UWP namespaces to WinAppSDK

* Working WASDK placeholder project

* Add exit when powertoys runner exit

* Working winui3 with image display

* Add WIC project with <TreatWarningAsErros> false for now

* Fit content to window

* Use Size from Windows.Foundation

* Change order

* Add some todos

* Refactored native/interop code and added helpers to imagepreviewer

* Rename projects

* Move some code

* Remove using

Co-authored-by: Michael Salmon <miksalmon@users.noreply.github.com>
Co-authored-by: Michael Salmon 🐟 <michaelpsalmon@outlook.com>
Co-authored-by: Alireza Ebadi Ghajari <alirezae@microsoft.com>
Co-authored-by: Jessie Su <Jessie.Su@microsoft.com>
Co-authored-by: sujessie <102062556+sujessie@users.noreply.github.com>
2022-12-05 09:16:06 -08:00
Jaime Bernardo
df0a14403c
[ci]Fix duplicate resource and unsigned dll (#22450)
* [ci][Settings]Fix blue duplicate resource entry

* [ci]also fix unsigned file
2022-12-05 09:08:23 +00:00
Taras
3afa124bea
[QuickAccent]Fix showing selector window (#22435)
* [Quick Accent] fix showing selector window

* Update layout before using size to calculate position

* Correct offset issues due to margin

* Up the offset to 24, as the margin value removed
2022-12-04 22:28:05 +00:00
Laszlo Nemeth
ec0fb6a4c7
[ColorPicker]Custom color formats (#22141)
* [ColorPicker] Development: custom color formats, first steps

* ColorPicker development of custom format handling.

* Custom color format developmnet.
Added common helper class for format string
Fixed settings loading
Added numbering if default name exists   (My format (1))

* Custom color format implementation.
Extended the colorPicker settings with the format string
Updated the color to string conversion

* Custom color format in color picker, development.
Adding edit, delete buttons. Implement functionality
Re-arranging settings panel (newly created formats at the top)
Implementing details (valid parameters, more format elements, more types)

* Minor commit

* Development color picker custom formats. "Last" steps.
Replacing hard coded english strings with resources, polishing.

* Adding help to the format edit dialog.

* Undoing changes unwillingly commited in Host module

* Fixing bug unable to delete a custom format after renaming it - use the colorformat object as reference (and not the name)
Modifying the default custom formula
Removing unnecessary using directives

* Udating the default user defined color format

* Removing unnecessary using directive

* ColorPicker Implementing custom color formats: adding custom formats to the default format selection (dropdown box).

* Fix binding of name and example

* Custom color formats, implemented steps:
vorwarts compatibility loading settings.
Fixed UI as requested (removed one settings panel, added button to the first panel)

* Minor change in the UI: description modified

* ColorPicker Custom Color Formats develepoment.
Added conversion from old predefined formats to customizable formats.
Extended default settings (in case settings file is deleted/corrupted).
Minor fixes.

* Fixing color format parameters.
Implementing 3 different Saturation calculations, 2 Hue calculations and 2 Lightness calculations (depending color format)

* Color Picker: New/Edit Color format. Fixing bug when cancelling addition/edit

* ColorPicker. Updating help section, available parameters

* Fix spellchecker

* Remove the MinWidth so that scrollviewers can be drawn

* ColorPicker bugfix: Not allowing to delete the last color format.
2022-12-02 16:44:53 +00:00
Jeff Lord
77dfaab17e
[Settings]Add custom-layouts.json to backup/restore (#22357) 2022-12-02 14:51:09 +00:00
Aaron Junker
e731cc04c1
[QuickAccent] Add description of current selected letter (#20587)
* Adding unicode names and adjusting UI (WIP)

* Added changing letter names

* Add optioins to hide description (WIP)

* WIP

* Change to binding property

* Adress PR comments

* Set TextBlock in border

* * Added to settings
* Fixed string showing/not showing one time after switching character
* Removed unneccessairy command in SettingsService.cs
* Moved showdescription enum to settings.ui

* Adding Fluent design :)

* Fix merge errors

* Center list

* Fixed code not working. Accepted some code style changes.

* Merge main in branch #2

* [Quick Accent] support unicode description for UTF-16 surrogate pairs

* [Quick Accent] fix check-spelling-bot errors

* [check-spelling] accept LANGID as correct word

* [Quick Accent] fix delay when calling ShowToolbar for the first time

* [Quick Accent] use toggle switch to turn off/on Unicode description

* [Quick Accent] fix after merge

* [Quick Accent] add UnicodeInformation.dll to installer

Co-authored-by: Niels Laute <niels.laute@live.nl>
2022-12-02 14:45:49 +00:00
Seraphima Zykova
eca77ad8b3
[FancyZones]Fix snap by hotkey for single-zone layouts (#22373)
* unsnap window from previous work area when snapping by hotkey
2022-12-02 10:29:11 +00:00
Jeremy Sinclair
a7bd0cfde8
[deps]Upgrade to .NET 7 (#20979)
* Update projects to .NET 7

* Updated packages to 7.0-rc1

* [ColorPicker] Wrap WM_KEYUP param in unchecked context

* [PTRun][OneNote] Added a NoWarn to CS8981

* [MeasureTool] Wrap buffer in wstring_view in SetClipBoardToText

* Target .NET 7 for PowerToys.Interop

* Update publish profiles

* Removed System.Text.Json.dll from Product.wxs since it's included in .NET 7

* Use .NET 7 in CI

* Removed individual CodeAnalysis package from projects

* Updated CodeAnalysis package in Directory.Build.props

* Updated NuGet packages to latest 7.0 rc2

* Fix merge mistake with Settings.UI.Library project

* Updated installer with .NET 7 RC2 install

* [GPOWrapper] Updated GPOWrapperProjection to .NET 7

* [FileLockSmith] Updated to .NET 7

* [FileLocksmith] Update Interop to .NET 7

* Upgrade .NET 7 specific libraries to GA version

* [PowerToysSetup] Updated .NET 7 urls to GA

* [CI] removed .NET 7 SDK preview version from UseDotNet task

* [PowerToysSetup] Update HasDotnet variable name

* [PowerToysInterop] Downgrade target back to .NET 6

* [FileLockSmith] Downgrade Interop library back to .NET 6

* Revert "[FileLockSmith] Downgrade Interop library back to .NET 6"

This reverts commit 356ad048e3.

* Revert "[PowerToysInterop] Downgrade target back to .NET 6"

This reverts commit 74dbcfdefe.

* [Analyzers][CPP] Disable warning for 4679 caused by .NET 7 in C++/CLI

* [CI] Set maximum cpu count to 2 for PowerToys.sln build

* [CI] Set maximumCpuCount to false in hopes of arm64 working

* Changed .NET 7 runtime display name

* [ci] Use .net 7 sdk
2022-12-01 14:40:41 +00:00
Taras
f51dacff08
[QuickAccent]Add Irish and Scottish language accents (#22350)
* [Quick Accent] add Irish Gaelic language accents

* [Quick Accent] add Scottish Gaelic language accents

* Fix spellcheck

* Add comments for localization
2022-11-30 17:48:03 +00:00
Dustin L. Howett
57c5575a8d
[release] Move NuGet feed from CDPx to DART (#22363)
* [release] Move NuGet feed from CDPx to DART

Since the release pipeline is run in the DART Azure DevOps project, we
no longer need to authenticate against it. The build agent will be
running with a token that allows access.

* restore nuget.config

* We should still authenticate against this org, not a specific feed

* rename the feed

* whoa whoa whoa okay

* [ci]Conditionally add labs package except in Dart (#22294)

* Propagate Jaime's change

Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2022-11-30 14:08:01 +00:00
Dustin L. Howett
5e2df77da7
Fix spelling error 'culinfo' (#22364) 2022-11-29 19:32:07 -06:00
Dustin L. Howett
c059977c78 Merge commit '8499a44df' (merge-base for check-spelling 0.0.21) 2022-11-29 12:08:53 -08:00
Dustin L. Howett
8499a44dfe Cherry-pick the check-spelling v0.0.21 changes to the oldest merge base 2022-11-29 11:50:57 -08:00
Josh Soref
150e7d40dd
Check spelling 0 0 21 (#22335) 2022-11-29 11:41:22 -08:00
sosssego
ca8faf00c2
Turn on warnings 6031, 26451, 28182 (#22240)
6031 - Return value ignored: 'called-function' could return unexpected value
26451 - Arithmetic overflow: Using operator 'operator' on a size-a byte value and then casting the result to a size-b byte value. Cast the value to the wider type before calling operator 'operator' to avoid overflow (io.2)
28182 - Dereferencing NULL pointer.
2022-11-29 15:01:27 +00:00
Tantalus13A98B5F
4af508c532
[PTRun][UnitConverter]Use English abbreviations as fallback for meters (#22270) 2022-11-29 14:54:02 +00:00
sosssego
6a6c45189e
[Analyzers][CPP] Turn on warning 4458 (#22265)
* Turn on warning 4458

Fix the errors by changing variable names and
supressing the warning on winRT GDI headers

* explaining the warning disables
2022-11-29 14:10:48 +00:00
Jaime Bernardo
21a9c82df4
[Installer]Update .NET to 6.0.11 (#22353) 2022-11-29 12:51:52 +00:00
sosssego
4a087a816e
[Analyzers][CPP] Turn on warning 4459 (#22234)
* Turn on warning 4459

* minor format
2022-11-29 12:41:57 +00:00
Jay
a98b12a2fb
[Settings]Fix/improve settings/oobe text (#22276)
* correct the uid

* Remove periods and generalize "Appearance & behavior" uid

Descriptions don't need a period, unless they're full sentences.

* simplify bold text to interactive elements

the 3 changes from bold to code are for readability

* rev feet

* -1 ing
2022-11-29 12:36:39 +00:00
Jaime Bernardo
77ed74b353
[QuickAccent]Upgrade Vanara.Invoke dependencies to 3.4.11 (#22351) 2022-11-29 12:08:01 +00:00
damienleroy
357fb8f66d
[Quick Accent] Add Serbian language accents (#22288) 2022-11-26 20:46:07 +02:00