diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-12-29 22:07:03 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-12-29 22:07:03 +0100 |
commit | a853a99c3d1b74b1eb914237eec91b253179d5a0 (patch) | |
tree | 59405c443643b9474cab7031b62341cf78763cf8 | |
parent | 38e2a06bca6f35153fc93ae60ffdf7683d72fb49 (diff) |
Truncate game name in notification1.0.0
-rw-r--r-- | src/Overlay.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Overlay.cpp b/src/Overlay.cpp index da22a76..9a795ee 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -1281,6 +1281,11 @@ namespace gsr { return result; } + static void truncate_string(std::string &str, int max_length) { + if((int)str.size() > max_length) + str.replace(str.begin() + max_length, str.end(), "..."); + } + void Overlay::save_video_in_current_game_directory(const char *video_filepath, NotificationType notification_type) { mgl_context *context = mgl_get_context(); Display *display = (Display*)context->connection; @@ -1298,6 +1303,7 @@ namespace gsr { const std::string new_video_filepath = video_directory + "/" + video_filename; rename(video_filepath, new_video_filepath.c_str()); + truncate_string(focused_window_name, 20); std::string text; switch(notification_type) { case NotificationType::RECORD: |