Compare commits

...

3 Commits

Author SHA1 Message Date
aff239377d
add README.md 2023-07-29 22:50:15 +02:00
3aaa1b0350
try satisfy macintosh 2023-07-29 22:30:36 +02:00
823a4ae189
missing include 2023-07-29 21:51:24 +02:00
2 changed files with 19 additions and 2 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# Tomato
![tomato](res/icon/tomato_v1_256.png)

View File

@ -3,6 +3,7 @@
#include <imgui/imgui.h> #include <imgui/imgui.h>
#include <chrono> #include <chrono>
#include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
@ -182,7 +183,13 @@ void FileSelector::render(void) {
} }
if (ImGui::TableNextColumn()) { if (ImGui::TableNextColumn()) {
const auto ctime = std::chrono::system_clock::to_time_t(dir_entry.last_write_time() - decltype(dir_entry.last_write_time())::clock::now() + std::chrono::system_clock::now()); const auto file_time_converted = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
dir_entry.last_write_time()
- decltype(dir_entry.last_write_time())::clock::now()
+ std::chrono::system_clock::now()
);
const auto ctime = std::chrono::system_clock::to_time_t(file_time_converted);
const auto ltime = std::localtime(&ctime); const auto ltime = std::localtime(&ctime);
ImGui::TextDisabled("%2d.%2d.%2d - %2d:%2d", ltime->tm_mday, ltime->tm_mon, ltime->tm_year + 1900, ltime->tm_hour, ltime->tm_min); ImGui::TextDisabled("%2d.%2d.%2d - %2d:%2d", ltime->tm_mday, ltime->tm_mon, ltime->tm_year + 1900, ltime->tm_hour, ltime->tm_min);
} }
@ -207,7 +214,13 @@ void FileSelector::render(void) {
} }
if (ImGui::TableNextColumn()) { if (ImGui::TableNextColumn()) {
const auto ctime = std::chrono::system_clock::to_time_t(dir_entry.last_write_time() - decltype(dir_entry.last_write_time())::clock::now() + std::chrono::system_clock::now()); const auto file_time_converted = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
dir_entry.last_write_time()
- decltype(dir_entry.last_write_time())::clock::now()
+ std::chrono::system_clock::now()
);
const auto ctime = std::chrono::system_clock::to_time_t(file_time_converted);
const auto ltime = std::localtime(&ctime); const auto ltime = std::localtime(&ctime);
ImGui::TextDisabled("%2d.%2d.%2d - %2d:%2d", ltime->tm_mday, ltime->tm_mon, ltime->tm_year + 1900, ltime->tm_hour, ltime->tm_min); ImGui::TextDisabled("%2d.%2d.%2d - %2d:%2d", ltime->tm_mday, ltime->tm_mon, ltime->tm_year + 1900, ltime->tm_hour, ltime->tm_min);
} }