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 753272 - stickynotes: some settings are ignored
stickynotes: some settings are ignored
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: stickynotes
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-05 08:04 UTC by Balló György
Modified: 2015-11-15 04:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stickynotes: don't ignore font type (1.66 KB, patch)
2015-11-02 00:26 UTC, Balló György
committed Details | Review

Description Balló György 2015-08-05 08:04:40 UTC
Open the settings of Sticky Notes applet, and try to set font color, background color and font type. All of them ignored.
Comment 1 Alberts Muktupāvels 2015-08-05 08:57:05 UTC
Most likely it will be fixed when ported to GtkStyleContext... I have no time to do it right now.

stickynote_set_color and stickynote_set_font still use GtkRcStyle that is/was GTK+ 2 thing and I would not be surprised if that does not work with GTK+ 3.

I have done few wrong things in this 8ff396c8ad595ac4f342521a9ddfcfbe5e2578db commit, but reverting them does not fix this bug.

Wrong things:
-			colors[i].red = (colors[i].red * (10 - i)) / 10;
-			colors[i].green = (colors[i].green * (10 - i)) / 10;
-			colors[i].blue = (colors[i].blue * (10 - i)) / 10;
+			colors[i].red = (color.red * (10 - i)) / 10;
+			colors[i].green = (color.green * (10 - i)) / 10;
+			colors[i].blue = (color.blue * (10 - i)) / 10;

and

+		font_color.red = color.red;
+		font_color.green = color.green;
+		font_color.blue = color.blue;

Wrong because GdkColor values are from 0 - 65535, but GdkRGBA use 0 - 1.
Comment 2 Alberts Muktupāvels 2015-10-13 02:22:58 UTC
I have restored color settings, but result might not be same as it used to be...
Comment 3 Balló György 2015-11-02 00:25:21 UTC
Thanks, it works well. But font type settings are still ignored, and I created a patch, which fixes the problem.
Comment 4 Balló György 2015-11-02 00:26:10 UTC
Created attachment 314600 [details] [review]
stickynotes: don't ignore font type
Comment 5 Alberts Muktupāvels 2015-11-02 12:52:13 UTC
(In reply to György Balló from comment #4)
> Created attachment 314600 [details] [review] [review]
> stickynotes: don't ignore font type

Patch looks good to me, but can I ask you to redo patch without using deprecated function? It is not required, but it would be nice if you do it.

For example you can look here:
https://github.com/vain/slinp/commit/3f56e9473f62b3704d92b560715658556108ec78
Comment 6 Balló György 2015-11-04 21:04:56 UTC
I tried it, but I don't know how to restrict the specific CSS style for the actual note.
Comment 7 Alberts Muktupāvels 2015-11-10 14:55:36 UTC
1) Add 'gchar *name;' in StickyNote struct.
2) In stickynote_new_aux generate name for example sticky-note-x, where x unique number/id. Probably add: static gint get_next_id (void) { static gint id = 0; return id++; } Use gtk_widget_set_name to set generated name.
3) Don't forget to free name in stickynote_free.

Then you can use generated name to limit style for note. For example #sticky-note-1 { font: xxx; }

Ideally we could store GtkCssProvider in struct, create function that generates css not only for font, but also for colors and then call this function from stickynote_set_color and stickynote_set_font.
Comment 8 Balló György 2015-11-14 07:34:07 UTC
Oh, it's so difficult to replace the gtk_widget_override_font function... I'm afraid that I can't implement this stuff. Could you implement it?
Comment 9 Alberts Muktupāvels 2015-11-15 04:11:08 UTC
(In reply to György Balló from comment #8)
> Oh, it's so difficult to replace the gtk_widget_override_font function...
> I'm afraid that I can't implement this stuff. Could you implement it?

Currently I have no free time to do this... :( I pushed your patch.