mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-09 23:54:20 +00:00
Demo: removed some hardcoded widths.
This commit is contained in:
parent
60f8b0733c
commit
7f78f52243
2 changed files with 4 additions and 6 deletions
|
|
@ -4582,16 +4582,14 @@ static void DemoWindowLayout()
|
|||
|
||||
// Various
|
||||
static float f0 = 1.0f, f1 = 2.0f, f2 = 3.0f;
|
||||
ImGui::PushItemWidth(80);
|
||||
ImGui::PushItemWidth(ImGui::CalcTextSize("AAAAAAA").x);
|
||||
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" };
|
||||
static int item = -1;
|
||||
ImGui::Combo("Combo", &item, items, IM_ARRAYSIZE(items)); ImGui::SameLine();
|
||||
ImGui::SliderFloat("X", &f0, 0.0f, 5.0f); ImGui::SameLine();
|
||||
ImGui::SliderFloat("Y", &f1, 0.0f, 5.0f); ImGui::SameLine();
|
||||
ImGui::SliderFloat("Z", &f2, 0.0f, 5.0f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
ImGui::Text("Lists:");
|
||||
static int selection[4] = { 0, 1, 2, 3 };
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
|
@ -5026,7 +5024,7 @@ static void DemoWindowLayout()
|
|||
if (explicit_content_size)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(100);
|
||||
ImGui::SetNextItemWidth(ImGui::CalcTextSize("123456").x);
|
||||
ImGui::DragFloat("##csx", &contents_size_x);
|
||||
ImVec2 p = ImGui::GetCursorScreenPos();
|
||||
ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + 10, p.y + 10), IM_COL32_WHITE);
|
||||
|
|
@ -8504,7 +8502,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
|||
}
|
||||
LogFinish();
|
||||
}
|
||||
SameLine(); SetNextItemWidth(120); Combo("##output_type", &output_dest, "To Clipboard\0To TTY\0");
|
||||
SameLine(); SetNextItemWidth(GetFontSize() * 10); Combo("##output_type", &output_dest, "To Clipboard\0To TTY\0");
|
||||
SameLine(); Checkbox("Only Modified Colors", &output_only_modified);
|
||||
|
||||
static ImGuiTextFilter filter;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue