GNOME Bugzilla – Bug 601565
Histogram colours don't update on gtk theme change
Last modified: 2009-11-14 10:52:47 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.
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.
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.
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
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.