mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Enter key closes Cel or Layer properties if children have the focus
This commit is contained in:
parent
4b064333cc
commit
5dfe7b64ae
@ -117,6 +117,16 @@ private:
|
||||
bool onProcessMessage(ui::Message* msg) override {
|
||||
switch (msg->type()) {
|
||||
|
||||
case kKeyDownMessage:
|
||||
if (opacity()->hasFocus()) {
|
||||
if (static_cast<KeyMessage*>(msg)->scancode() == kKeyEnter) {
|
||||
onCommitChange();
|
||||
closeWindow(this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case kCloseMessage:
|
||||
// Save changes before we close the window
|
||||
setCel(nullptr, nullptr);
|
||||
|
@ -132,6 +132,18 @@ private:
|
||||
bool onProcessMessage(ui::Message* msg) override {
|
||||
switch (msg->type()) {
|
||||
|
||||
case kKeyDownMessage:
|
||||
if (name()->hasFocus() ||
|
||||
opacity()->hasFocus() ||
|
||||
mode()->hasFocus()) {
|
||||
if (static_cast<KeyMessage*>(msg)->scancode() == kKeyEnter) {
|
||||
onCommitChange();
|
||||
closeWindow(this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case kCloseMessage:
|
||||
// Save changes before we close the window
|
||||
setLayer(nullptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user