MCPcopy Create free account
hub / github.com/RevoSucks/BM64Recomp / ModEntryView

Method ModEntryView

src/ui/ui_mod_menu.cpp:39–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37const std::string mod_tab_id = "#tab_mods";
38
39ModEntryView::ModEntryView(Element *parent) : Element(parent, Events(EventType::Update)) {
40 ContextId context = get_current_context();
41
42 set_display(Display::Flex);
43 set_flex_direction(FlexDirection::Row);
44 set_width(100.0f, Unit::Percent);
45 set_height_auto();
46 set_padding(modEntryPadding);
47 set_border_left_width(2.0f);
48 set_border_color(Color{ COL_TEXT_DEFAULT, 12 });
49 set_background_color(Color{ COL_TEXT_DEFAULT, 12 });
50 set_cursor(Cursor::Pointer);
51 set_color(Color{ COL_TEXT_DEFAULT, 255 });
52
53 checked_style.set_border_color(Color{ COL_TEXT_DEFAULT, 160 });
54 checked_style.set_color(Color{ 255, 255, 255, 255 });
55 checked_style.set_background_color(Color{ 26, 24, 32, 255 });
56 hover_style.set_border_color(Color{ COL_TEXT_DEFAULT, 64 });
57 checked_hover_style.set_border_color(Color{ COL_TEXT_DEFAULT, 255 });
58 pulsing_style.set_border_color(Color{ 23, 214, 232, 244 });
59
60 {
61 thumbnail_image = context.create_element<Image>(this, "");
62 thumbnail_image->set_width(modEntryHeight);
63 thumbnail_image->set_height(modEntryHeight);
64 thumbnail_image->set_min_width(modEntryHeight);
65 thumbnail_image->set_min_height(modEntryHeight);
66 thumbnail_image->set_background_color(Color{ 190, 184, 219, 25 });
67
68
69 body_container = context.create_element<Element>(this);
70 body_container->set_width_auto();
71 body_container->set_margin_left(16.0f);
72 body_container->set_padding_top(8.0f);
73 body_container->set_padding_bottom(8.0f);
74 body_container->set_max_height(modEntryHeight);
75 body_container->set_overflow_y(Overflow::Hidden);
76
77 {
78 name_label = context.create_element<Label>(body_container, LabelStyle::Normal);
79 description_label = context.create_element<Label>(body_container, LabelStyle::Small);
80 description_label->set_margin_top(4.0f);
81 description_label->set_color(Color{ COL_TEXT_DIM, 255 });
82 } // body_container
83 } // this
84
85 add_style(&checked_style, checked_state);
86 add_style(&hover_style, hover_state);
87 add_style(&checked_hover_style, { checked_state, hover_state });
88 add_style(&pulsing_style, { focus_state });
89}
90
91ModEntryView::~ModEntryView() {
92

Callers

nothing calls this directly

Calls 15

EventsFunction · 0.85
set_border_colorMethod · 0.80
set_colorMethod · 0.80
set_background_colorMethod · 0.80
set_widthMethod · 0.80
set_heightMethod · 0.80
set_min_widthMethod · 0.80
set_min_heightMethod · 0.80
set_width_autoMethod · 0.80
set_margin_leftMethod · 0.80
set_padding_topMethod · 0.80
set_padding_bottomMethod · 0.80

Tested by

no test coverage detected