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

Color issue or theme override needed? #6

Closed
Wajinn opened this issue Dec 2, 2022 · 3 comments
Closed

Color issue or theme override needed? #6

Wajinn opened this issue Dec 2, 2022 · 3 comments

Comments

@Wajinn
Copy link

Wajinn commented Dec 2, 2022

Since WindowConfig seems not to allow selecting the true rgb color with color:, and instead gives some variation of theme colors. Maybe something can be done. Possibly an explicit theme: false, to allow user defined background color for window.

mut app := m.create(m.WindowConfig{title: "Test", color: [255,250,250], scrollbar: false, width: 200, height: 200, ask_quit: true})

@malisipi
Copy link
Owner

malisipi commented Dec 2, 2022

I am using the rgb color to create color palette. So, you are seeing variants of the main color. If you're wanting to set background color. You can modify color palette or create a rect with your color. But supporting a background color is good idea.

@Wajinn
Copy link
Author

Wajinn commented Dec 2, 2022

Yes, some way that allows setting the background color, and maybe turning the theme off, as an option in WindowConfig would appear to be more obvious and better for users.

Had already noticed that rect could be used as a workaround. However, (on Windows) there is an intermittent redraw/resize issue that shows up at the top and right border, as a kind of dark line. I'm thinking it has something to do with conflicting colors involving near white, as doesn't appear to show up in themes or when the window is alone. I have been playing around if there was an easy way to completely overcome it. Maybe making rect bigger than the visible window, or something. This does not appear to be an issue with your code, but rather the gx/gg implementation, so if a fix is needed for that specifically then it will likely come from over there.

mut app := m.create(m.WindowConfig{title: "Test", color: [255,250,250], scrollbar: false, width: 200, height: 200, ask_quit: true})
app.rect(m.Widget{id: "rect", x: 0, y: 0, width: "100%x" height: "100%y", background: gx.Color{255, 250, 250, 255}})
app.run()

malisipi added a commit that referenced this issue Dec 2, 2022
@malisipi
Copy link
Owner

malisipi commented Dec 2, 2022

Still needed to add color option to create color palette (for widgets) but you can also use background option.

I recommend to set color; if you don't, mui will creates custom color palette according to users system theme. That can make your application with bad looking (like white text onto light yellow background etc.)

Example usage: https://github.com/malisipi/mui/blob/main/examples/custom_background.v

@Wajinn Wajinn closed this as completed Dec 2, 2022
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

2 participants