mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
ENH:close dialog by pressing esc key
Change-Id: Ib883e7119699e06f63c61dd083ad761ba58bc19c
This commit is contained in:
parent
03f62ed9ae
commit
121dccc59c
7 changed files with 92 additions and 3 deletions
|
@ -189,6 +189,19 @@ public:
|
|||
event.Skip();
|
||||
on_sys_color_changed();
|
||||
});
|
||||
|
||||
if (std::is_same<wxDialog, P>::value) {
|
||||
this->Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& e) {
|
||||
if (e.GetKeyCode() == WXK_ESCAPE) {
|
||||
//if (this->IsModal())
|
||||
// this->EndModal(wxID_CANCEL);
|
||||
//else
|
||||
this->Close();
|
||||
}
|
||||
else
|
||||
e.Skip();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~DPIAware() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue