more fixes?

This commit is contained in:
2025-12-13 22:02:48 -05:00
parent 31ac9707e7
commit 898dfcc68f
2 changed files with 13 additions and 6 deletions

View File

@@ -3,12 +3,14 @@
#include <format> #include <format>
#include <vector> #include <vector>
#include "filesystem_.h"
#include "strings.h" #include "strings.h"
#include "time_.h" #include "time_.h"
using namespace anm2ed::resource; using namespace anm2ed::resource;
using namespace anm2ed::types; using namespace anm2ed::types;
using namespace anm2ed::util; using namespace anm2ed::util;
namespace filesystem = anm2ed::util::filesystem;
namespace anm2ed::imgui namespace anm2ed::imgui
{ {
@@ -86,7 +88,7 @@ namespace anm2ed::imgui
auto isRequested = i == manager.pendingSelected; auto isRequested = i == manager.pendingSelected;
auto font = isDirty ? font::ITALICS : font::REGULAR; auto font = isDirty ? font::ITALICS : font::REGULAR;
auto filename = document.filename_get().string(); auto filename = filesystem::path_to_utf8(document.filename_get());
auto string = auto string =
isDirty ? std::vformat(localize.get(FORMAT_NOT_SAVED), std::make_format_args(filename)) : filename; isDirty ? std::vformat(localize.get(FORMAT_NOT_SAVED), std::make_format_args(filename)) : filename;
auto label = std::format("{}###Document{}", string, i); auto label = std::format("{}###Document{}", string, i);
@@ -103,7 +105,8 @@ namespace anm2ed::imgui
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
ImGui::SetItemTooltip("%s", document.path.string().c_str()); auto pathUtf8 = filesystem::path_to_utf8(document.path);
ImGui::SetItemTooltip("%s", pathUtf8.c_str());
ImGui::PopFont(); ImGui::PopFont();
} }
@@ -126,7 +129,7 @@ namespace anm2ed::imgui
{ {
auto& closeDocument = manager.documents[closeDocumentIndex]; auto& closeDocument = manager.documents[closeDocumentIndex];
auto filename = closeDocument.filename_get().string(); auto filename = filesystem::path_to_utf8(closeDocument.filename_get());
auto prompt = std::vformat(localize.get(LABEL_DOCUMENT_MODIFIED_PROMPT), std::make_format_args(filename)); auto prompt = std::vformat(localize.get(LABEL_DOCUMENT_MODIFIED_PROMPT), std::make_format_args(filename));
ImGui::TextUnformatted(prompt.c_str()); ImGui::TextUnformatted(prompt.c_str());
@@ -213,7 +216,7 @@ namespace anm2ed::imgui
{ {
for (auto& path : manager.anm2DragDropPaths) for (auto& path : manager.anm2DragDropPaths)
{ {
anm2::Anm2 source(path.string()); anm2::Anm2 source(path);
document->anm2.merge(source, document->directory_get(), path.parent_path()); document->anm2.merge(source, document->directory_get(), path.parent_path());
} }
}; };

View File

@@ -2,9 +2,11 @@
#include <ranges> #include <ranges>
#include "filesystem_.h"
#include "strings.h" #include "strings.h"
using namespace anm2ed::resource; using namespace anm2ed::resource;
namespace filesystem = anm2ed::util::filesystem;
namespace anm2ed::imgui namespace anm2ed::imgui
{ {
@@ -44,7 +46,8 @@ namespace anm2ed::imgui
{ {
ImGui::PushID(i); ImGui::PushID(i);
auto label = std::format(FILE_LABEL_FORMAT, file.filename().string(), file.string()); auto label = std::format(FILE_LABEL_FORMAT, filesystem::path_to_utf8(file.filename()),
filesystem::path_to_utf8(file));
if (ImGui::Selectable(label.c_str())) if (ImGui::Selectable(label.c_str()))
{ {
@@ -75,7 +78,8 @@ namespace anm2ed::imgui
{ {
for (auto& file : manager.autosaveFiles) for (auto& file : manager.autosaveFiles)
{ {
auto label = std::format(FILE_LABEL_FORMAT, file.filename().string(), file.string()); auto label = std::format(FILE_LABEL_FORMAT, filesystem::path_to_utf8(file.filename()),
filesystem::path_to_utf8(file));
ImGui::TextUnformatted(label.c_str()); ImGui::TextUnformatted(label.c_str());
} }
} }