From 77acb4327395b8212c8ceb9270615afcd6a5eae1 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sat, 1 Feb 2014 11:04:34 -0500 Subject: [PATCH] TextView: Remove Cmd+Up and Cmd+Down Shortcuts to go to the beginning and end of the document. --- headers/os/interface/TextView.h | 2 -- src/kits/interface/TextView.cpp | 46 --------------------------------- 2 files changed, 48 deletions(-) diff --git a/headers/os/interface/TextView.h b/headers/os/interface/TextView.h index fc589390e3..85f344317a 100644 --- a/headers/os/interface/TextView.h +++ b/headers/os/interface/TextView.h @@ -456,13 +456,11 @@ private: bool fInstalledNavigateCommandWordwiseShortcuts; bool fInstalledNavigateOptionWordwiseShortcuts; bool fInstalledNavigateOptionLinewiseShortcuts; - bool fInstalledNavigateCommandDocwiseShortcuts; bool fInstalledNavigateHomeEndDocwiseShortcuts; bool fInstalledSelectCommandWordwiseShortcuts; bool fInstalledSelectOptionWordwiseShortcuts; bool fInstalledSelectOptionLinewiseShortcuts; - bool fInstalledSelectCommandDocwiseShortcuts; bool fInstalledSelectHomeEndDocwiseShortcuts; uint32 _reserved[6]; diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index 5d7a98ed6e..62b79e0cd0 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -3111,13 +3111,11 @@ BTextView::_InitObject(BRect textRect, const BFont* initialFont, fInstalledNavigateCommandWordwiseShortcuts = false; fInstalledNavigateOptionWordwiseShortcuts = false; fInstalledNavigateOptionLinewiseShortcuts = false; - fInstalledNavigateCommandDocwiseShortcuts = false; fInstalledNavigateHomeEndDocwiseShortcuts = false; fInstalledSelectCommandWordwiseShortcuts = false; fInstalledSelectOptionWordwiseShortcuts = false; fInstalledSelectOptionLinewiseShortcuts = false; - fInstalledSelectCommandDocwiseShortcuts = false; fInstalledSelectHomeEndDocwiseShortcuts = false; // We put these here instead of in the constructor initializer list @@ -5082,38 +5080,6 @@ BTextView::_Activate() fInstalledSelectOptionLinewiseShortcuts = true; } - if (!Window()->HasShortcut(B_UP_ARROW, B_COMMAND_KEY) - && !Window()->HasShortcut(B_DOWN_ARROW, B_COMMAND_KEY)) { - message = new BMessage(kMsgNavigateArrow); - message->AddInt32("key", B_UP_ARROW); - message->AddInt32("modifiers", B_COMMAND_KEY); - Window()->AddShortcut(B_UP_ARROW, B_COMMAND_KEY, message, this); - - message = new BMessage(kMsgNavigateArrow); - message->AddInt32("key", B_DOWN_ARROW); - message->AddInt32("modifiers", B_COMMAND_KEY); - Window()->AddShortcut(B_DOWN_ARROW, B_COMMAND_KEY, message, this); - - fInstalledNavigateCommandDocwiseShortcuts = true; - } - if (!Window()->HasShortcut(B_UP_ARROW, B_COMMAND_KEY | B_SHIFT_KEY) - && !Window()->HasShortcut(B_DOWN_ARROW, - B_COMMAND_KEY | B_SHIFT_KEY)) { - message = new BMessage(kMsgNavigateArrow); - message->AddInt32("key", B_UP_ARROW); - message->AddInt32("modifiers", B_COMMAND_KEY | B_SHIFT_KEY); - Window()->AddShortcut(B_UP_ARROW, B_COMMAND_KEY | B_SHIFT_KEY, - message, this); - - message = new BMessage(kMsgNavigateArrow); - message->AddInt32("key", B_DOWN_ARROW); - message->AddInt32("modifiers", B_COMMAND_KEY | B_SHIFT_KEY); - Window()->AddShortcut(B_DOWN_ARROW, B_COMMAND_KEY | B_SHIFT_KEY, - message, this); - - fInstalledSelectCommandDocwiseShortcuts = true; - } - if (!Window()->HasShortcut(B_HOME, B_COMMAND_KEY) && !Window()->HasShortcut(B_END, B_COMMAND_KEY)) { message = new BMessage(kMsgNavigatePage); @@ -5198,18 +5164,6 @@ BTextView::_Deactivate() fInstalledSelectOptionLinewiseShortcuts = false; } - if (fInstalledNavigateCommandDocwiseShortcuts) { - Window()->RemoveShortcut(B_UP_ARROW, B_COMMAND_KEY); - Window()->RemoveShortcut(B_DOWN_ARROW, B_COMMAND_KEY); - fInstalledNavigateCommandDocwiseShortcuts = false; - } - if (fInstalledSelectCommandDocwiseShortcuts) { - Window()->RemoveShortcut(B_UP_ARROW, B_COMMAND_KEY | B_SHIFT_KEY); - Window()->RemoveShortcut(B_DOWN_ARROW, - B_COMMAND_KEY | B_SHIFT_KEY); - fInstalledSelectCommandDocwiseShortcuts = false; - } - if (fInstalledNavigateHomeEndDocwiseShortcuts) { Window()->RemoveShortcut(B_HOME, B_COMMAND_KEY); Window()->RemoveShortcut(B_END, B_COMMAND_KEY);