diff options
author | Michael Hutchinson <mhutchinson@novell.com> | 2009-12-02 10:39:42 +0300 |
---|---|---|
committer | Michael Hutchinson <mhutchinson@novell.com> | 2009-12-02 10:39:42 +0300 |
commit | e6e545771ffec6e131a5580752ae81bec0eaaac2 (patch) | |
tree | ea14e6b3e6dbcdbc2128f58a6ec6de3494a6420b /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles | |
parent | 092c50bb84f1ace22a83b8b935975bfd966b497b (diff) |
* src/core/Mono.Texteditor/Mono.TextEditor/TextEditorOptions.cs:
* src/core/Mono.Texteditor/Mono.TextEditor/ITextEditorOptions.cs:
* src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
* src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
Track API.
* src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/DefaultStyle.cs:
Don't attach to a widget, because that leaked easily. Instead,
override the new UpdateFromGtkStyleMethod.
* src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/Style.cs: New
UpdateFromGtkStyleMethod from styles that want to derive their
colours from the current widget's GTK style.
* src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs:
Only use the style, not the whole widget.
* src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs: Track API,
and update the syntax style when the GTK style changes.
* src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
Don't create a syntax style every time we render a row. Instead,
save one, and make sure it's updated when the GTK style chnages.
Fixes leak and perf issues.
svn path=/trunk/monodevelop/; revision=147395
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs index 7158d5a6b0..486b322904 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs @@ -51,6 +51,8 @@ namespace MonoDevelop.Ide.FindInFiles const int SearchResultColumn = 0; const int DidReadColumn = 1; + Mono.TextEditor.Highlighting.Style highlightStyle; + public string BasePath { get; set; @@ -135,8 +137,21 @@ namespace MonoDevelop.Ide.FindInFiles store.SetSortColumnId (3, SortType.Ascending); ShowAll (); + scrolledwindowLogView.Hide (); } + + protected override void OnRealized () + { + base.OnRealized (); + highlightStyle = SyntaxModeService.GetColorStyle (this.Style, PropertyService.Get ("ColorScheme", "Default")); + } + + protected override void OnStyleSet (Gtk.Style previous_style) + { + base.OnStyleSet (previous_style); + highlightStyle.UpdateFromGtkStyle (Style); + } void ButtonPinClicked (object sender, EventArgs e) { @@ -355,11 +370,10 @@ namespace MonoDevelop.Ide.FindInFiles int lineNr = doc.OffsetToLineNumber (searchResult.Offset); LineSegment line = doc.GetLine (lineNr); bool isSelected = treeviewSearchResults.Selection.IterIsSelected (iter); - Mono.TextEditor.Highlighting.Style style = SyntaxModeService.GetColorStyle (this, PropertyService.Get ("ColorScheme", "Default")); string markup; if (doc.SyntaxMode != null) { - markup = doc.SyntaxMode.GetMarkup (doc, new TextEditorOptions (), style, line.Offset, line.EditableLength, true, !isSelected, false); + markup = doc.SyntaxMode.GetMarkup (doc, new TextEditorOptions (), highlightStyle, line.Offset, line.EditableLength, true, !isSelected, false); } else { markup = GLib.Markup.EscapeText (doc.GetTextAt (line.Offset, line.EditableLength)); } @@ -375,12 +389,12 @@ namespace MonoDevelop.Ide.FindInFiles } else { markup = markup.Insert (pos2, "</span>"); } - Gdk.Color searchColor = style.SearchTextBg; + Gdk.Color searchColor = highlightStyle.SearchTextBg; double b1 = HslColor.Brightness (searchColor); - double b2 = HslColor.Brightness (AdjustColor (Style.Base (StateType.Normal), style.Default.Color)); + double b2 = HslColor.Brightness (AdjustColor (Style.Base (StateType.Normal), highlightStyle.Default.Color)); double delta = Math.Abs (b1 - b2); if (delta < 0.1) { - HslColor color1 = style.SearchTextBg; + HslColor color1 = highlightStyle.SearchTextBg; if (color1.L + 0.5 > 1.0) { color1.L -= 0.5; } else { |