+ if (
+ _matrix->visible_columns() == 0 || _matrix->visible_rows() == 0 ||
+ _matrix->visible_columns()->bundles().empty() || _matrix->visible_rows()->bundles().empty()
+ ) {
+
+ /* nothing to connect */
+
+ cairo_t* cr = gdk_cairo_create (get_window()->gobj());
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_rectangle (cr, 0, 0, _alloc_width, _alloc_height);
+ cairo_fill (cr);
+
+ string t;
+ if (_matrix->type() == ARDOUR::DataType::NIL) {
+ t = _("There are no ports to connect.");
+ } else {
+ t = string_compose (_("There are no %1 ports to connect."), _matrix->type().to_i18n_string());
+ }
+
+ cairo_text_extents_t ext;
+ cairo_text_extents (cr, t.c_str(), &ext);
+
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_move_to (cr, (_alloc_width - ext.width) / 2, (_alloc_height + ext.height) / 2);
+ cairo_show_text (cr, t.c_str ());
+
+ cairo_destroy (cr);
+
+ return true;
+ }
+