After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761765 - Notes have a grey background rather than a custom color
Notes have a grey background rather than a custom color
Status: RESOLVED FIXED
Product: bijiben
Classification: Applications
Component: UI
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: Bijiben maintainer(s)
Bijiben maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-02-09 12:35 UTC by Allan Day
Modified: 2017-04-18 00:31 UTC
See Also:
GNOME target: 3.20
GNOME version: ---


Attachments
Screenshot (1.84 MB, image/png)
2016-02-09 12:35 UTC, Allan Day
  Details
note-view: Fix background color (1019 bytes, patch)
2017-03-17 13:34 UTC, Isaque Galdino
none Details | Review

Description Allan Day 2016-02-09 12:35:23 UTC
Created attachment 320708 [details]
Screenshot

Notes used to have a colored background to match their thumbnail in the content grid. Testing 3.19.x with GNOME Continuous from four days ago, the note background is always grey.

See the attached screenshot.

Also note that the note heading seems to have the wrong font, and doesn't have enough padding above it.
Comment 1 Michael Catanzaro 2016-02-09 17:20:11 UTC
Miiight be bug #757503
Comment 2 Matthias Clasen 2016-03-04 14:10:59 UTC
did anybody have a chance to try if webkitgtk 2.4.10 fixes this ?
Comment 3 Matthias Clasen 2016-03-15 11:49:36 UTC
No success, I'm afraid. The editor background stays gray. Although the text color changes from black to white if I select a dark color.
Comment 4 Pierre-Yves Luyten 2016-03-15 12:44:11 UTC
src/bjb-note-view.c

static void
set_editor_color (GtkWidget *w, GdkRGBA *col)
{
  gtk_widget_override_background_color (w, GTK_STATE_FLAG_NORMAL, col);
}



=> https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-override-background-color

"gtk_widget_override_background_color has been deprecated since version 3.16 and should not be used in newly-written code."



(i did not go further for now)
Comment 5 Matthias Clasen 2016-03-15 13:49:27 UTC
yeah, that won't work anymore

You can do something like 


provider = g_object_get_data (widget, "custom-style");
if (provider == NULL) {
  provider = gtk_css_provider_new ();
  g_object_set_data_full (widget, "custom-style", provider, g_object_unref);
  context = gtk_widget_get_style_context (widget);
  gtk_style_context_add_provider (context, provider);
}

gtk_css_provider_load_from_data (provider, "* { background: MY_FAVORITE_COLOR; }", -1, NULL);
Comment 6 Pierre-Yves Luyten 2016-03-15 15:09:22 UTC
(In reply to Matthias Clasen from comment #5)
> yeah, that won't work anymore
> 
> You can do something like 
> [...]
> 
> gtk_css_provider_load_from_data (provider, "* { background:
> MY_FAVORITE_COLOR; }", -1, NULL);

ok i will see that ; about "MY FAVOURITE COLOR" : from a rough reading "gdk_rgba_to_string" does provide a css compliant string.
Comment 7 Matthias Clasen 2016-03-15 15:30:13 UTC
(In reply to Pierre-Yves Luyten from comment #6)
 
> ok i will see that ; about "MY FAVOURITE COLOR" : from a rough reading
> "gdk_rgba_to_string" does provide a css compliant string.

Yes, that should work.
Comment 8 Matthew Leeds 2016-07-12 18:22:17 UTC
This bug only started occurring for me once I upgraded to Fedora 24, and only when I have Global Dark Mode enabled in GNOME Tweak Tool. When that is set, should we disable the option to change the note background color? That's the approach taken by GNOME Builder.
Comment 9 Yauhen Shulitski 2016-07-14 09:31:53 UTC
I have been having the same issue since I updated to Fedora 24. I don't have Global Dark Mode enabled.
Comment 10 Pampel 2016-07-15 10:30:11 UTC
It's the same for me: no Dark Mode, but no background color after update to F24. Does one of the suggestions above solve the problem? What exactly do I have to do?
Comment 11 Pampel 2016-11-29 12:06:39 UTC
It is still the same with version 3.21.2 on Fedora 25, Wayland session. Does anybody knows a workaround? Any solution?
Comment 12 Michael Catanzaro 2016-11-29 12:42:41 UTC
I suggest you use Gnote instead. It's a nice GNOME 3 notetaking app that's much more mature and has a maintainer who fixes bugs.
Comment 13 Isaque Galdino 2017-03-17 13:34:47 UTC
Created attachment 348176 [details] [review]
note-view: Fix background color

Background color was not being used in text view/editor. The code to
actually set the background was not even there.

After fixing that, as a side effect, it also fixed the text editor which
was messing up all text during text edition.
Comment 14 Isaque Galdino 2017-03-17 13:40:52 UTC
I have pushed this change to my wip/igaldino/webkit2-port branch.

Please take a look in this branch because it's our effort to move to webkit2 (duh) and we really need testing there. Thx.