Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/image-editor-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class ImageEditorView {
this.disposables = new CompositeDisposable()
this.imageSize = fs.statSync(this.editor.getPath()).size
this.loaded = false
this.mode = 'reset-zoom'
this.mode = 'zoom-to-fit'
etch.initialize(this)

this.refs.image.style.display = 'none'
Expand Down Expand Up @@ -108,15 +108,15 @@ export default class ImageEditorView {
</div>
<div className='image-controls-group btn-group'>
<button className='btn' ref='zoomOutButton'>-</button>
<button className='btn reset-zoom-button' ref='resetZoomButton'>100%</button>
<button className='btn reset-zoom-button' ref='resetZoomButton'>Auto</button>
<button className='btn' ref='zoomInButton'>+</button>
</div>
<div className='image-controls-group btn-group'>
<button className='btn' ref='zoomToFitButton'>Zoom to fit</button>
<button className='btn zoom-to-fit-button selected' ref='zoomToFitButton'>Zoom to fit</button>
</div>
</div>

<div className='image-container' ref='imageContainer'>
<div className='image-container zoom-to-fit' ref='imageContainer'>
<img ref='image'></img>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions styles/image-view.less
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
.reset-zoom-button {
min-width: 5em;
}

// disabled once the button is selected
.zoom-to-fit-button.selected {
pointer-events: none;
cursor: default;
}
}


Expand Down