From 446b16335526bf5f1d629a7c0077865f54877717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Mon, 11 Dec 2023 19:20:16 +0100 Subject: [PATCH] Don't deselect current sidebar tabs when clicked --- src/custom_notebook.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/custom_notebook.cpp b/src/custom_notebook.cpp index de302d710b..76a9203a28 100644 --- a/src/custom_notebook.cpp +++ b/src/custom_notebook.cpp @@ -340,9 +340,16 @@ class SegmentedNotebook::ButtonTabs : public wxPanel, button->Bind(wxEVT_TOGGLEBUTTON, [=](wxCommandEvent& e) { - // SetSelection() generates events: if (e.IsChecked()) + { + // SetSelection() generates events: m_book->SetSelection(n); + } + else + { + // don't un-toggle already toggled button / selection + button->SetValue(true); + } }); }