Skip to content

Commit

Permalink
#5391: Fix layer control dialog toggle buttons receiving additional w…
Browse files Browse the repository at this point in the history
…xEVT_TOGGLEBUTTON events due to double clicks (Windows only)
  • Loading branch information
codereader committed Nov 13, 2020
1 parent ce593f9 commit ca0de91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion radiant/ui/layers/LayerControl.cpp
Expand Up @@ -39,7 +39,12 @@ LayerControl::LayerControl(wxWindow* parent, int layerID) :
_toggle = new wxBitmapToggleButton(parent, wxID_ANY,
wxArtProvider::GetBitmap(GlobalUIManager().ArtIdPrefix() + ICON_LAYER_VISIBLE));
_toggle->SetMaxSize(wxSize(30, -1));
_toggle->Connect(wxEVT_TOGGLEBUTTON, wxCommandEventHandler(LayerControl::onToggle), NULL, this);
_toggle->Bind(wxEVT_TOGGLEBUTTON, &LayerControl::onToggle, this);

#ifdef __WXMSW__
// Eat the double click event to not receive additional onToggle callbacks
_toggle->Bind(wxEVT_LEFT_DCLICK, [](wxMouseEvent& ev) {});
#endif

Vector3 selColour = GlobalColourSchemeManager().getColour("selected_brush");
_activeColour = wxColour(static_cast<unsigned char>(selColour[0] * 255),
Expand Down

0 comments on commit ca0de91

Please sign in to comment.