Hello, I’m trying to get tab bar aligned with another widget using SameLine()
but the content is still shifted to the next “row”. If I put SameLine()
before Text
- text will appear on a tabs line, but not “inside”:
Here’s a code I added to the demo:
ImGui::Text("Lists:");
static int selection[4] = { 0, 1, 2, 3 };
for (int i = 0; i < 4; i++)
{
if (i > 0) ImGui::SameLine();
ImGui::PushID(i);
ImGui::ListBox("", &selection[i], items, IM_ARRAYSIZE(items));
ImGui::PopID();
//if (ImGui::IsItemHovered()) ImGui::SetTooltip("ListBox %d hovered", i);
}
ImGui::SameLine();
if(ImGui::BeginTabBar("tabs", 0)) {
if(ImGui::BeginTabItem("item")) {
ImGui::Text("test tab text");
ImGui::EndTabItem();
}
if(ImGui::BeginTabItem("item2")) {
ImGui::Text("test 2222 tab text");
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
ImGui::PopItemWidth();