|
@@ -247,8 +247,13 @@ struct BrowserSearchField : ui::TextField { |
|
|
void onSelectKey(const event::SelectKey &e) override { |
|
|
void onSelectKey(const event::SelectKey &e) override { |
|
|
if (e.action == GLFW_PRESS) { |
|
|
if (e.action == GLFW_PRESS) { |
|
|
if (e.key == GLFW_KEY_ESCAPE) { |
|
|
if (e.key == GLFW_KEY_ESCAPE) { |
|
|
BrowserOverlay *overlay = getAncestorOfType<BrowserOverlay>(); |
|
|
|
|
|
overlay->hide(); |
|
|
|
|
|
|
|
|
if (text != "") { |
|
|
|
|
|
setText(""); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
BrowserOverlay *overlay = getAncestorOfType<BrowserOverlay>(); |
|
|
|
|
|
overlay->hide(); |
|
|
|
|
|
} |
|
|
e.consume(this); |
|
|
e.consume(this); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|