User-created windows close with back button
This commit is contained in:
parent
ab095694d0
commit
f318eb6b49
21
src/calc.c
21
src/calc.c
|
@ -78,12 +78,25 @@ static void adjustFont()
|
|||
fonts_get_system_font(fonts[f]));
|
||||
}
|
||||
|
||||
static void custom_unload(Window *window)
|
||||
{
|
||||
text_layer_destroy(s_heading_text_layer);
|
||||
|
||||
window_destroy(window);
|
||||
s_custom_window = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* In normal token list, backspace if possible, otherwise return to script list
|
||||
* In function token list, return to normal token list
|
||||
*/
|
||||
static void click_backspace(ClickRecognizerRef recognizer, void *context)
|
||||
{
|
||||
if(s_custom_window) {
|
||||
window_stack_remove(s_custom_window, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!using_func_tokens) {
|
||||
if(mytext[0] == '\0') {
|
||||
window_stack_remove(window_stack_get_top_window(), true);
|
||||
|
@ -298,14 +311,6 @@ static void custom_load(Window *window)
|
|||
window_stack_push(s_custom_window, true);
|
||||
}
|
||||
|
||||
static void custom_unload(Window *window)
|
||||
{
|
||||
text_layer_destroy(s_heading_text_layer);
|
||||
|
||||
window_destroy(window);
|
||||
s_custom_window = NULL;
|
||||
}
|
||||
|
||||
Object add_window(Object obj1, Object obj2, struct Environment *env)
|
||||
{
|
||||
printf("ADD_WINDOW\n");
|
||||
|
|
Loading…
Reference in New Issue