summaryrefslogtreecommitdiff
path: root/src/import.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-03-16 11:59:04 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-03-16 11:59:04 +0100
commitc71fc4b12fcbf7bb9f5b764c7317d557b6278ec7 (patch)
treed48d6555235966d379e2a712c87777498b37483e /src/import.cpp
parent3284cf386a74bd0c93473c72eceb8caf1b11dc7a (diff)
set window title when loading file from drag drop
Diffstat (limited to 'src/import.cpp')
-rw-r--r--src/import.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/import.cpp b/src/import.cpp
index 89a0f8f..254050d 100644
--- a/src/import.cpp
+++ b/src/import.cpp
@@ -154,6 +154,11 @@ ts_search_result* ts_import_result(const utf8_int8_t* path) {
res->search_completed = false;
res->cancel_search = false;
+ // 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);
+
if (res->prev_result) res->prev_result->cancel_search = true;
current_search_result = res; // set this now because old result will be destroyed in import thread.
@@ -174,12 +179,6 @@ void ts_create_import_popup(int window_w, int window_h) {
if (ifd::FileDialog::Instance().HasResult()) {
std::string res = ifd::FileDialog::Instance().GetResult().u8string();
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);
-
current_search_result = ts_import_result(save_path);
}
ifd::FileDialog::Instance().Close();