From c3a430aa1828e2c161023076cc260eeda740ae7f Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Wed, 6 Mar 2024 21:22:48 +0100 Subject: show red border on input when path is invalid --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 56be834..317a56e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -267,7 +267,11 @@ void ts_create_gui(int window_w, int window_h) { { ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); ImGui::PushItemWidth(-1); + + bool dir_exists = ts_platform_dir_exists(path_buffer); + if (!dir_exists) ImGui::PushStyleColor(ImGuiCol_Border, ImGui::Spectrum::Color(0xCC2222)); ImGui::InputTextWithHint("path-ti", "Path", path_buffer, MAX_INPUT_LENGTH); + if (!dir_exists) ImGui::PopStyleColor(); ImGui::PopItemWidth(); ImGui::SetItemTooltip("Absolute path to directory to search"); -- cgit v1.2.3-70-g09d2