From 57f830cef752330a920b3fe3f5fe4367921f51ce Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 18 Oct 2013 03:08:07 -0400 Subject: [PATCH] Tracker: Add semantic zoom in shortcut. Fixes #6692 iif '+' is localed in shift + '=' in your keymap, add a shortcut for Command + '=' to zoom in. --- src/kits/tracker/ContainerWindow.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp index 33b4474e73..d18eef757f 100644 --- a/src/kits/tracker/ContainerWindow.cpp +++ b/src/kits/tracker/ContainerWindow.cpp @@ -45,7 +45,7 @@ All rights reserved. #include #include #include -#include +#include #include #include #include @@ -937,6 +937,26 @@ BContainerWindow::Init(const BMessage* message) AddShortcuts(); } + BKeymap keymap; + keymap.SetToCurrent(); + BList shiftChars; + if (keymap.GetModifiedCharacters("=", B_SHIFT_KEY, &shiftChars) + == B_OK) { + int32 count = shiftChars.CountItems(); + for (int32 i = 0; i < count; i++) { + if (strcmp((const char*)shiftChars.ItemAt(i), "+") == 0) { + // Add semantic zoom in shortcut, bug #6692 + BMessage* increaseSize = new BMessage(kIconMode); + increaseSize->AddInt32("scale", 1); + AddShortcut('=', B_COMMAND_KEY, increaseSize, PoseView()); + break; + } + } + } + while (!shiftChars.IsEmpty()) + delete (const char*)shiftChars.RemoveItem((int32)0); + shiftChars.MakeEmpty(); + AddContextMenus(); AddShortcut('T', B_COMMAND_KEY | B_SHIFT_KEY, new BMessage(kDelete), PoseView());