[gnome-builder] code-assist: handle info, fatal, and deprecation severities.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] code-assist: handle info, fatal, and deprecation severities.
- Date: Wed, 22 Oct 2014 21:24:53 +0000 (UTC)
commit f5cd315076038a174cc1e30f5400ae94251954b1
Author: Christian Hergert <christian hergert me>
Date: Wed Oct 22 14:24:47 2014 -0700
code-assist: handle info, fatal, and deprecation severities.
src/editor/gb-editor-code-assistant.c | 33 ++++++++++++++++++++++++++++-----
1 files changed, 28 insertions(+), 5 deletions(-)
---
diff --git a/src/editor/gb-editor-code-assistant.c b/src/editor/gb-editor-code-assistant.c
index 2377a9b..aba907d 100644
--- a/src/editor/gb-editor-code-assistant.c
+++ b/src/editor/gb-editor-code-assistant.c
@@ -31,6 +31,7 @@
#define PARSE_TIMEOUT_MSEC 500
static GdkPixbuf *gErrorPixbuf;
+static GdkPixbuf *gInfoPixbuf;
static GdkPixbuf *gWarningPixbuf;
static GHashTable *gGcaServices;
@@ -410,15 +411,26 @@ highlight_line (GbSourceView *source_view,
GdkRGBA color;
GdkRGBA shaded;
- if (severity == GCA_SEVERITY_WARNING)
+ switch (severity)
{
+ case GCA_SEVERITY_DEPRECATED:
+ case GCA_SEVERITY_WARNING:
gdk_rgba_parse (&color, "#fce94f");
- color.alpha = 0.3;
- }
- else
- {
+ color.alpha = 0.125;
+ break;
+
+ case GCA_SEVERITY_FATAL:
+ case GCA_SEVERITY_ERROR:
gdk_rgba_parse (&color, "#cc0000");
color.alpha = 0.125;
+ break;
+
+ case GCA_SEVERITY_INFO:
+ case GCA_SEVERITY_NONE:
+ default:
+ gdk_rgba_parse (&color, "#ffffff");
+ color.alpha = 0.0;
+ break;
}
gb_rgba_shade (&color, &shaded, 0.8);
@@ -493,14 +505,21 @@ on_query_data (GtkSourceGutterRenderer *renderer,
switch (GPOINTER_TO_INT (v))
{
+ case GCA_SEVERITY_FATAL:
case GCA_SEVERITY_ERROR:
pixbuf = gErrorPixbuf;
break;
+ case GCA_SEVERITY_INFO:
+ pixbuf = gInfoPixbuf;
+ break;
+
+ case GCA_SEVERITY_DEPRECATED:
case GCA_SEVERITY_WARNING:
pixbuf = gWarningPixbuf;
break;
+ case GCA_SEVERITY_NONE:
default:
break;
}
@@ -657,6 +676,10 @@ gb_editor_code_assistant_init (GbEditorTab *tab)
gErrorPixbuf = get_pixbuf_sized_for (GTK_WIDGET (tab->priv->source_view),
"process-stop-symbolic");
+ if (!gInfoPixbuf)
+ gInfoPixbuf = get_pixbuf_sized_for (GTK_WIDGET (tab->priv->source_view),
+ "dialog-information-symbolic");
+
if (!gWarningPixbuf)
gWarningPixbuf = get_pixbuf_sized_for (GTK_WIDGET (tab->priv->source_view),
"dialog-warning-symbolic");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]