Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting imgui.ColModalWindowDimBg appears to have no affect. #243

Closed
damntourists opened this issue Feb 13, 2024 · 4 comments
Closed

Setting imgui.ColModalWindowDimBg appears to have no affect. #243

damntourists opened this issue Feb 13, 2024 · 4 comments

Comments

@damntourists
Copy link

I'm finding that I'm unable to set the color/alpha of the overlay for modal windows. Is this a known issue?

imgui.PushStyleColorVec4(imgui.ColModalWindowDimBg, imgui.Vec4{0.8, 0.8, 0.8, 0.8})
@gucio321
Copy link
Collaborator

could you please put some more code
also does it work with C++ Dear ImGui?

@damntourists
Copy link
Author

Sure, here's where I was using it:

func AddSceneModal() {
	if AddSceneModalOpened {
		imgui.OpenPopupStr(AddSceneModalTitle)
	}

	flags := imgui.WindowFlagsNoMove |
		imgui.WindowFlagsNoSavedSettings |
		imgui.WindowFlagsAlwaysAutoResize
 
        // No matter what color I use, it doesn't show up. 
        // Even the default color is not present.  
	imgui.PushStyleColorVec4(imgui.ColModalWindowDimBg,
		imgui.Vec4{0.8, 0.8, 0.8, 0.8})

	var inputName string
	if imgui.BeginPopupModalV(AddSceneModalTitle, nil, imgui.WindowFlags(flags)) {
		imgui.SetKeyboardFocusHere()
		if imgui.InputTextWithHint("##AddSceneNameInput", "Name", &inputName,
			imgui.InputTextFlagsEnterReturnsTrue, nil) {
                        // TODO
			AddSceneModalOpened = false
			imgui.CloseCurrentPopup()
		}

		if imgui.Button("Close") {
			imgui.CloseCurrentPopup()
			AddSceneModalOpened = false
		}
		imgui.EndPopup()
	}

	imgui.PopStyleColor()
}

I have not tried this in C++ since it's not a language I'm too familiar with yet. I'll give it a shot in a bit to see if I can replicate in C++ though.

@Wieku
Copy link
Contributor

Wieku commented Feb 23, 2024

It's an issue within imgui itself that you could only set it globally (ocornut/imgui#7340)

It's fixed in 1.90.4

@damntourists
Copy link
Author

damntourists commented Feb 23, 2024

Awesome, thanks for updating this thread! I'll close it out.

gucio321 added a commit to gucio321/cimgui-go that referenced this issue Feb 23, 2024
in reference to AllenDang#243 we need to update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants