Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: ui/file_manager/gallery/js/slide_mode.js

Issue 392543002: Gallery.app: Add shortcut keys for zooming in the slide mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/viewport.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/slide_mode.js
diff --git a/ui/file_manager/gallery/js/slide_mode.js b/ui/file_manager/gallery/js/slide_mode.js
index d0c04b662a8e3ba47aeb98a7d232c4a87d8585a9..83cca9a4552d134169ef83e3b8bfb68f2ab06a1d 100644
--- a/ui/file_manager/gallery/js/slide_mode.js
+++ b/ui/file_manager/gallery/js/slide_mode.js
@@ -334,6 +334,7 @@ SlideMode.prototype.leave = function(zoomToRect, callback) {
callback();
}.bind(this);
+ this.viewport_.setZoomIndex(0);
if (this.getItemCount_() === 0) {
this.showErrorBanner_(false);
commitDone();
@@ -856,7 +857,19 @@ SlideMode.prototype.onKeyDown = function(event) {
this.advanceWithKeyboard(keyID);
break;
- default: return false;
+ case 'Ctrl-U+00BB': // Ctrl+'=' zoom in.
+ if (!this.isEditing()) {
+ this.viewport_.setZoomIndex(this.viewport_.getZoomIndex() + 1);
+ this.imageView_.draw();
+ }
+ break;
+
+ case 'Ctrl-U+00BD': // Ctrl+'-' zoom out.
+ if (!this.isEditing()) {
+ this.viewport_.setZoomIndex(this.viewport_.getZoomIndex() - 1);
+ this.imageView_.draw();
+ }
+ break;
}
return true;
@@ -1023,6 +1036,10 @@ SlideMode.prototype.isSlideshowOn_ = function() {
* @param {Event=} opt_event Event.
*/
SlideMode.prototype.startSlideshow = function(opt_interval, opt_event) {
+ // Reset zoom.
+ this.viewport_.setZoomIndex(0);
+ this.imageView_.draw();
+
// Set the attribute early to prevent the toolbar from flashing when
// the slideshow is being started from the mosaic view.
this.container_.setAttribute('slideshow', 'playing');
@@ -1174,6 +1191,9 @@ SlideMode.prototype.toggleEditor = function(opt_event) {
ImageUtil.setAttribute(this.container_, 'editing', !this.isEditing());
if (this.isEditing()) { // isEditing has just been flipped to a new value.
+ // Reset zoom.
+ this.viewport_.setZoomIndex(0);
+ this.imageView_.draw();
if (this.context_.readonlyDirName) {
this.editor_.getPrompt().showAt(
'top', 'GALLERY_READONLY_WARNING', 0, this.context_.readonlyDirName);
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/viewport.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698