Example #1
0
        QuickTaskSeverity DrawQuickTasks(Cairo.Context cr)
        {
            QuickTaskSeverity severity = QuickTaskSeverity.None;
            int h = Allocation.Height - Allocation.Width - 6;

            foreach (var task in AllTasks)
            {
                double y = h * TextEditor.LineToY(task.Location.Line) / Math.Max(TextEditor.EditorLineThreshold * TextEditor.LineHeight + TextEditor.GetTextEditorData().TotalHeight, TextEditor.Allocation.Height);

                var color = (HslColor)GetBarColor(task.Severity);
                cr.Color = color;
                cr.Rectangle(3, y - 1, Allocation.Width - 5, 4);
                cr.FillPreserve();

                color.L *= 0.7;
                cr.Color = color;
                cr.Rectangle(3, y - 1, Allocation.Width - 5, 4);
                cr.Stroke();

                switch (task.Severity)
                {
                case QuickTaskSeverity.Error:
                    severity = QuickTaskSeverity.Error;
                    break;

                case QuickTaskSeverity.Warning:
                    if (severity == QuickTaskSeverity.None)
                    {
                        severity = QuickTaskSeverity.Warning;
                    }
                    break;
                }
            }
            return(severity);
        }
Example #2
0
 public Result(DomRegion region, string message, QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance, bool underline = true)
 {
     this.Region     = region;
     this.Message    = message;
     this.Level      = level;
     this.Certainty  = certainty;
     this.Importance = importance;
     this.Underline  = underline;
 }
Example #3
0
		public Result (DomRegion region, string message, QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance, bool underline = true)
		{
			this.Region = region;
			this.Message = message;
			this.Level = level;
			this.Certainty = certainty;
			this.Importance = importance;
			this.Underline = underline;
		}
Example #4
0
        Cairo.Color GetIndicatorColor(QuickTaskSeverity severity)
        {
            switch (severity)
            {
            case QuickTaskSeverity.Error:
                return(new Cairo.Color(254 / 255.0, 58 / 255.0, 22 / 255.0));

            case QuickTaskSeverity.Warning:
                return(new Cairo.Color(251 / 255.0, 247 / 255.0, 88 / 255.0));

            default:
                return(new Cairo.Color(75 / 255.0, 255 / 255.0, 75 / 255.0));
            }
        }
Example #5
0
        static string GetIcon(QuickTaskSeverity severity)
        {
            switch (severity)
            {
            case QuickTaskSeverity.Error:
                return(Gtk.Stock.DialogError);

            case QuickTaskSeverity.Warning:
                return(Gtk.Stock.DialogWarning);

            case QuickTaskSeverity.Hint:
                return(Gtk.Stock.Info);

            default:
                return(null);
            }
        }
		string GetDescription (QuickTaskSeverity severity)
		{
			switch (severity) {
			case QuickTaskSeverity.None:
				return GettextCatalog.GetString ("Do not show");
			case QuickTaskSeverity.Error:
				return GettextCatalog.GetString ("Error");
			case QuickTaskSeverity.Warning:
				return GettextCatalog.GetString ("Warning");
			case QuickTaskSeverity.Hint:
				return GettextCatalog.GetString ("Hint");
			case QuickTaskSeverity.Suggestion:
				return GettextCatalog.GetString ("Suggestion");
			default:
				throw new ArgumentOutOfRangeException ();
			}
		}
