Commit Graph

52 Commits

Author SHA1 Message Date
Matt Bierner
8e475f9b24 Implement draft 2 from #86802 (#87117) 2019-12-16 14:18:58 -08:00
Matt Bierner
5a84679fd7 Remove tga from documented supported image format list
For #84533
2019-12-04 15:37:49 -08:00
Matt Bierner
b0fb9f17da Note image preview's extension kind
For #85819
2019-12-02 15:43:37 -08:00
Matt Bierner
028e009ea2 Better name 2019-11-22 15:18:01 -08:00
Matt Bierner
71c3136106 Extract out common status bar entry management code 2019-11-22 15:18:01 -08:00
Matt Bierner
aaa01eac73 Make previewManager implement WebviewEditorProvider directly 2019-11-22 15:18:01 -08:00
Matt Bierner
f085deb2e0 Remove test editing code from preview 2019-11-22 15:18:01 -08:00
Jean Pierre
56a544b36c Don't encode image resource URI twice (#85355) 2019-11-22 14:33:33 -08:00
Matt Bierner
d9c4923f98 Fix trailiing comma 2019-11-20 21:36:05 -08:00
Matt Bierner
8fa16bd74f Remove custom editor support for data uris
For #85203. Data uris are no longer used by VS Code core
2019-11-20 21:35:29 -08:00
Matt Bierner
8caf39ef37 Fix loading of images with spaces in the name
Partially revert #84667

Also seems to fix #85190
2019-11-20 11:43:09 -08:00
Matt Bierner
8bbe3157f0 Trying to hook up basic save for custom editors 2019-11-18 11:27:45 -08:00
Matt Bierner
27a33ee6fe Hook up very basic undo/redo for webview editors
For #77131
2019-11-15 18:21:46 -08:00
OneQuid
ba19fe0e9b Fix opening image with '%' in the filename (#84667) 2019-11-15 18:14:30 -08:00
Matt Bierner
2dc8bac0a3 Use undefined instead of -1 to indicate that there is no size yet 2019-11-15 15:06:24 -08:00
Matt Bierner
d628c3b82e Make sure we call update after the binary size of the image is computed
Fixes a possible race if the dimensions of the image are computed before the get the size (which is unlikely but possible)
2019-11-15 15:05:01 -08:00
Shizeng Zhou
14e6ad3138 Fix #84111 (#84610)
* Fix #84111

* Replace fs with vscode's fs

* Put binary size in the binarySizeStatusBar
2019-11-15 15:02:09 -08:00
Matt Bierner
60f8583d95 Adding setting to enable a test command for making a fake "edit" to an image preview
This will be use for testing custom editors
2019-11-12 16:08:04 -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
Matt Bierner
f50c8264fa Don't try rendering TGAs in the built-in image preview
Fixes #84533

Looks like tga is not currently supported by Chrome
2019-11-12 14:36:22 -08:00
Eric Amodio
8e94fc342b Fixes uri issue with remote uris w/ querystrings 2019-11-11 14:41:42 -05:00
Matt Bierner
278b4f8cfa Hookup experimental undo for customEditors
This currently is not connected to any actual actions in the editor
2019-11-07 17:22:21 -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
dcecb9eea6 Documenting thoughts on direction for custom editor API
This documents the current thinking on the custom editor api. The current api proposal is not actually implemented yet
2019-11-04 15:11:54 -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
Matt Bierner
f462eab969 Adding builtin priority for custom editors 2019-10-15 16:45:15 -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
Matt Bierner
bac36e97c6 Close image preview when file on disk is deleted
Fixes #81884
2019-10-03 13:46:31 -07:00
Jean Pierre
096eb643d1 Fixes #81876 (#81885) 2019-10-03 11:27:40 -07:00
Matt Bierner
b8869cd989 Fix git diff view for untracked image files showing an error on left side 2019-10-02 14:19:29 -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
a25c6e6660 Add CSP 2019-10-01 17:00: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
aeae28bf2c Remove tiff as a supported image preview format
Fixes #81803

This is not supported by chromium
2019-10-01 15:41:56 -07:00
Matt Bierner
c241e1d5e4 Making status bar items for images more reliable
Fixes #81738
2019-10-01 15:05:22 -07:00
Matt Bierner
47ac64a019 Make sure status bar name for zoom/size can be localized 2019-10-01 15:05:22 -07:00
Matt Bierner
b3da545c1d Use enum to track preview state to avoid getting into invalid states such as active & disposed 2019-10-01 15:05:22 -07:00
Matt Bierner
6493b8dc0a Make sure active is set to false when webviews are disposed 2019-10-01 15:05:22 -07:00
Matt Bierner
72c8590b39 Make sure zoom status bar selections only effect the active image
Fixes #81799
2019-10-01 15:05:22 -07:00
Matt Bierner
00b1067cab Add simple description for image preview extension
Fixes #81741
2019-10-01 13:45:00 -07:00
Matt Bierner
eedf80d84b Re-render image preview when image on disk changes
Fixes #81751

Make sure we reload the image in the preview when it changes on disk
2019-10-01 11:57:37 -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
6b947b14ed Fix image preview extension for remote
Fixes #81434

- Make image preview a ui exension

- Add logic so that `asWebviewUri` supports preserving the scheme of the requested resource. This is important as we know where to load the resource from
2019-09-25 16:25:40 -07:00
Matt Bierner
d54dbd33f4 Add icon for image preview ext
Fixes #80677
2019-09-16 16:02:56 -07:00
Matt Bierner
04da82c1d2 Let webview editors show in diff original view too
Fixes #80740

The original view in diff views uses a data uri instead of a resource on disk. Make sure our webview editors can register themselves to handle this case too
2019-09-16 14:17:34 -07:00