summaryrefslogtreecommitdiff
path: root/src/mo_edit.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-05-08 13:02:44 +0200
committerAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-05-08 13:02:44 +0200
commit149d46336bbd49196cd8547a8dbf666057620cc8 (patch)
tree9a36407409b7f00164100d473ab7146509c75184 /src/mo_edit.c
parente25af7b02ac88d472c1f51bc792e5bad4de9f961 (diff)
small fix
Diffstat (limited to 'src/mo_edit.c')
-rw-r--r--src/mo_edit.c7
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(&current_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());
}