diff options
| -rw-r--r-- | src/mo_edit.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mo_edit.c b/src/mo_edit.c index 3f9cc2c..55ed229 100644 --- a/src/mo_edit.c +++ b/src/mo_edit.c @@ -54,6 +54,7 @@ button_state btn_new_project; button_state btn_new_language;
button_state btn_summary;
button_state btn_set_term_name;
+button_state btn_new_term;
dropdown_state dd_available_countries;
textbox_state tb_filter;
textbox_state tb_new_term;
@@ -228,6 +229,9 @@ void set_term_name(s32 index, char *name) void remove_term_from_project(s32 index)
{
+ if (current_project->selected_term_index == index)
+ current_project->selected_term_index = -1;
+
term *t = array_at(¤t_project->terms, index);
mem_free(t->name);
for (s32 i = 0; i < t->translations.length; i++)
@@ -499,6 +503,7 @@ int main(int argc, char **argv) lang_scroll = ui_create_scroll(1);
trans_scroll = ui_create_scroll(1);
btn_summary = ui_create_button();
+ btn_new_term = ui_create_button();
btn_set_term_name = ui_create_button();
btn_new_project = ui_create_button();
btn_new_language = ui_create_button();
@@ -644,7 +649,7 @@ int main(int argc, char **argv) ui_push_textf_width(font_medium, localize("terms"), global_ui_context.layout.width-106);
- if (ui_push_button_image(&btn_summary, "", add_img))
+ if (ui_push_button_image(&btn_new_term, "", add_img))
{
select_term(add_term_to_project());
}
|
