aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/MachinaCanvas.cpp34
-rw-r--r--src/gui/NodeView.cpp2
-rw-r--r--src/gui/machina.glade10
3 files changed, 22 insertions, 24 deletions
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index 10334d0..6fdbc86 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -89,27 +89,25 @@ MachinaCanvas::canvas_event(GdkEvent* event)
return false;
if (event->type == GDK_BUTTON_RELEASE
- && event->button.state & GDK_CONTROL_MASK) {
-
+ && event->button.button == 2) {
+
const double x = event->button.x;
const double y = event->button.y;
- if (event->button.button == 1) {
- string name = string("Note")+(char)(last++ +'0');
-
- SharedPtr<Machina::Node> node(new Machina::Node(1.0, false));
- //node->add_enter_action(SharedPtr<Machina::Action>(new Machina::PrintAction(name)));
- SharedPtr<NodeView> view(new NodeView(node, shared_from_this(),
- name, x, y));
-
- view->signal_clicked.connect(sigc::bind<0>(sigc::mem_fun(this,
- &MachinaCanvas::node_clicked), WeakPtr<NodeView>(view)));
- add_item(view);
- view->resize();
- view->raise_to_top();
-
- machine->add_node(node);
- }
+ string name = string("Note")+(char)(last++ +'0');
+
+ SharedPtr<Machina::Node> node(new Machina::Node(1.0, false));
+ //node->add_enter_action(SharedPtr<Machina::Action>(new Machina::PrintAction(name)));
+ SharedPtr<NodeView> view(new NodeView(node, shared_from_this(),
+ name, x, y));
+
+ view->signal_clicked.connect(sigc::bind<0>(sigc::mem_fun(this,
+ &MachinaCanvas::node_clicked), WeakPtr<NodeView>(view)));
+ add_item(view);
+ view->resize();
+ view->raise_to_top();
+
+ machine->add_node(node);
}
return FlowCanvas::canvas_event(event);
diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp
index f34c658..d675f1d 100644
--- a/src/gui/NodeView.cpp
+++ b/src/gui/NodeView.cpp
@@ -34,8 +34,8 @@ void
NodeView::on_double_click(GdkEventButton*)
{
bool is_initial = _node->is_initial();
- std::cerr << "Initial: " << is_initial << std::endl;
_node->set_initial( ! is_initial );
+ set_border_width(is_initial ? 1.0 : 2.0);
}
diff --git a/src/gui/machina.glade b/src/gui/machina.glade
index b53398b..8536e8f 100644
--- a/src/gui/machina.glade
+++ b/src/gui/machina.glade
@@ -85,7 +85,7 @@
<accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image16">
+ <widget class="GtkImage" id="image18">
<property name="visible">True</property>
<property name="stock">gtk-media-record</property>
<property name="icon_size">1</property>
@@ -107,7 +107,7 @@
<accelerator key="E" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image17">
+ <widget class="GtkImage" id="image19">
<property name="visible">True</property>
<property name="stock">gtk-convert</property>
<property name="icon_size">1</property>
@@ -135,7 +135,7 @@
<accelerator key="G" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image18">
+ <widget class="GtkImage" id="image20">
<property name="visible">True</property>
<property name="stock">gtk-convert</property>
<property name="icon_size">1</property>
@@ -640,9 +640,9 @@ along with Machina; if not, write to the Free Software Foundation, Inc.,
<child>
<widget class="GtkLabel" id="label5">
<property name="visible">True</property>
- <property name="label" translatable="yes">Interface is a bit sketchy still:
+ <property name="label" translatable="yes">Interface is still a bit arbitrary:
-- Ctrl+Left click the canvas to create a new node
+- Middle click canvas to create a new node
- Middle click nodes to learn a MIDI note for that node
- Right click two nodes in succession to connect nodes
- Double click a node to make it an initial node