From 959a0ca10dd06b205f13b51040f03da3ae4c5e75 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 18 Oct 2013 03:09:08 -0400 Subject: [PATCH] WebPositive: Add semantic zoom in shortcut. Fixes #7428 iif '+' is localed in shift + '=' in your keymap, add a shortcut for Command + '=' to zoom in. --- src/apps/webpositive/BrowserWindow.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index bd61ff5e2e..fa5b2b8b9d 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -5,8 +5,7 @@ * Copyright (C) 2010 Stephan Aßmus * Copyright (C) 2010 Michael Lotz * Copyright (C) 2010 Rene Gollent - * - * All rights reserved. + * Copyright 2013 Haiku, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -48,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -610,6 +610,25 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings, AddShortcut(numStr[0], B_COMMAND_KEY, selectTab); } + 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 #7428 + AddShortcut('=', B_COMMAND_KEY, + new BMessage(ZOOM_FACTOR_INCREASE)); + break; + } + } + } + while (!shiftChars.IsEmpty()) + delete (const char*)shiftChars.RemoveItem((int32)0); + shiftChars.MakeEmpty(); + be_app->PostMessage(WINDOW_OPENED); }