diff options
author | David Robillard <d@drobilla.net> | 2011-12-01 23:08:55 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-12-01 23:08:55 +0000 |
commit | 4a2ad4c2bd0d4e96a2844272681a5560733a91b6 (patch) | |
tree | 30c448f27e546a375e6c8eac80ce202e90405ec1 /src | |
parent | e83bd7f83d3eae19a8928bb9530fd678065ea1e9 (diff) | |
download | machina-4a2ad4c2bd0d4e96a2844272681a5560733a91b6.tar.gz machina-4a2ad4c2bd0d4e96a2844272681a5560733a91b6.tar.bz2 machina-4a2ad4c2bd0d4e96a2844272681a5560733a91b6.zip |
Move color stuff down to C level.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@3733 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/MachinaCanvas.cpp | 4 | ||||
-rw-r--r-- | src/gui/NodeView.cpp | 21 | ||||
-rw-r--r-- | src/gui/NodeView.hpp | 4 |
3 files changed, 18 insertions, 11 deletions
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index b0ea6b4..b961a0c 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -67,12 +67,12 @@ MachinaCanvas::node_clicked(WeakPtr<NodeView> item, GdkEventButton* event) action_connect(last, node); } - last->set_default_base_color(); + last->set_default_colors(); _last_clicked.reset(); } else { _last_clicked = node; - node->set_base_color(0xFF0000FF); + node->set_fill_color(0xFF0000FF); } return true; diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp index 4e27594..407961c 100644 --- a/src/gui/NodeView.cpp +++ b/src/gui/NodeView.cpp @@ -37,8 +37,8 @@ NodeView::NodeView(Gtk::Window* window, : FlowCanvas::Ellipse(canvas, "", x, y, 20, 20, false) , _window(window) , _node(node) - , _default_border_color(_border_color) - , _old_color(_color) + , _default_border_color(get_border_color()) + , _default_fill_color(get_fill_color()) { signal_click().connect( sigc::mem_fun(this, &NodeView::on_click)); @@ -133,14 +133,12 @@ NodeView::on_property(Machina::URIInt key, const Raul::Atom& value) set_border_width(value.get_bool() ? 4.0 : 1.0); } else if (key == URIs::instance().machina_active) { if (value.get_bool()) { - if (_color != active_color) { - _old_color = _color; - set_base_color(active_color); + if (get_fill_color() != active_color) { + set_fill_color(active_color); set_border_color(active_border_color); } - } else if (_color == active_color) { - set_base_color(_old_color); - set_border_color(_default_border_color); + } else if (get_fill_color() == active_color) { + set_default_colors(); } } else if (key == URIs::instance().machina_enter_action) { const uint64_t action_id = value.get_int32(); @@ -160,3 +158,10 @@ NodeView::on_action_property(Machina::URIInt key, const Raul::Atom& value) if (key == URIs::instance().machina_note_number) show_label(true); } + +void +NodeView::set_default_colors() +{ + set_fill_color(_default_fill_color); + set_border_color(_default_border_color); +} diff --git a/src/gui/NodeView.hpp b/src/gui/NodeView.hpp index 9b827c1..b37b73b 100644 --- a/src/gui/NodeView.hpp +++ b/src/gui/NodeView.hpp @@ -40,6 +40,8 @@ public: void update_state(bool show_labels); + void set_default_colors(); + private: bool on_click(GdkEventButton* ev); void on_double_click(GdkEventButton* ev); @@ -52,7 +54,7 @@ private: Gtk::Window* _window; SharedPtr<Machina::Client::ClientObject> _node; uint32_t _default_border_color; - uint32_t _old_color; + uint32_t _default_fill_color; SharedPtr<Machina::Client::ClientObject> _enter_action; sigc::connection _enter_action_connection; |