summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-03-11 19:47:05 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-03-11 19:47:05 (GMT)
commit0a190905f31d7c395e1b26efe3abe443687429e5 (patch)
treeb359fe59b6cbfb2cf40181ec0f1fdb24f17b5682 /src/gtkext
parentd53249c8021270a4070181d032da33e129c36e9f (diff)
Defined new config parameters for the edge colors.
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: