Key Shortcuts for Zooming. Refactored some event propogation.

Review URL: https://codereview.appspot.com/6452052

git-svn-id: http://skia.googlecode.com/svn/trunk@4794 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index 131386c..823fffc 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -28,6 +28,9 @@
     , fActionShowDeletes(this)
     , fActionStepBack(this)
     , fActionStepForward(this)
+    , fActionZoomIn(this)
+    , fActionZoomOut(this)
+    , fMapper(this)
     , fCentralWidget(this)
     , fFilter(&fCentralWidget)
     , fContainerLayout(&fCentralWidget)
@@ -76,6 +79,13 @@
     connect(&fCanvasWidget, SIGNAL(scaleFactorChanged(float)), this, SLOT(actionScale(float)));
     connect(&fCanvasWidget, SIGNAL(commandChanged(int)), &fSettingsWidget, SLOT(updateCommand(int)));
 
+    fMapper.setMapping(&fActionZoomIn, 1);
+    fMapper.setMapping(&fActionZoomOut, -1);
+
+    connect(&fActionZoomIn, SIGNAL(triggered()), &fMapper, SLOT(map()));
+    connect(&fActionZoomOut, SIGNAL(triggered()), &fMapper, SLOT(map()));
+    connect(&fMapper, SIGNAL(mapped(int)), &fCanvasWidget, SLOT(keyZoom(int)));
+
     fInspectorWidget.setDisabled(true);
     fMenuEdit.setDisabled(true);
     fMenuNavigate.setDisabled(true);
@@ -413,6 +423,11 @@
     fActionStepForward.setIcon(stepForward);
     fActionStepForward.setText("Step Forward");
 
+    fActionZoomIn.setShortcut(QKeySequence(tr("Ctrl+=")));
+    fActionZoomIn.setText("Zoom In");
+    fActionZoomOut.setShortcut(QKeySequence(tr("Ctrl+-")));
+    fActionZoomOut.setText("Zoom Out");
+
     fListWidget.setItemDelegate(new SkListWidget(&fListWidget));
     fListWidget.setObjectName(QString::fromUtf8("listWidget"));
     fListWidget.setMaximumWidth(250);
@@ -501,6 +516,8 @@
     fMenuView.setTitle("View");
     fMenuView.addAction(&fActionBreakpoint);
     fMenuView.addAction(&fActionShowDeletes);
+    fMenuView.addAction(&fActionZoomIn);
+    fMenuView.addAction(&fActionZoomOut);
 
     fMenuWindows.setTitle("Window");
     fMenuWindows.addAction(&fActionInspector);