From 791587fe9408856a658e5780f0dc5b9231f6c021 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 28 Mar 2012 04:26:07 +0000 Subject: Fix control rect colour and label stacking. git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4124 a436a847-0d15-0410-975c-d299462d15a1 --- src/port.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/port.c') diff --git a/src/port.c b/src/port.c index 58e7629..45376e2 100644 --- a/src/port.c +++ b/src/port.c @@ -21,6 +21,7 @@ #include "ganv/module.h" #include "./boilerplate.h" +#include "./color.h" #include "./ganv-private.h" #include "./gettext.h" @@ -132,6 +133,12 @@ ganv_port_draw(GanvItem* item, GanvItem* const rect = GANV_ITEM(port->impl->control->rect); GANV_ITEM_GET_CLASS(rect)->draw(rect, cr, cx, cy, width, height); } + + GanvNode* node = GANV_NODE(item); + if (node->impl->label) { + GanvItem* label_item = GANV_ITEM(node->impl->label); + GANV_ITEM_GET_CLASS(label_item)->draw(label_item, cr, cx, cy, width, height); + } } static void @@ -334,6 +341,8 @@ ganv_port_show_control(GanvPort* port) GanvPortControl* control = (GanvPortControl*)malloc(sizeof(GanvPortControl)); port->impl->control = control; + guint control_col = highlight_color(GANV_NODE(port)->impl->fill_color, 0x40); + control->value = 0.0f; control->min = 0.0f; control->max = 0.0f; @@ -345,7 +354,8 @@ ganv_port_show_control(GanvPort* port) "y1", 0.0, "x2", 0.0, "y2", ganv_box_get_height(&port->box), - "fill-color", 0xFFFFFF80, + "fill-color", control_col, + "border-color", control_col, "border-width", 0.0, NULL)); ganv_item_show(GANV_ITEM(control->rect)); -- cgit v1.2.1