mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-25 17:16:35 +00:00
Style Editor: Sneakily adding a combo box to change colors (#707)
This commit is contained in:
parent
331eac511e
commit
c1b5eab868
@ -1852,6 +1852,16 @@ void ImGui::ShowTestWindow(bool* p_open)
|
|||||||
void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||||
{
|
{
|
||||||
ImGuiStyle& style = ImGui::GetStyle();
|
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)
|
// 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
|
const ImGuiStyle default_style; // Default style
|
||||||
@ -1865,8 +1875,6 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
|||||||
*ref = style;
|
*ref = style;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.55f);
|
|
||||||
|
|
||||||
if (ImGui::TreeNode("Rendering"))
|
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.");
|
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…
Reference in New Issue
Block a user