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

Add explicit colors to labels, buttons and entries. Make colors role based #65

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

olabini
Copy link

@olabini olabini commented Jan 9, 2014

The Pond GUI currently is almost unusable if you have changed the theme to different colors. (For example the Gnome 3 dark theme). As a first step to fixing this, these commits refactor the GUI to use role based colors only, and explicitly setting the colors in all places where necessary.

There are still some issues. Specifically, the main background of the UI, the background of buttons and entries doesn't seem to honor the widgetBase background specification at all - not sure why this happens.

@agl
Copy link
Owner

agl commented Jan 11, 2014

I'd certainly like to get thinks working better on non-default color schemes (although I can't see how to switch GNOME 3 to a different theme).

However, these changes are adding huge amounts of noise to gui.go. Go defaults all values to zero so defaults can be implemented in gtk.go without needing to set the colors of every Label. Also, I would suspect (although I've no idea) that GTK has some standard way to set colors based on the theme, no? I fully admit that the current code is probably wrong for non-default colors and I should probably read the GTK docs about it.

@olabini
Copy link
Author

olabini commented Jan 12, 2014

That's all fair feedback. =) This is the info I've found so far:
You change the theme in Gnome 3 using the gnome-tweak-tool. The standard theme has a default dark version which is the one I'm using.

GTK will use the color from the operating system/WM if you don't set it explicitly, OR you set it to 0. The problem with this is that if you set some of the colors, like the foreground for headers, but nothing else, that means the headers will always have the right color, but the places where you haven't explicitly set the color will use the theme color. That means you can end up with dark font color on dark background very easily.

It seems to me that the only solution is to set ALL the colors explicitly, or set none of them. There might exist an inbetween, but I haven't seen it.

(This is why I set all of the values explicitly in the patch, even though they will sometimes be 0).

I'll continue looking at it and see if I can figure out a better solution. How wedded are you to the current color scheme you're using?

@agl
Copy link
Owner

agl commented Jan 18, 2014

I flipped over to the dark theme and I agree that it's a mess. I also tried disabling all color settings and that's a disaster in every case, so some colors need to be set.

However, having different "themes" in Pond seems like the wrong approach. Rather I think the colors perhaps should be symbolic and resolved via the GTK theme. The Dark theme clearly has a concept of background colors etc. It's perfectly fine for the Pond colors to change somewhat to match.

I'm working on a Cocoa UI at the moment but, if I were playing with this then I think I'd start by poking gtk_style_context_get_background_color, and similar functions, which might do what's needed.

@burdges
Copy link
Contributor

burdges commented Jan 25, 2014

I'd trouble controlling the border of a widget, and finding the right font. See the code and comments here :
burdges@e954483#commitcomment-5178089
which might be another case of wanting to resolve widget properties via GTK's CSS-like system, which I think might be what agl just said. :)

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

Successfully merging this pull request may close these issues.

3 participants