MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / top_toolbar

Method top_toolbar

src/Screens/PhoneDrawingProgramScreen.cpp:445–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445void PhoneDrawingProgramScreen::top_toolbar() {
446 auto& gui = main.g.gui;
447 auto& io = gui.io;
448
449 gui.element<LayoutElement>("top toolbar", [&](LayoutElement*, const Clay_ElementId& lId) {
450 CLAY(lId, {}) {
451 window_fill_side_bar(gui, {
452 .dir = WindowFillSideBarConfig::Direction::TOP,
453 .backgroundColor = io.theme->backColor0,
454 .border = {
455 .color = convert_vec4<Clay_Color>(io.theme->frontColor1),
456 .width = {.bottom = 1}
457 }
458 }, [&] {
459 CLAY_AUTO_ID({
460 .layout = {
461 .sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0) },
462 .childAlignment = { .x = CLAY_ALIGN_X_LEFT, .y = CLAY_ALIGN_Y_CENTER},
463 .layoutDirection = CLAY_LEFT_TO_RIGHT
464 }
465 }) {
466 svg_icon_button(gui, "back exit button", "data/icons/RemixIcon/arrow-left-s-line.svg", {
467 .drawType = SelectableButton::DrawType::TRANSPARENT_ALL,
468 .onClick = [&] {
469 save_to_file();
470 main.set_tab_to_close(main.world.get());
471 }
472 });
473 global_log();
474 if(!(main.world->netClient && main.world->clientStillConnecting)) {
475 top_toolbar_remaining_area();
476 top_toolbar_settings_popup();
477 }
478 }
479 });
480 }
481 });
482}
483
484void PhoneDrawingProgramScreen::top_toolbar_remaining_area() {
485 auto& gui = main.g.gui;

Callers

nothing calls this directly

Calls 5

window_fill_side_barFunction · 0.85
CLAY_AUTO_IDFunction · 0.85
svg_icon_buttonFunction · 0.85
set_tab_to_closeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected