| 954 | } |
| 955 | |
| 956 | static void drawDatDetails(const ObjectManager::ObjectIndexEntry& indexEntry, Window* self, Gfx::DrawingContext& drawingCtx, int16_t x, int16_t y) |
| 957 | { |
| 958 | int16_t width = self->x + self->width - x; |
| 959 | int16_t height = self->y + self->height - y; |
| 960 | |
| 961 | // Clip the draw area to simplify image draw |
| 962 | const auto& rt = drawingCtx.currentRenderTarget(); |
| 963 | auto clipped = Gfx::clipRenderTarget(rt, Ui::Rect(x, y, width, height)); |
| 964 | if (!clipped) |
| 965 | { |
| 966 | return; |
| 967 | } |
| 968 | |
| 969 | drawingCtx.pushRenderTarget(*clipped); |
| 970 | |
| 971 | auto tr = Gfx::TextRenderer(drawingCtx); |
| 972 | |
| 973 | // Draw object filename |
| 974 | { |
| 975 | auto filename = fs::u8path(indexEntry._filepath).filename().u8string(); |
| 976 | auto buffer = const_cast<char*>(StringManager::getString(StringIds::buffer_1250)); |
| 977 | strncpy(buffer, filename.c_str(), filename.length() + 1); |
| 978 | |
| 979 | FormatArguments args{}; |
| 980 | args.push<StringId>(StringIds::buffer_1250); |
| 981 | |
| 982 | auto point = Point(18, height - kDescriptionRowHeight * 3 - 4); |
| 983 | tr.drawStringLeft(point, Colour::black, StringIds::object_selection_filename, args); |
| 984 | } |
| 985 | |
| 986 | drawingCtx.popRenderTarget(); |
| 987 | } |
| 988 | |
| 989 | static void drawSearchBox(Window& self, Gfx::DrawingContext& drawingCtx) |
| 990 | { |
no test coverage detected