34 ImGuiStyle* style = &ImGui::GetStyle();
35 ImVec4* colors = style->Colors;
37 style->WindowPadding = ImVec2(8.f, 8.f);
38 style->FramePadding = ImVec2(6.f, 3.f);
39 style->CellPadding = ImVec2(6.f, 4.f);
40 style->ItemSpacing = ImVec2(6.f, 4.f);
41 style->ItemInnerSpacing = ImVec2(6.f, 4.f);
42 style->TouchExtraPadding = ImVec2(0.f, 0.f);
43 style->IndentSpacing = 20.f;
44 style->ScrollbarSize = 14.f;
45 style->GrabMinSize = 14.f;
47 style->WindowBorderSize = 1.f;
48 style->ChildBorderSize = 0.f;
49 style->PopupBorderSize = 1.f;
50 style->FrameBorderSize = 0.f;
51 style->TabBorderSize = 0.f;
53 style->WindowRounding = 2.f;
54 style->ChildRounding = 3.f;
55 style->FrameRounding = 4.f;
56 style->PopupRounding = 4.f;
57 style->ScrollbarRounding = 4.f;
58 style->TabRounding = 3.f;
60 auto alttpDarkGreen = ImVec4(0.18f, 0.26f, 0.18f, 1.0f);
61 auto alttpMidGreen = ImVec4(0.28f, 0.36f, 0.28f, 1.0f);
62 auto allttpLightGreen = ImVec4(0.36f, 0.45f, 0.36f, 1.0f);
63 auto allttpLightestGreen = ImVec4(0.49f, 0.57f, 0.49f, 1.0f);
65 colors[ImGuiCol_MenuBarBg] = alttpDarkGreen;
66 colors[ImGuiCol_TitleBg] = alttpMidGreen;
68 colors[ImGuiCol_Header] = alttpDarkGreen;
69 colors[ImGuiCol_HeaderHovered] = allttpLightGreen;
70 colors[ImGuiCol_HeaderActive] = alttpMidGreen;
72 colors[ImGuiCol_TitleBgActive] = alttpDarkGreen;
73 colors[ImGuiCol_TitleBgCollapsed] = alttpMidGreen;
75 colors[ImGuiCol_Tab] = alttpDarkGreen;
76 colors[ImGuiCol_TabHovered] = alttpMidGreen;
77 colors[ImGuiCol_TabSelected] = ImVec4(0.347f, 0.466f, 0.347f, 1.000f);
79 colors[ImGuiCol_Button] = alttpMidGreen;
80 colors[ImGuiCol_ButtonHovered] = allttpLightestGreen;
81 colors[ImGuiCol_ButtonActive] = allttpLightGreen;
83 colors[ImGuiCol_ScrollbarBg] = ImVec4(0.36f, 0.45f, 0.36f, 0.60f);
84 colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.36f, 0.45f, 0.36f, 0.30f);
85 colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.36f, 0.45f, 0.36f, 0.40f);
86 colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.36f, 0.45f, 0.36f, 0.60f);
88 colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
89 colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
90 colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.85f);
91 colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
92 colors[ImGuiCol_PopupBg] = ImVec4(0.11f, 0.11f, 0.14f, 0.92f);
93 colors[ImGuiCol_Border] = allttpLightGreen;
94 colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
96 colors[ImGuiCol_FrameBg] = ImVec4(0.43f, 0.43f, 0.43f, 0.39f);
97 colors[ImGuiCol_FrameBgHovered] = ImVec4(0.28f, 0.36f, 0.28f, 0.40f);
98 colors[ImGuiCol_FrameBgActive] = ImVec4(0.28f, 0.36f, 0.28f, 0.69f);
100 colors[ImGuiCol_CheckMark] =
101 ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
103 colors[ImGuiCol_CheckboxSelectedBg] =
104 ImLerp(colors[ImGuiCol_FrameBg], colors[ImGuiCol_FrameBgHovered], 0.65f);
105 colors[ImGuiCol_SliderGrab] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f);
106 colors[ImGuiCol_SliderGrabActive] = ImVec4(0.36f, 0.45f, 0.36f, 0.60f);
108 colors[ImGuiCol_Separator] = ImVec4(0.50f, 0.50f, 0.50f, 0.60f);
109 colors[ImGuiCol_SeparatorHovered] = ImVec4(0.60f, 0.60f, 0.70f, 1.00f);
110 colors[ImGuiCol_SeparatorActive] = ImVec4(0.70f, 0.70f, 0.90f, 1.00f);
111 colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f);
112 colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.78f, 0.82f, 1.00f, 0.60f);
113 colors[ImGuiCol_ResizeGripActive] = ImVec4(0.78f, 0.82f, 1.00f, 0.90f);
115 colors[ImGuiCol_TabDimmed] =
116 ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f);
117 colors[ImGuiCol_TabDimmedSelected] =
118 ImLerp(colors[ImGuiCol_TabSelected], colors[ImGuiCol_TitleBg], 0.40f);
119 colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
120 colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
121 colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
122 colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
123 colors[ImGuiCol_TableHeaderBg] = alttpDarkGreen;
124 colors[ImGuiCol_TableBorderStrong] = alttpMidGreen;
125 colors[ImGuiCol_TableBorderLight] =
126 ImVec4(0.26f, 0.26f, 0.28f, 1.00f);
127 colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
128 colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.07f);
129 colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f);
130 colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f);
131 colors[ImGuiCol_NavCursor] = colors[ImGuiCol_HeaderHovered];
132 colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f);
133 colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f);
134 colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
141 colors[ImGuiCol_DockingPreview] = ImVec4(0.36f, 0.45f, 0.36f, 0.71f);
142 colors[ImGuiCol_DockingEmptyBg] = alttpDarkGreen;
143 colors[ImGuiCol_InputTextCursor] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
144 colors[ImGuiCol_TextLink] = allttpLightestGreen;
145 colors[ImGuiCol_TreeLines] = colors[ImGuiCol_Separator];
146 colors[ImGuiCol_TabSelectedOverline] = allttpLightestGreen;
147 colors[ImGuiCol_TabDimmedSelectedOverline] = allttpLightestGreen;
150 colors[ImGuiCol_DragDropTargetBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
151 colors[ImGuiCol_UnsavedMarker] = colors[ImGuiCol_Text];
152 style->GrabRounding = 5.f;
359 ImGuiStyle& style = ImGui::GetStyle();
360 static ImGuiStyle ref_saved_style;
363 static bool init =
true;
364 if (init && ref == NULL)
365 ref_saved_style = style;
368 ref = &ref_saved_style;
370 ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f);
373 if (ImGui::CollapsingHeader(tr(
"Theme Management"),
374 ImGuiTreeNodeFlags_DefaultOpen)) {
380 std::string current_theme_name = theme_manager.GetCurrentThemeName();
381 bool is_classic_active = (current_theme_name ==
"Classic YAZE");
384 if (is_classic_active) {
385 ImGui::TextColored(ImVec4(0.2f, 0.8f, 0.2f, 1.0f),
"%s",
386 current_theme_name.c_str());
388 ImGui::Text(
"%s", current_theme_name.c_str());
392 auto current_theme = theme_manager.GetCurrentTheme();
394 ImGui::ColorButton(
"##primary_preview",
396 ImGuiColorEditFlags_NoTooltip, ImVec2(20, 20));
398 ImGui::ColorButton(
"##secondary_preview",
400 ImGuiColorEditFlags_NoTooltip, ImVec2(20, 20));
402 ImGui::ColorButton(
"##accent_preview",
404 ImGuiColorEditFlags_NoTooltip, ImVec2(20, 20));
409 if (is_classic_active) {
410 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.2f, 0.6f, 0.2f, 1.0f));
413 if (ImGui::Button(tr(
"Classic YAZE"))) {
414 theme_manager.ApplyClassicYazeTheme();
415 ref_saved_style = style;
418 if (is_classic_active) {
419 ImGui::PopStyleColor();
423 if (ImGui::Button(tr(
"Reset ColorsYaze"))) {
425 ref_saved_style = style;
429 auto available_themes = theme_manager.GetAvailableThemes();
430 const char* current_file_theme =
"";
433 for (
const auto& theme_name : available_themes) {
434 if (theme_name == current_theme_name) {
435 current_file_theme = theme_name.c_str();
440 ImGui::Text(tr(
"File Themes:"));
441 ImGui::SetNextItemWidth(-1);
442 if (ImGui::BeginCombo(
"##FileThemes", current_file_theme)) {
443 for (
const auto& theme_name : available_themes) {
444 bool is_selected = (theme_name == current_theme_name);
445 if (ImGui::Selectable(theme_name.c_str(), is_selected)) {
446 theme_manager.LoadTheme(theme_name);
447 ref_saved_style = style;
453 if (ImGui::Button(tr(
"Refresh Themes"))) {
454 theme_manager.RefreshAvailableThemes();
457 if (ImGui::Button(tr(
"Open Theme Editor"))) {
458 static bool show_theme_editor =
true;
459 theme_manager.ShowSimpleThemeEditor(&show_theme_editor);
467 bg_renderer.DrawSettingsUI();
471 if (ImGui::ShowStyleSelector(
"Colors##Selector"))
472 ref_saved_style = style;
473 ImGui::ShowFontSelector(
"Fonts##Selector");
476 if (ImGui::SliderFloat(tr(
"FrameRounding"), &style.FrameRounding, 0.0f, 12.0f,
478 style.GrabRounding = style.FrameRounding;
481 bool window_border = (style.WindowBorderSize > 0.0f);
482 if (ImGui::Checkbox(tr(
"WindowBorder"), &window_border)) {
483 style.WindowBorderSize = window_border ? 1.0f : 0.0f;
487 bool frame_border = (style.FrameBorderSize > 0.0f);
488 if (ImGui::Checkbox(tr(
"FrameBorder"), &frame_border)) {
489 style.FrameBorderSize = frame_border ? 1.0f : 0.0f;
493 bool popup_border = (style.PopupBorderSize > 0.0f);
494 if (ImGui::Checkbox(tr(
"PopupBorder"), &popup_border)) {
495 style.PopupBorderSize = popup_border ? 1.0f : 0.0f;
499 if (ImGui::Button(tr(
"Save Ref")))
500 *ref = ref_saved_style = style;
502 if (ImGui::Button(tr(
"Revert Ref")))
508 if (ImGui::BeginTabBar(
"DisplaySettingsTabs", ImGuiTabBarFlags_None)) {
509 if (ImGui::BeginTabItem(tr(
"Sizes"))) {
510 ImGui::SeparatorText(tr(
"Main"));
511 ImGui::SliderFloat2(
"WindowPadding", (
float*)&style.WindowPadding, 0.0f,
513 ImGui::SliderFloat2(
"FramePadding", (
float*)&style.FramePadding, 0.0f,
515 ImGui::SliderFloat2(
"ItemSpacing", (
float*)&style.ItemSpacing, 0.0f,
517 ImGui::SliderFloat2(
"ItemInnerSpacing", (
float*)&style.ItemInnerSpacing,
518 0.0f, 20.0f,
"%.0f");
519 ImGui::SliderFloat2(
"TouchExtraPadding", (
float*)&style.TouchExtraPadding,
520 0.0f, 10.0f,
"%.0f");
521 ImGui::SliderFloat(tr(
"IndentSpacing"), &style.IndentSpacing, 0.0f, 30.0f,
523 ImGui::SliderFloat(tr(
"ScrollbarSize"), &style.ScrollbarSize, 1.0f, 20.0f,
525 ImGui::SliderFloat(tr(
"GrabMinSize"), &style.GrabMinSize, 1.0f, 20.0f,
528 ImGui::SeparatorText(tr(
"Borders"));
529 ImGui::SliderFloat(tr(
"WindowBorderSize"), &style.WindowBorderSize, 0.0f,
531 ImGui::SliderFloat(tr(
"ChildBorderSize"), &style.ChildBorderSize, 0.0f,
533 ImGui::SliderFloat(tr(
"PopupBorderSize"), &style.PopupBorderSize, 0.0f,
535 ImGui::SliderFloat(tr(
"FrameBorderSize"), &style.FrameBorderSize, 0.0f,
537 ImGui::SliderFloat(tr(
"TabBorderSize"), &style.TabBorderSize, 0.0f, 1.0f,
539 ImGui::SliderFloat(tr(
"TabBarBorderSize"), &style.TabBarBorderSize, 0.0f,
542 ImGui::SeparatorText(tr(
"Rounding"));
543 ImGui::SliderFloat(tr(
"WindowRounding"), &style.WindowRounding, 0.0f,
545 ImGui::SliderFloat(tr(
"ChildRounding"), &style.ChildRounding, 0.0f, 12.0f,
547 ImGui::SliderFloat(tr(
"FrameRounding"), &style.FrameRounding, 0.0f, 12.0f,
549 ImGui::SliderFloat(tr(
"PopupRounding"), &style.PopupRounding, 0.0f, 12.0f,
551 ImGui::SliderFloat(tr(
"ScrollbarRounding"), &style.ScrollbarRounding,
552 0.0f, 12.0f,
"%.0f");
553 ImGui::SliderFloat(tr(
"GrabRounding"), &style.GrabRounding, 0.0f, 12.0f,
555 ImGui::SliderFloat(tr(
"TabRounding"), &style.TabRounding, 0.0f, 12.0f,
558 ImGui::SeparatorText(tr(
"Tables"));
559 ImGui::SliderFloat2(
"CellPadding", (
float*)&style.CellPadding, 0.0f,
561 ImGui::SliderAngle(
"TableAngledHeadersAngle",
562 &style.TableAngledHeadersAngle, -50.0f, +50.0f);
564 ImGui::SeparatorText(tr(
"Widgets"));
565 ImGui::SliderFloat2(
"WindowTitleAlign", (
float*)&style.WindowTitleAlign,
567 ImGui::Combo(tr(
"ColorButtonPosition"), (
int*)&style.ColorButtonPosition,
569 ImGui::SliderFloat2(
"ButtonTextAlign", (
float*)&style.ButtonTextAlign,
573 ImGui::SliderFloat2(
"SelectableTextAlign",
574 (
float*)&style.SelectableTextAlign, 0.0f, 1.0f,
578 ImGui::SliderFloat(tr(
"SeparatorTextBorderSize"),
579 &style.SeparatorTextBorderSize, 0.0f, 10.0f,
"%.0f");
580 ImGui::SliderFloat2(
"SeparatorTextAlign",
581 (
float*)&style.SeparatorTextAlign, 0.0f, 1.0f,
583 ImGui::SliderFloat2(
"SeparatorTextPadding",
584 (
float*)&style.SeparatorTextPadding, 0.0f, 40.0f,
586 ImGui::SliderFloat(tr(
"LogSliderDeadzone"), &style.LogSliderDeadzone,
587 0.0f, 12.0f,
"%.0f");
589 ImGui::SeparatorText(tr(
"Tooltips"));
590 for (
int n = 0; n < 2; n++)
591 if (ImGui::TreeNodeEx(n == 0 ?
"HoverFlagsForTooltipMouse"
592 :
"HoverFlagsForTooltipNav")) {
593 ImGuiHoveredFlags* p = (n == 0) ? &style.HoverFlagsForTooltipMouse
594 : &style.HoverFlagsForTooltipNav;
595 ImGui::CheckboxFlags(
"ImGuiHoveredFlags_DelayNone", p,
596 ImGuiHoveredFlags_DelayNone);
597 ImGui::CheckboxFlags(
"ImGuiHoveredFlags_DelayShort", p,
598 ImGuiHoveredFlags_DelayShort);
599 ImGui::CheckboxFlags(
"ImGuiHoveredFlags_DelayNormal", p,
600 ImGuiHoveredFlags_DelayNormal);
601 ImGui::CheckboxFlags(
"ImGuiHoveredFlags_Stationary", p,
602 ImGuiHoveredFlags_Stationary);
603 ImGui::CheckboxFlags(
"ImGuiHoveredFlags_NoSharedDelay", p,
604 ImGuiHoveredFlags_NoSharedDelay);
608 ImGui::SeparatorText(tr(
"Misc"));
609 ImGui::SliderFloat2(
"DisplaySafeAreaPadding",
610 (
float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f,
617 if (ImGui::BeginTabItem(tr(
"Colors"))) {
618 static int output_dest = 0;
619 static bool output_only_modified =
true;
620 if (ImGui::Button(tr(
"Export"))) {
621 if (output_dest == 0)
622 ImGui::LogToClipboard();
625 ImGui::LogText(
"ImVec4* colors = ImGui::GetStyle().Colors;" IM_NEWLINE);
626 for (
int i = 0; i < ImGuiCol_COUNT; i++) {
627 const ImVec4& col = style.Colors[i];
628 const char* name = ImGui::GetStyleColorName(i);
629 if (!output_only_modified ||
630 memcmp(&col, &ref->Colors[i],
sizeof(ImVec4)) != 0)
632 "colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, "
633 "%.2ff);" IM_NEWLINE,
634 name, 23 - (
int)strlen(name),
"", col.x, col.y, col.z, col.w);
639 ImGui::SetNextItemWidth(120);
640 ImGui::Combo(
"##output_type", &output_dest,
"To Clipboard\0To TTY\0");
642 ImGui::Checkbox(tr(
"Only Modified Colors"), &output_only_modified);
644 static ImGuiTextFilter filter;
645 ImGui::SetNextItemWidth(ImGui::GetFontSize() * 16);
646 filter.DrawWithHint(
"Filter colors");
648 static ImGuiColorEditFlags alpha_flags = 0;
651 if (ImGui::RadioButton(tr(
"Opaque"),
652 alpha_flags == ImGuiColorEditFlags_AlphaOpaque)) {
653 alpha_flags = ImGuiColorEditFlags_AlphaOpaque;
656 if (ImGui::RadioButton(tr(
"Alpha"),
657 alpha_flags == ImGuiColorEditFlags_None)) {
658 alpha_flags = ImGuiColorEditFlags_None;
661 if (ImGui::RadioButton(
663 alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) {
664 alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf;
668 ImGui::SetNextWindowSizeConstraints(
669 ImVec2(0.0f, ImGui::GetTextLineHeightWithSpacing() * 10),
670 ImVec2(FLT_MAX, FLT_MAX));
671 ImGui::BeginChild(
"##colors", ImVec2(0, 0),
672 ImGuiChildFlags_Borders | ImGuiChildFlags_NavFlattened,
673 ImGuiWindowFlags_AlwaysVerticalScrollbar |
674 ImGuiWindowFlags_AlwaysHorizontalScrollbar);
675 ImGui::PushItemWidth(ImGui::GetFontSize() * -12);
676 for (
int i = 0; i < ImGuiCol_COUNT; i++) {
677 const char* name = ImGui::GetStyleColorName(i);
678 if (!filter.PassFilter(name))
681 ImGui::ColorEdit4(
"##color", (
float*)&style.Colors[i],
682 ImGuiColorEditFlags_AlphaBar | alpha_flags);
683 if (memcmp(&style.Colors[i], &ref->Colors[i],
sizeof(ImVec4)) != 0) {
688 ImGui::SameLine(0.0f, style.ItemInnerSpacing.x);
689 if (ImGui::Button(tr(
"Save"))) {
690 ref->Colors[i] = style.Colors[i];
692 ImGui::SameLine(0.0f, style.ItemInnerSpacing.x);
693 if (ImGui::Button(tr(
"Revert"))) {
694 style.Colors[i] = ref->Colors[i];
697 ImGui::SameLine(0.0f, style.ItemInnerSpacing.x);
698 ImGui::TextUnformatted(name);
701 ImGui::PopItemWidth();
707 if (ImGui::BeginTabItem(tr(
"Fonts"))) {
708 ImGuiIO& io = ImGui::GetIO();
709 ImFontAtlas* atlas = io.Fonts;
710 ImGui::ShowFontAtlas(atlas);
716 const float MIN_SCALE = 0.3f;
717 const float MAX_SCALE = 2.0f;
719 static float window_scale = 1.0f;
720 ImGui::PushItemWidth(ImGui::GetFontSize() * 8);
721 if (ImGui::DragFloat(
722 tr(
"window scale"), &window_scale, 0.005f, MIN_SCALE, MAX_SCALE,
724 ImGuiSliderFlags_AlwaysClamp))
725 ImGui::SetWindowFontScale(window_scale);
728 ImGui::PopItemWidth();
733 if (ImGui::BeginTabItem(tr(
"Rendering"))) {
734 ImGui::Checkbox(tr(
"Anti-aliased lines"), &style.AntiAliasedLines);
739 ImGui::BeginDisabled(!style.AntiAliasedLines);
740 ImGui::Checkbox(tr(
"Anti-aliased line ends"), &style.AntiAliasedLineEnds);
741 ImGui::EndDisabled();
744 ImGui::Checkbox(tr(
"Anti-aliased fill"), &style.AntiAliasedFill);
745 ImGui::PushItemWidth(ImGui::GetFontSize() * 8);
746 ImGui::DragFloat(tr(
"Curve Tessellation Max Error"),
747 &style.CurveTessellationMaxError, 0.02f, 0.10f, 10.0f,
749 if (style.CurveTessellationMaxError < 0.10f)
750 style.CurveTessellationMaxError = 0.10f;
754 ImGui::DragFloat(tr(
"Circle Tessellation Max Error"),
755 &style.CircleTessellationMaxError, 0.005f, 0.10f, 5.0f,
756 "%.2f", ImGuiSliderFlags_AlwaysClamp);
757 const bool show_samples = ImGui::IsItemActive();
759 ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos());
760 if (show_samples && ImGui::BeginTooltip()) {
761 ImGui::TextUnformatted(tr(
"(R = radius, N = number of segments)"));
763 ImDrawList* draw_list = ImGui::GetWindowDrawList();
764 const float min_widget_width = ImGui::CalcTextSize(
"N: MMM\nR: MMM").x;
765 for (
int n = 0; n < 8; n++) {
766 const float RAD_MIN = 5.0f;
767 const float RAD_MAX = 70.0f;
769 RAD_MIN + (RAD_MAX - RAD_MIN) * (
float)n / (8.0f - 1.0f);
773 ImGui::Text(tr(
"R: %.f\nN: %d"), rad,
774 draw_list->_CalcCircleAutoSegmentCount(rad));
776 const float canvas_width = std::max(min_widget_width, rad * 2.0f);
777 const float offset_x = floorf(canvas_width * 0.5f);
778 const float offset_y = floorf(RAD_MAX);
780 const ImVec2 p1 = ImGui::GetCursorScreenPos();
781 draw_list->AddCircle(ImVec2(p1.x + offset_x, p1.y + offset_y), rad,
782 ImGui::GetColorU32(ImGuiCol_Text));
783 ImGui::Dummy(ImVec2(canvas_width, RAD_MAX * 2));
792 ImGui::DragFloat(tr(
"Global Alpha"), &style.Alpha, 0.005f, 0.20f, 1.0f,
797 ImGui::DragFloat(tr(
"Disabled Alpha"), &style.DisabledAlpha, 0.005f, 0.0f,
800 ImGui::PopItemWidth();
805 ImGui::SeparatorText(tr(
"Debug comparisons"));
806 ImGuiIO& io = ImGui::GetIO();
807 ImGui::Checkbox(tr(
"Debug: pre-1.93 strokes"),
808 &io.ConfigDebugDrawListDefaultsToStrokeLegacy);
809 ImGui::SetItemTooltip(
810 "%s", tr(
"Draw every ImDrawList the way ImGui 1.92 did (legacy "
811 "stroke positions, miter joins, no anti-aliased line "
812 "ends) to compare against 1.93 output."));
813 ImGui::Checkbox(tr(
"Debug: highlight ID conflicts"),
814 &io.ConfigDebugHighlightIdConflicts);
815 ImGui::SetItemTooltip(
816 "%s", tr(
"Highlight items whose ID is used by another item in the "
817 "same frame and show ImGui's error popup for them."));
825 ImGui::PopItemWidth();