mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-24 02:14:22 +00:00
Style Editor: Sneakily adding a combo box to change colors (#707)
This commit is contained in:
parent
331eac511e
commit
c1b5eab868
1 changed files with 10 additions and 2 deletions
|
|
@ -1852,6 +1852,16 @@ void ImGui::ShowTestWindow(bool* p_open)
|
|||
void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
{
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.55f);
|
||||
|
||||
// Style selector
|
||||
static int style_idx = 0;
|
||||
if (ImGui::Combo("Colors##Selector", &style_idx, "Classic\0Dark\0"))
|
||||
switch (style_idx)
|
||||
{
|
||||
case 0: ImGui::StyleColorsClassic(); break;
|
||||
case 1: ImGui::StyleColorsDark(); break;
|
||||
}
|
||||
|
||||
// You can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it compares to the default style)
|
||||
const ImGuiStyle default_style; // Default style
|
||||
|
|
@ -1865,8 +1875,6 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
|||
*ref = style;
|
||||
}
|
||||
|
||||
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.55f);
|
||||
|
||||
if (ImGui::TreeNode("Rendering"))
|
||||
{
|
||||
ImGui::Checkbox("Anti-aliased lines", &style.AntiAliasedLines); ImGui::SameLine(); ShowHelpMarker("When disabling anti-aliasing lines, you'll probably want to disable borders in your style as well.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue