WebPositive: added shortcut to cycle through tabs like in every other browser
Change-Id: I3cb543948929c20e64c1c8c245a568fb81637a3d Reviewed-on: https://review.haiku-os.org/c/haiku/+/5574 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Jérôme Duval <jerome.duval@gmail.com> Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
parent
100e2a19c1
commit
4f0d375c54
@ -129,6 +129,7 @@ enum {
|
||||
FIND_TEXT_CHANGED = 'ftxt',
|
||||
|
||||
SELECT_TAB = 'sltb',
|
||||
CYCLE_TABS = 'ctab',
|
||||
};
|
||||
|
||||
|
||||
@ -679,7 +680,10 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
|
||||
snprintf(numStr, sizeof(numStr), "%d", (int) i);
|
||||
AddShortcut(numStr[0], B_COMMAND_KEY, selectTab);
|
||||
}
|
||||
|
||||
|
||||
// Add shortcut to cycle through tabs like in every other web browser
|
||||
AddShortcut(B_TAB, B_COMMAND_KEY, new BMessage(CYCLE_TABS));
|
||||
|
||||
BKeymap keymap;
|
||||
keymap.SetToCurrent();
|
||||
BObjectList<const char> unmodified(3, true);
|
||||
@ -1120,6 +1124,15 @@ BrowserWindow::MessageReceived(BMessage* message)
|
||||
break;
|
||||
}
|
||||
|
||||
case CYCLE_TABS:
|
||||
{
|
||||
int32 index = fTabManager->SelectedTabIndex() + 1;
|
||||
if (index >= fTabManager->CountTabs())
|
||||
index = 0;
|
||||
fTabManager->SelectTab(index);
|
||||
break;
|
||||
}
|
||||
|
||||
case TAB_CHANGED:
|
||||
{
|
||||
// This message may be received also when the last tab closed,
|
||||
|
Loading…
x
Reference in New Issue
Block a user