From 8123a478988b4b9a806014454dfe1ced8b91384f Mon Sep 17 00:00:00 2001 From: fourtf Date: Sat, 26 Sep 2020 01:52:39 +0200 Subject: [PATCH] Closes #1725 --- src/widgets/Notebook.cpp | 11 +++++++++++ src/widgets/Notebook.hpp | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/widgets/Notebook.cpp b/src/widgets/Notebook.cpp index 990b9c16e..103f6470c 100644 --- a/src/widgets/Notebook.cpp +++ b/src/widgets/Notebook.cpp @@ -627,6 +627,17 @@ SplitNotebook::SplitNotebook(Window *parent) } } +void SplitNotebook::showEvent(QShowEvent *) +{ + if (auto page = this->getSelectedPage()) + { + if (auto split = page->findChild()) + { + split->giveFocus(Qt::OtherFocusReason); + } + } +} + void SplitNotebook::addCustomButtons() { // settings diff --git a/src/widgets/Notebook.hpp b/src/widgets/Notebook.hpp index 5a6a1a96a..4f4c59c57 100644 --- a/src/widgets/Notebook.hpp +++ b/src/widgets/Notebook.hpp @@ -98,6 +98,9 @@ public: SplitContainer *getOrAddSelectedPage(); void select(QWidget *page) override; +protected: + void showEvent(QShowEvent *event) override; + private: void addCustomButtons();