Commit graph

18 commits

Author SHA1 Message Date
Matt Bierner 7a4880a6bd Add some extra guards around image loading 2020-05-27 19:56:02 -07:00
Matt Bierner a0328d26ac Add 'vscode.reopenWith' API command
Fixes #88426

Add an api command that allows extensions to open/reopen a file with a specific we custom editor. Use this to allow re-opening a failed to load image as text/binary

For #77131
2020-01-10 14:25:21 -08:00
OneQuid ba19fe0e9b Fix opening image with '%' in the filename (#84667) 2019-11-15 18:14:30 -08:00
Matt Bierner cfbf6b58f6 Better fix for disabling pinch to zoom in a webview zooming the entire editor in chrome
Fixes #84406
2019-11-12 15:41:41 -08:00
MartinBrathen c53db9ba76 Fix zoom on first click (#83826)
* no zoom on fast click

* fixed a visual bug where the zoom-in icon would show briefly before zoom-out on first click when ctrl/alt is pressed
2019-11-05 15:00:34 -08:00
Matt Bierner 31f577ec88 Prevent default zoom behavior in image preview for browsers 2019-10-29 17:04:05 -07:00
Matt Bierner 175b3fefd7 Use vendor specific use-select to make Safari happy
Fixes #83600
2019-10-29 16:59:31 -07:00
Matt Bierner 6803eba9fe Add zoomIn and zoomOut commands for image preview
Fixes #71653

Adds two new commands, `imagePreview.zoomIn` and `imagePreview.zoomOut`. These zoom the active image preview in or out. They have no default keybinding but users can configure one for them
2019-10-22 17:11:31 -07:00
Matt Bierner dd51127323 Remove preventDefault call that was causing warning in chrome
Not sure why this was added originally but in my testing it does not seem to be required
2019-10-22 16:43:49 -07:00
MartinBrathen 9048856bf3 Fixed: Image preview should not zoom on first click if unfocused (#82074)
* Fixed a bug where first click on an unfocused image preview would zoom

* added two spaces

* removed unnecessary state variable

* User now has ability to enter zoom-out mode on first click

* removed some code that was not needed

* removed useless if statement
2019-10-14 14:55:16 -07:00
U-ways 095358e3b2 fix image preview to show correct canvas size when editor is scaled down vertically (#82027)
See issue #81878
2019-10-07 14:48:49 -07:00
Jean Pierre 096eb643d1 Fixes #81876 (#81885) 2019-10-03 11:27:40 -07:00
Matt Bierner b058a2831a Correctly style image loading indicator for various themes
Wrong class name was being used
2019-10-02 10:44:00 -07:00
Matt Bierner 04d0cf6ad6 Show errors when image can't be loaded
For #81803
2019-10-01 16:17:48 -07:00
Matt Bierner 408a3eb7bb Add loading indicator while image is loading in image preview
Fixes #81571
2019-09-27 14:50:43 -07:00
Matt Bierner d9950173c1 Draw image border for custom image editor 2019-09-26 16:10:48 -07:00
Matt Bierner 11c451728a Fix potential race detecting image load 2019-09-13 17:19:57 -07:00
Matt Bierner 011836a150
Prototyping custom editors (#77789)
* Custom Editor exploration

For #77131

Adds a prototype of custom editors contributed by extensions. This change does the following:

- Introduces a new contribution point for the declarative parts of a custom editor
- Adds API for registering a webview editor provider. This lets VS Code decided when to create a webview editor
- Adds an `openWith` command that lets you select which editor to use to open a resource from the file explorer
- Adds a setting that lets you say that you always want to use a custom editor for a given file extension
- Hooks up auto opening of a custom editor when opening a file from quick open or explorer
- Adds a new extension that contributes a custom image preview for png and jpg files

Still needs a lot of UX work and testing. We are also going to explore a more generic "open handler" based approach for supporting custom editors

Revert

* Re-use existing custom editor if one is already open

* Don't re-create custom editor webview when clicking on already visible custom editor

* Move customEditorInput to own file

* First draft of serializing custom editor inputs

* Use glob patterns instead of simple file extensions for matching custom resoruces for custom editors

* Add descriptions

* Try opening standard editor while prompting for custom editor

* Make sure we hide image status on dispose

* Make sure we restore editor group too

* Use glob patterns for workbench.editor.custom

* Allow users to configure custom editors for additional file types

* Use filename glob instead of glob on full resource path

* Adding placeholder for prompt open with

* Add enableByDefault setting for editor contributions

* Enable custom editors by default and add `discretion` enum

Changes `enableByDefault` boolean to a `discretion` enum. This should give more flexibility if we want other options (such as forcing a given custom editor to always be used even if there are other default ones)

* Allow custom editors to specify both a scheme and filenamePattern they are active for

* Rework custom editor setting

* Don't allow custom editors to be enabled for all resources by a config mistake

* Replace built-in image editor with one from extension

* Adding reopen with command

* Improve comment

* Remove commented code

* Localize package.json and remove image

* Remove extra lib setting from tsconfig
2019-09-10 17:56:57 -07:00