diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-06 21:22:48 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-06 21:22:48 +0100 |
| commit | c3a430aa1828e2c161023076cc260eeda740ae7f (patch) | |
| tree | db0c87458d0bd52055653957ba2632c43d0164dd /src/main.cpp | |
| parent | 81b18c444e209ef75b612c243c1fa7090411bfa0 (diff) | |
show red border on input when path is invalid
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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"); |
