Skip to content

Commit

Permalink
Don't deselect current sidebar tabs when clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
vslavik committed Dec 11, 2023
1 parent c7f1f6d commit 446b163
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/custom_notebook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}

Expand Down

0 comments on commit 446b163

Please sign in to comment.