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 601565 - Histogram colours don't update on gtk theme change
Histogram colours don't update on gtk theme change
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
GIT
Other Linux
: Normal minor
: ---
Assigned To: Ruben Vermeersch
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-11 16:04 UTC by Paul Wellner Bou
Modified: 2009-11-14 10:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for InfoBox.cs (1.24 KB, patch)
2009-11-11 16:04 UTC, Paul Wellner Bou
committed Details | Review

Description Paul Wellner Bou 2009-11-11 16:04:14 UTC
Created attachment 147483 [details] [review]
Patch for InfoBox.cs

If the gtk theme of f-spot is changed in the preferences dialog, the colours of
the histogram are not updated. A restart of f-spot is required for this.

I attach the patch, which at the same time removes the dependency of
MainWindow.Toplevel to make the transition to App.Instance.Organizer
possible/easier.
Comment 1 Ruben Vermeersch 2009-11-12 09:32:21 UTC
Review of attachment 147483 [details] [review]:

Okay, but I wonder how the initial styling is being applied.

Could you elaborate?

::: src/Widgets/InfoBox.cs
@@ +192,3 @@
+				histogram.BackgroundColorHint = 0xff;
+				UpdateHistogram ();
+			};

How does this make sure that the histogram colors are changed when first starting?

Is StyleSet fired upon creation?

Also, there's a possible race condition here, as you're using histogram before it's instantiated. That being said, I don't think this will ever bite us, as the histogram is created in the mainloop (and the event obviously will occur there too). So feel free to ignore that.
Comment 2 Paul Wellner Bou 2009-11-12 09:36:29 UTC
Yes, StyleSet is fired upon creation. I checked this with debug log output.

Yes, there is a theoretical race condition. Although StyleSet will be called only when histogram exists yet. At least with the source we have now. Nevertheless we could introduce a null check before.
Comment 3 Paul Wellner Bou 2009-11-12 09:37:50 UTC
To make it easier I created a branch on gitorious, too. Not sure what is easier for you.

http://gitorious.org/~paulwb/f-spot/paulwbs-clone/commit/d802717e99a5470d8eaced174e30681d4799456e
Comment 4 Ruben Vermeersch 2009-11-12 09:46:22 UTC
Branch makes it easier to merge, yet attached patches make it easier to review (the new spliter review tool is awesome).

Can go in for me. Can't do it here at work (don't have an f-spot clone on this machine yet), so marking it as commit-now.