[mono/monodevelop] e188e2d5: [TextEditor] Set the background color of the scrolled window as a hint to

"Cody Russell ([email protected])" <[email protected]>
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <00000141b888bb47-081335a8-efa0-4a03-b241-3aa635dc6a9c-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/monodevelop
  Compare: https://github.com/mono/monodevelop/compare/bf3804fa212c...e188e2d50f15

   Commit: e188e2d50f15ba930b882bf5f60cd5447f703aa2
   Author: Cody Russell <[email protected]> (bratsche)
     Date: 2013-10-14 19:53:18 GMT
      URL: https://github.com/mono/monodevelop/commit/e188e2d50f15ba930b882bf5f60cd5447f703aa2

[TextEditor] Set the background color of the scrolled window as a hint to
gtk+ to determine the brightness so it can use either dark or light overlay
scrollbars on Mac.  See bockbuild a5941db3f400834df90bf6c2f312da0a100aeecf

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=15257

Changed paths:
  M main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs

Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
===================================================================
@@ -667,6 +667,8 @@ protected override void OnRealized ()
 
 			imContext.ClientWindow = this.GdkWindow;
 			Caret.PositionChanged += CaretPositionChanged;
+
+			SetWidgetBgFromStyle ();
 		}	
 
 		protected override void OnUnrealized ()
@@ -721,6 +723,15 @@ void SetWidgetBgFromStyle ()
 			// when the bg color is differs from the color style bg color (e.g. oblivion style)
 			if (this.textEditorData.ColorStyle != null && GdkWindow != null) {
 				settingWidgetBg = true; //prevent infinite recusion
+
+				Widget parent = this;
+				while (parent.Parent != null && !(parent is ScrolledWindow)) {
+					parent = parent.Parent;
+				}
+
+				if (parent != null) {
+					parent.ModifyBg (StateType.Normal, (HslColor)this.textEditorData.ColorStyle.PlainText.Background);
+				}
 				
 				this.ModifyBg (StateType.Normal, (HslColor)this.textEditorData.ColorStyle.PlainText.Background);
 				settingWidgetBg = false;
@@ -732,7 +743,6 @@ protected override void OnStyleSet (Gtk.Style previous_style)
 		{
 			base.OnStyleSet (previous_style);
 			if (!settingWidgetBg && textEditorData.ColorStyle != null) {
-//				textEditorData.ColorStyle.UpdateFromGtkStyle (this.Style);
 				SetWidgetBgFromStyle ();
 			}
 		}


_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.