MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / CalcNextTotalWidth

Method CalcNextTotalWidth

imgui_tiny_app/imgui/imgui_widgets.cpp:9004–9023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9002}
9003
9004void ImGuiMenuColumns::CalcNextTotalWidth(bool update_offsets)
9005{
9006 ImU16 offset = 0;
9007 bool want_spacing = false;
9008 for (int i = 0; i < IM_COUNTOF(Widths); i++)
9009 {
9010 ImU16 width = Widths[i];
9011 if (want_spacing && width > 0)
9012 offset += Spacing;
9013 want_spacing |= (width > 0);
9014 if (update_offsets)
9015 {
9016 if (i == 1) { OffsetLabel = offset; }
9017 if (i == 2) { OffsetShortcut = offset; }
9018 if (i == 3) { OffsetMark = offset; }
9019 }
9020 offset += width;
9021 }
9022 NextTotalWidth = offset;
9023}
9024
9025float ImGuiMenuColumns::DeclColumns(float w_icon, float w_label, float w_shortcut, float w_mark)
9026{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected