Allow switching tabs via context menu in the tabs area

This change allows you to switch tabs via the context menu. The context
menu only shows up if you click on the empty area beside the tabs.

Can be tested with `--allow-switch-tabs-via-menu` option in the example.

Fixes #232
Signed-off-by: Waqar Ahmed <waqar.ahmed@kdab.com>
This commit is contained in:
Waqar Ahmed
2021-09-08 15:09:41 +05:00
committed by Sergio Martins
parent 8307598d5d
commit 7af2095f2f
5 changed files with 49 additions and 2 deletions

View File

@@ -65,6 +65,10 @@ protected:
DockWidgetBase *dockwidgetAt(int index) const override;
int currentIndex() const override;
/// @brief Shows the context menu. Override to implement your own context menu.
/// By default it's used to honour Config::Flag_AllowSwitchingTabsViaMenu
virtual void showContextMenu(QPoint pos);
private:
void updateMargins();
void setupTabBarButtons();