#include "ui_mod_menu.h" #include "recomp_ui.h" #include "librecomp/mods.hpp" #include // TODO: // - Set up navigation. // - Add hover and active state for mod entries. namespace recompui { ModEntry::ModEntry(Element *parent, const recomp::mods::ModDetails &details, uint32_t mod_index, ModMenu *mod_menu) : Element(parent, Events(EventType::Click, EventType::Hover, EventType::Focus)) { assert(mod_menu != nullptr); this->mod_index = mod_index; this->mod_menu = mod_menu; set_display(Display::Flex); set_flex_direction(FlexDirection::Row); set_width(100.0f, Unit::Percent); set_height_auto(); set_padding_top(4.0f); set_padding_right(8.0f); set_padding_bottom(4.0f); set_padding_left(8.0f); set_border_width(1.1f); set_border_color(Color{ 242, 242, 242, 204 }); set_background_color(Color{ 242, 242, 242, 12 }); set_cursor(Cursor::Pointer); ContextId context = get_current_context(); { thumbnail_image = context.create_element(this); thumbnail_image->set_width(100.0f); thumbnail_image->set_height(100.0f); thumbnail_image->set_min_width(100.0f); thumbnail_image->set_min_height(100.0f); thumbnail_image->set_background_color(Color{ 190, 184, 219, 25 }); body_container = context.create_element(FlexDirection::Column, JustifyContent::FlexStart, this); body_container->set_width_auto(); body_container->set_height(100.0f); body_container->set_margin_left(16.0f); body_container->set_overflow(Overflow::Hidden); { name_label = context.create_element