summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/graph/edge.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/src/gtkext/graph/edge.c b/src/gtkext/graph/edge.c
index 93f020b..b74c049 100644
--- a/src/gtkext/graph/edge.c
+++ b/src/gtkext/graph/edge.c
@@ -30,6 +30,9 @@
#include <string.h>
+#include "../../core/params.h"
+
+
/* Lien graphique entre deux noeuds graphiques (instance) */
struct _GGraphEdge
@@ -470,32 +473,62 @@ bool g_graph_edge_detect_at(const GGraphEdge *edge, gint x, gint y)
void g_graph_edge_draw(const GGraphEdge *edge, cairo_t *cairo, bool arrow, bool selected)
{
+ GGenConfig *config; /* Configuration globale */
+ GdkRGBA color; /* Couleur de lien définie */
+#ifndef NDEBUG
+ bool status; /* Validité d'une couleur */
+#endif
size_t i; /* Boucle de parcours */
if (selected)
cairo_set_source_rgb(cairo, 1.0, 1.0, 1.0);
else
+ {
+ config = get_main_configuration();
+
switch (edge->color)
{
default:
case EGC_DEFAULT:
- cairo_set_source_rgb(cairo, 0, 0, 0);
+#ifndef NDEBUG
+ status = g_generic_config_get_value(config, MPK_LINK_DEFAULT, &color);
+#else
+ g_generic_config_get_value(config, MPK_LINK_DEFAULT, &color);
+#endif
break;
case EGC_GREEN:
- cairo_set_source_rgb(cairo, 0, 0.6, 0);
+#ifndef NDEBUG
+ status = g_generic_config_get_value(config, MPK_LINK_BRANCH_TRUE, &color);
+#else
+ g_generic_config_get_value(config, MPK_LINK_BRANCH_TRUE, &color);
+#endif
break;
case EGC_RED:
- cairo_set_source_rgb(cairo, 0.8, 0, 0);
+#ifndef NDEBUG
+ status = g_generic_config_get_value(config, MPK_LINK_BRANCH_FALSE, &color);
+#else
+ g_generic_config_get_value(config, MPK_LINK_BRANCH_FALSE, &color);
+#endif
break;
case EGC_BLUE:
- cairo_set_source_rgb(cairo, 0, 0, 0.8);
+#ifndef NDEBUG
+ status = g_generic_config_get_value(config, MPK_LINK_LOOP, &color);
+#else
+ g_generic_config_get_value(config, MPK_LINK_LOOP, &color);
+#endif
break;
case EGC_DASHED_GRAY:
cairo_set_source_rgb(cairo, 0.4, 0.4, 0.4);
break;
}
+ assert(status);
+
+ cairo_set_source_rgba(cairo, color.red, color.green, color.blue, color.alpha);
+
+ }
+
switch (edge->color)
{
default: