GNOME Bugzilla – Bug 680666
Contacts/Tasks/Memos preview panel does not follow theme colors
Last modified: 2013-09-13 01:07:14 UTC
Cloning bug #679404 per request: Preview panel in Contacts/Tasks/Memos does not follow color set in theme.
Created attachment 219736 [details] [review] Fix
One regression, in Adwaita theme I see the background gray, instead of white, in all views. I didn't notice before (in bug #679404), unfortunately. It's not that visible in mailer, only when no message is selected and when "Retrieving", but it other views it's obvious. I do not know why, but in HighContrast theme I see black background with black font color, which means nothing readable in views. I'm pretty sure it wasn't this way, was it? HighContrastInverse is fine. Another thing, changing theme style doesn't update preview styles in these views.
Created attachment 219886 [details] [review] Fixed patch (In reply to comment #2) > One regression, in Adwaita theme I see the background gray, instead of white, > in all views. I didn't notice before (in bug #679404), unfortunately. It's not > that visible in mailer, only when no message is selected and when "Retrieving", but it other views it's obvious. Not a regression, but a result of your request in comment 15 in bug #679404 to respect background color in empty webview. The grayish color seem to match Adwaita's default background color (question remains how to obtain the white color - what state of background is it?) > I do not know why, but in HighContrast theme I see black background with black > font color, which means nothing readable in views. I'm pretty sure it wasn't > this way, was it? HighContrastInverse is fine. (gdb) call gtk_widget_get_style (display); $16 = 6998704 (gdb) call gtk_widget_get_state (display); $17 = 0 (gdb) print ((GtkStyle*)$16)->bg[$17] $18 = { pixel = 0, red = 56540, green = 56026, blue = 54741 } (gdb) call gtk_widget_get_style_context (display) $19 = 16422704 (gdb) call gtk_widget_get_state_flags (display) $20 = 0 call malloc (sizeof (GdkRGBA *)) $21 = 21050704 (gdb) call gtk_style_context_get_background_color ($19, $20, $21) $22 = 6342336 (gdb) print *((GdkRGBA *) $21) $23 = { red = 0, green = 0, blue = 0, alpha = 0 } Is it possible that GtkStyleContext is broken? I decided to use it just to see if it would be possible and how difficult it would be to port the formatter from GtkStyle to GtkStyleContext. This updated patch uses GtkStyle, as it's much easier to use and works as expected. I also ported e_web_view_clear() to GtkStyle, as there was the very same problem. > > Another thing, changing theme style doesn't update preview styles in these > views. Fixed.
(In reply to comment #3) > Created an attachment (id=219886) [details] [review] > Fixed patch > > (In reply to comment #2) > > One regression, in Adwaita theme I see the background gray, instead of white, > > in all views. I didn't notice before (in bug #679404), unfortunately. It's not > > that visible in mailer, only when no message is selected and when "Retrieving", but it other views it's obvious. > > Not a regression, but a result of your request in comment 15 in bug #679404 to > respect background color in empty webview. The grayish color seem to match > Adwaita's default background color (question remains how to obtain the white > color - what state of background is it?) You use it in text/plain iframe, and I only want it here too, because it is the same meaning in other views, same as in empty or "Retrieving message" view. The current patch still makes it light gray. > Is it possible that GtkStyleContext is broken? I decided to use it just to see > if it would be possible and how difficult it would be to port the formatter > from GtkStyle to GtkStyleContext. This updated patch uses GtkStyle, as it's > much easier to use and works as expected. I also ported e_web_view_clear() to > GtkStyle, as there was the very same problem. Please file a bug in gtk+, and maybe ask someone to give you a quick advice. GtkStyle is deprecated. > > > > > Another thing, changing theme style doesn't update preview styles in these > > views. > > Fixed. It doesn't work fully. I open a Tasks view, select a task, thus it's in preview. I change theme from Adwaita to High contrast, then to HighContrastInverse, then to Low Contrast and the preview panel is still with black background. I than change selcted Task and the background with font color changes to gray, as defined by LowContrast. I guess it's related to GtkStyle, you might stay with GtkStyleContext. Or call to gtk_style_context_invalidate() is missing/required, regardless the comment in documentation.
By the way, thinking of e_rgba_to_value() (and apparently e_color_to_value(), which I wrote some time ago), it is not accurate, because what you need is value between 0 and 255, but you convert 0.0...1.0 to 16 bits and then take only high-byte of it. More precise would be '0xFF * rgba->red'. Similar change to e_color_to_value(), possibly involving convert from GdkColor to GdkRGBA.
Created attachment 220077 [details] [review] Fixed patch Fixed background color of "Retrieving message..." message and all the preview panes > > Is it possible that GtkStyleContext is broken? I decided to use it just to > > see if it would be possible and how difficult it would be to port the > > formatter from GtkStyle to GtkStyleContext. This updated patch uses > > GtkStyle, as it's much easier to use and works as expected. I also ported > > e_web_view_clear() to GtkStyle, as there was the very same problem. > > Please file a bug in gtk+, and maybe ask someone to give you a quick advice. > GtkStyle is deprecated. I have no idea what they are doing there but gtk_style_context_get_background_color() does not give me white background, no matter what state flag I pass (or what source I use - GtkWindow or WebKitWebView). I propose to stick with GtkStyle for now. It works and I think that it's better to keep it consistent across the codebase. I believe it's better to use one style source, rather then two different. Too many things can break. We can make complete GtkStyleContext transition later... > It doesn't work fully. I open a Tasks view, select a task, thus it's in > preview. I change theme from Adwaita to High contrast, then to > HighContrastInverse, then to Low Contrast and the preview panel is still with > black background. I than change selcted Task and the background with font > color changes to gray, as defined by LowContrast. I guess it's related to > GtkStyle, you might stay with GtkStyleContext. Or call to > gtk_style_context_invalidate() is missing/required, regardless the comment > in documentation. Tried with GtkStyleContext and it didn't really help. First switch is OK, but switching to another theme breaks it. Evolution does not cope with it well in general, so user has to restart it anyway after changing theme more then twice in row. So I think it does not really matter atm. We can deal with it when porting to GtkStyleContext.
OK, please commit. Thanks.
Comment on attachment 220077 [details] [review] Fixed patch Committed to git master as a456ef6 http://git.gnome.org/browse/evolution/commit/?id=a456ef68fd8cb97faa2fc0f0ecf6341aec2dcc1d