~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
using Mono.MHex.Rendering;
30
30
using Gdk;
31
31
using MonoDevelop.Core;
 
32
using MonoDevelop.Ide;
 
33
using Mono.TextEditor;
32
34
 
33
35
namespace MonoDevelop.HexEditor
34
36
{
41
43
                {
42
44
                        this.hexEditor = hexEditor;
43
45
                        SetStyle ();
44
 
                        PropertyService.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) {
45
 
                                if (e.Key == "ColorScheme") {
46
 
                                        SetStyle ();
47
 
                                        this.hexEditor.Options.RaiseChanged ();
48
 
                                        this.hexEditor.PurgeLayoutCaches ();
49
 
                                        this.hexEditor.Repaint ();
50
 
                                }
 
46
                        IdeApp.Preferences.ColorSchemeChanged += delegate {
 
47
                                SetStyle ();
 
48
                                this.hexEditor.Options.RaiseChanged ();
 
49
                                this.hexEditor.PurgeLayoutCaches ();
 
50
                                this.hexEditor.Repaint ();
51
51
                        };
52
52
                }
53
53
                
54
54
                void SetStyle ()
55
55
                {
56
 
                        colorStyle = SyntaxModeService.GetColorStyle (hexEditor.Style, PropertyService.Get ("ColorScheme", "Default"));
 
56
                        colorStyle = SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
57
57
                }
58
58
                
59
59
                public override Color HexOffset {
60
60
                        get {
61
 
                                return colorStyle.LineNumber.Color;
 
61
                                return (HslColor)colorStyle.LineNumbers.Foreground;
62
62
                        }
63
63
                }
64
64
                
65
65
                public override Color HexOffsetBg {
66
66
                        get {
67
 
                                return colorStyle.LineNumber.BackgroundColor;
 
67
                                return (HslColor)colorStyle.LineNumbers.Background;
68
68
                        }
69
69
                }
70
70
                
71
71
                public override Color HexOffsetHighlighted {
72
72
                        get {
73
 
                                return Mono.TextEditor.Highlighting.ColorScheme.ToGdkColor (colorStyle.LineNumberFgHighlighted);
 
73
                                return (HslColor)colorStyle.LineMarker.Color;
74
74
                        }
75
75
                }
76
76
                
77
77
                public override Color HexDigit {
78
78
                        get {
79
 
                                return colorStyle.Default.Color;
 
79
                                return (HslColor)colorStyle.PlainText.Foreground;
80
80
                        }
81
81
                }
82
82
                
83
83
                public override Color HexDigitBg {
84
84
                        get {
85
 
                                return colorStyle.Default.BackgroundColor;
 
85
                                return (HslColor)colorStyle.PlainText.Background;
86
86
                        }
87
87
                }
88
88
                
89
89
                public override Color DashedLineFg {
90
90
                        get {
91
 
                                return colorStyle.Default.Color;
 
91
                                return (HslColor)colorStyle.PlainText.Foreground;
92
92
                        }
93
93
                }
94
94
                
95
95
                public override Color DashedLineBg {
96
96
                        get {
97
 
                                return colorStyle.Default.BackgroundColor;
 
97
                                return (HslColor)colorStyle.PlainText.Background;
98
98
                        }
99
99
                }
100
100
                
101
101
                public override Color IconBarBg {
102
102
                        get {
103
 
                                return Mono.TextEditor.Highlighting.ColorScheme.ToGdkColor (colorStyle.IconBarBg);
 
103
                                return (HslColor) (colorStyle.IndicatorMarginSeparator.Color);
104
104
                        }
105
105
                }
106
106
                
107
107
                public override Color IconBarSeperator {
108
108
                        get {
109
 
                                return Mono.TextEditor.Highlighting.ColorScheme.ToGdkColor (colorStyle.IconBarSeperator);
 
109
                                return (HslColor) (colorStyle.IndicatorMarginSeparator.Color);
110
110
                        }
111
111
                }
112
112
                
113
113
                public override Color BookmarkColor1 {
114
114
                        get {
115
 
                                return Mono.TextEditor.Highlighting.ColorScheme.ToGdkColor (colorStyle.BookmarkColor1);
 
115
                                return (HslColor) (colorStyle.Bookmarks.Color);
116
116
                        }
117
117
                }
118
118
                
119
119
                public override Color BookmarkColor2 {
120
120
                        get {
121
 
                                return Mono.TextEditor.Highlighting.ColorScheme.ToGdkColor (colorStyle.BookmarkColor2);
 
121
                                return (HslColor) (colorStyle.Bookmarks.SecondColor);
122
122
                        }
123
123
                }
124
124
                
125
125
                public override Color Selection {
126
126
                        get {
127
 
                                return colorStyle.Selection.Color;
 
127
                                return (HslColor)colorStyle.SelectedText.Foreground;
128
128
                        }
129
129
                }
130
130
                
131
131
                public override Color SelectionBg {
132
132
                        get {
133
 
                                return colorStyle.Selection.BackgroundColor;
 
133
                                return (HslColor)colorStyle.SelectedText.Background;
134
134
                        }
135
135
                }
136
136
                
137
137
                public override Color HighlightOffset {
138
138
                        get {
139
 
                                return Mono.TextEditor.Highlighting.ColorScheme.ToGdkColor (colorStyle.SearchTextBg);
 
139
                                return (HslColor) (colorStyle.SearchResult.Color);
140
140
                        }
141
141
                }
142
142
        }