fix cross platform file paths to string

This commit is contained in:
Green Sky 2023-07-29 21:13:08 +02:00
parent 6a979d31a0
commit 40cd04f9dd
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View File

@ -249,7 +249,7 @@ void ChatGui4::render(void) {
_fss.requestFile(
[](const auto& path) -> bool { return std::filesystem::is_regular_file(path); },
[this](const auto& path){
_rmm.sendFilePath(*_selected_contact, path.filename().c_str(), path.c_str());
_rmm.sendFilePath(*_selected_contact, path.filename().u8string(), path.u8string());
},
[](){}
);
@ -272,6 +272,7 @@ void ChatGui4::render(void) {
void ChatGui4::renderMessageBodyText(Message3Registry& reg, const Message3 e) {
const auto& msgtext = reg.get<Message::Components::MessageText>(e).text;
// TODO: set word wrap
ImVec2 text_size = ImGui::CalcTextSize(msgtext.c_str(), msgtext.c_str()+msgtext.size());
text_size.x = -FLT_MIN; // fill width (suppresses label)
text_size.y += ImGui::GetStyle().FramePadding.y; // single pad

View File

@ -46,7 +46,7 @@ void FileSelector::render(void) {
std::filesystem::path current_path = _current_file_path;
current_path.remove_filename();
ImGui::Text("path: %s", _current_file_path.c_str());
ImGui::Text("path: %s", _current_file_path.u8string().c_str());
// begin table with selectables
constexpr ImGuiTableFlags table_flags =
@ -174,7 +174,7 @@ void FileSelector::render(void) {
}
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted((dir_entry.path().filename().string() + "/").c_str());
ImGui::TextUnformatted((dir_entry.path().filename().u8string() + "/").c_str());
}
if (ImGui::TableNextColumn()) {
@ -199,7 +199,7 @@ void FileSelector::render(void) {
}
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted(dir_entry.path().filename().c_str());
ImGui::TextUnformatted(dir_entry.path().filename().u8string().c_str());
}
if (ImGui::TableNextColumn()) {