Imgui: How to remove, or change the shading effect when dialog open

Created on 13 Apr 2019  路  4Comments  路  Source: ocornut/imgui

I am wanting to provide a theme-edit series of options for my program but in order to see the result of the modifications 'real time' it would be preferable if the main canvas/background wasn't shaded out.

Is this possible, have I missed something obvious (would not surprise me one bit!)

s

Most helpful comment

I think you can use ImGuiCol_ModalWindowDimBg for that purpose

ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(R, G, B, A);

imgui.h: ~line 1057
image

All 4 comments

I think you can use ImGuiCol_ModalWindowDimBg for that purpose

ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(R, G, B, A);

imgui.h: ~line 1057
image

Perfect! Thank you ( basically set 'A'lpha to 0 ).

s

Note this is only shown when using a modal dialog which are meant to disable interactions with other windows.

If you open just any other kind of window it wouldn鈥檛 display the dimming bg. You may just use a regular window and let the user interact with it along with the rest of the app!

You may just use a regular window and let the user interact with it along with the rest of the app!

That option was also suggested by another person (outside of this thread). Considering the nature of the dialog, it might be a superior option. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noche-x picture noche-x  路  3Comments

KaungZawHtet picture KaungZawHtet  路  3Comments

DarkLinux picture DarkLinux  路  3Comments

NPatch picture NPatch  路  3Comments

bogdaNNNN1 picture bogdaNNNN1  路  3Comments