From c71fc4b12fcbf7bb9f5b764c7317d557b6278ec7 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 16 Mar 2024 11:59:04 +0100 Subject: set window title when loading file from drag drop --- src/export.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/export.cpp') diff --git a/src/export.cpp b/src/export.cpp index fea14af..b020b77 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -271,6 +271,11 @@ export_result ts_export_result(ts_search_result* result, const utf8_int8_t* path if (result->is_saving) return EXPORT_SAVE_PENDING; result->is_saving = true; + // Set titlebar name. + utf8_int8_t new_name[MAX_INPUT_LENGTH]; + snprintf(new_name, MAX_INPUT_LENGTH, "Text-Search > %s", path); + ts_platform_set_window_title(new_name); + struct t_export_thread_args* args = (struct t_export_thread_args*)malloc(sizeof(struct t_export_thread_args)); if (!args) exit_oom(); args->result = result; @@ -288,11 +293,6 @@ void ts_create_export_popup(int window_w, int window_h) { std::string res = ifd::FileDialog::Instance().GetResult().u8string(); last_export_result = ts_export_result(current_search_result, (const utf8_int8_t *)res.c_str()); utf8ncpy(save_path, (const utf8_int8_t *)res.c_str(), sizeof(save_path)); - - // Set titlebar name. - utf8_int8_t new_name[MAX_INPUT_LENGTH]; - snprintf(new_name, MAX_INPUT_LENGTH, "Text-Search > %s", res.c_str()); - ts_platform_set_window_title(new_name); } ifd::FileDialog::Instance().Close(); } -- cgit v1.2.3-70-g09d2