Example #7
0
        void DrawIndicator(Cairo.Context cr, QuickTaskSeverity severity)
        {
            cr.Rectangle(3, Allocation.Height - Allocation.Width + 3, Allocation.Width - 6, Allocation.Width - 6);

            var darkColor = (HslColor)GetIndicatorColor(severity);

            darkColor.L *= 0.5;

            using (var pattern = new Cairo.LinearGradient(0, 0, Allocation.Width - 3, Allocation.Width - 3)) {
                pattern.AddColorStop(0, darkColor);
                pattern.AddColorStop(1, GetIndicatorColor(severity));
                cr.Pattern = pattern;
                cr.FillPreserve();
            }

            cr.Color = darkColor;
            cr.Stroke();
        }
        string GetDescription(QuickTaskSeverity severity)
        {
            switch (severity)
            {
            case QuickTaskSeverity.None:
                return(GettextCatalog.GetString("Do not show"));

            case QuickTaskSeverity.Error:
                return(GettextCatalog.GetString("Error"));

            case QuickTaskSeverity.Warning:
                return(GettextCatalog.GetString("Warning"));

            case QuickTaskSeverity.Hint:
                return(GettextCatalog.GetString("Hint"));

            case QuickTaskSeverity.Suggestion:
                return(GettextCatalog.GetString("Suggestion"));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Example #9
0
        Cairo.Color GetBarColor(QuickTaskSeverity severity)
        {
            switch (severity)
            {
            case QuickTaskSeverity.Error:
                return(TextEditor.ColorStyle.ErrorUnderline);

            case QuickTaskSeverity.Warning:
                return(TextEditor.ColorStyle.WarningUnderline);

            case QuickTaskSeverity.Suggestion:
                return(TextEditor.ColorStyle.SuggestionUnderline);

            case QuickTaskSeverity.Hint:
                return(TextEditor.ColorStyle.HintUnderline);

            case QuickTaskSeverity.None:
                return(TextEditor.ColorStyle.Default.CairoColor);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Example #10
0
		public GenericResults (DomRegion region, string message, QuickTaskSeverity level,
			ResultCertainty certainty, ResultImportance importance, params GenericFix[] fixes)
			: base (region, message, level, certainty, importance)
		{
			this.Fixes = fixes;
		}
 public void SetSeverity(QuickTaskSeverity severity)
 {
     PropertyService.Set("refactoring.inspectors." + MimeType + "." + Type.FullName, severity);
 }
Example #12
0
		public QuickTask (string description, DomLocation location, QuickTaskSeverity severity)
		{
			this.Description = description;
			this.Location = location;
			this.Severity = severity;
		}
Example #13
0
		Cairo.Color GetIndicatorColor (QuickTaskSeverity severity)
		{
			switch (severity) {
			case QuickTaskSeverity.Error:
				return new Cairo.Color (254 / 255.0, 58 / 255.0, 22 / 255.0);
			case QuickTaskSeverity.Warning:
				return new Cairo.Color (251 / 255.0, 247 / 255.0, 88 / 255.0);
			default:
				return new Cairo.Color (75 / 255.0, 255 / 255.0, 75 / 255.0);
			}
		}
Example #14
0
 public QuickTask(string description, DomLocation location, QuickTaskSeverity severity)
 {
     this.Description = description;
     this.Location    = location;
     this.Severity    = severity;
 }
Example #15
0
 public void SetSeverity(QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance)
 {
     this.Level      = level;
     this.Certainty  = certainty;
     this.Importance = importance;
 }
Example #16
0
		Cairo.Color GetBarColor (QuickTaskSeverity severity)
		{
			switch (severity) {
			case QuickTaskSeverity.Error:
				return TextEditor.ColorStyle.ErrorUnderline;
			case QuickTaskSeverity.Warning:
				return TextEditor.ColorStyle.WarningUnderline;
			case QuickTaskSeverity.Suggestion:
				return TextEditor.ColorStyle.SuggestionUnderline;
			case QuickTaskSeverity.Hint:
				return TextEditor.ColorStyle.HintUnderline;
			case QuickTaskSeverity.None:
				return TextEditor.ColorStyle.Default.CairoColor;
			default:
				throw new ArgumentOutOfRangeException ();
			}
		}
Example #17
0
		public void SetSeverity (QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance)
		{
			this.Level = level;
			this.Certainty = certainty;
			this.Importance = importance;
		}
Example #18
0
		void DrawIndicator (Cairo.Context cr, QuickTaskSeverity severity)
		{
			cr.Rectangle (3, Allocation.Height - Allocation.Width + 3, Allocation.Width - 6, Allocation.Width - 6);
			
			var darkColor = (HslColor)GetIndicatorColor (severity);
			darkColor.L *= 0.5;
			
			using (var pattern = new Cairo.LinearGradient (0, 0, Allocation.Width - 3, Allocation.Width - 3)) {
				pattern.AddColorStop (0, darkColor);
				pattern.AddColorStop (1, GetIndicatorColor (severity));
				cr.Pattern = pattern;
				cr.FillPreserve ();
			}
			
			cr.Color = darkColor;
			cr.Stroke ();
		}
		public void SetSeverity (QuickTaskSeverity severity)
		{
			PropertyService.Set ("refactoring.inspectors." + MimeType + "." + Type.FullName, severity);
		}
Example #20
0
		static string GetIcon (QuickTaskSeverity severity)
		{
			switch (severity) {
			case QuickTaskSeverity.Error:
				return Gtk.Stock.DialogError;
			case QuickTaskSeverity.Warning:
				return Gtk.Stock.DialogWarning;
			case QuickTaskSeverity.Hint:
				return Gtk.Stock.Info;
			default:
				return null;
			}
		}
Example #21
0
 public FixableResult(DomRegion region, string message, QuickTaskSeverity level,
                      ResultCertainty certainty, ResultImportance importance, params IAnalysisFix[] fixes)
     : base(region, message, level, certainty, importance)
 {
     this.Fixes = fixes;
 }