[haiku-commits] haiku: hrev53590 - src/apps/terminal

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 22 Nov 2019 18:27:15 -0500 (EST)

hrev53590 adds 1 changeset to branch 'master'
old head: ea5c088d0937fe06a520d84d66f7c9a57e005624
new head: 354649f120cd82a02bd257a4f020a8c99b637941
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=354649f120cd+%5Eea5c088d0937

----------------------------------------------------------------------------

354649f120cd: Terminal: Add semantic + shortcut to increase font size
  
  See bug #7428 and hrev46251 for details.
  
  Fixes #15452
  
  Change-Id: I3bc8871c83e714ff624827d96c0b594fef1f1ae1
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/1957
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53590
Commit:      354649f120cd82a02bd257a4f020a8c99b637941
URL:         https://git.haiku-os.org/haiku/commit/?id=354649f120cd
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Thu Nov 14 00:30:16 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Fri Nov 22 23:27:12 2019 UTC

Ticket:      https://dev.haiku-os.org/ticket/7428
Ticket:      https://dev.haiku-os.org/ticket/15452

----------------------------------------------------------------------------

1 file changed, 20 insertions(+)
src/apps/terminal/TermWindow.cpp | 20 ++++++++++++++++++++

----------------------------------------------------------------------------

diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp
index d1752fe784..830bfd51d4 100644
--- a/src/apps/terminal/TermWindow.cpp
+++ b/src/apps/terminal/TermWindow.cpp
@@ -32,12 +32,14 @@
 #include <Dragger.h>
 #include <File.h>
 #include <FindDirectory.h>
+#include <Keymap.h>
 #include <LayoutBuilder.h>
 #include <LayoutUtils.h>
 #include <Locale.h>
 #include <Menu.h>
 #include <MenuBar.h>
 #include <MenuItem.h>
+#include <ObjectList.h>
 #include <Path.h>
 #include <PopUpMenu.h>
 #include <PrintJob.h>
@@ -47,6 +49,7 @@
 #include <ScrollBar.h>
 #include <ScrollView.h>
 #include <String.h>
+#include <UnicodeChar.h>
 #include <UTF8.h>
 
 #include <AutoLocker.h>
@@ -547,6 +550,23 @@ TermWindow::_SetupMenu()
        AddShortcut('C', B_COMMAND_KEY | B_CONTROL_KEY,
                new BMessage(SHORTCUT_DEBUG_CAPTURE));
 #endif
+
+       BKeymap keymap;
+       keymap.SetToCurrent();
+       BObjectList<const char> unmodified(3, true);
+       if (keymap.GetModifiedCharacters("+", B_SHIFT_KEY, 0, &unmodified)
+                       == B_OK) {
+               int32 count = unmodified.CountItems();
+               for (int32 i = 0; i < count; i++) {
+                       uint32 key = 
BUnicodeChar::FromUTF8(unmodified.ItemAt(i));
+                       if (!HasShortcut(key, 0)) {
+                               // Add semantic + shortcut, bug #7428
+                               AddShortcut(key, B_COMMAND_KEY,
+                                       new BMessage(kIncreaseFontSize));
+                       }
+               }
+       }
+       unmodified.MakeEmpty();
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev53590 - src/apps/terminal - waddlesplash