diff options
author | David Robillard <d@drobilla.net> | 2012-05-12 04:27:08 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-05-12 04:27:08 +0000 |
commit | 80ef97d123f9d5fa086844398f55c97d5613b8a3 (patch) | |
tree | f819dd3cd9c7676204090b75d29fb85d9a0688c6 /src/node.c | |
parent | d243e2421573bb537944c58c4baad388930e2888 (diff) | |
download | ganv-80ef97d123f9d5fa086844398f55c97d5613b8a3.tar.gz ganv-80ef97d123f9d5fa086844398f55c97d5613b8a3.tar.bz2 ganv-80ef97d123f9d5fa086844398f55c97d5613b8a3.zip |
Fix node selection so setting "selected" property does the right thing.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4369 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/node.c')
-rw-r--r-- | src/node.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -139,9 +139,21 @@ ganv_node_set_property(GObject* object, SET_CASE(BORDER_COLOR, uint, impl->border_color); SET_CASE(CAN_TAIL, boolean, impl->can_tail); SET_CASE(CAN_HEAD, boolean, impl->can_head); - SET_CASE(SELECTED, boolean, impl->selected); SET_CASE(HIGHLIGHTED, boolean, impl->highlighted); SET_CASE(DRAGGABLE, boolean, impl->draggable); + case PROP_SELECTED: + if (impl->selected != g_value_get_boolean(value)) { + impl->selected = g_value_get_boolean(value); + if (item->canvas) { + if (impl->selected) { + ganv_canvas_select_node(GANV_CANVAS(item->canvas), node); + } else { + ganv_canvas_unselect_node(GANV_CANVAS(item->canvas), node); + } + ganv_item_request_update(item); + } + } + break; case PROP_CANVAS: if (!item->parent) { GanvCanvasBase* canvas = GANV_CANVAS_BASE(g_value_get_object(value)); |