#include <gtkmm/menu.h>
#include <gtkmm/menuitem.h>
+#include "context_menu_helper.h"
#include "time_axis_view.h"
#include "streamview.h"
#include "editor_summary.h"
_editor->selection->RegionsChanged.connect (sigc::mem_fun(*this, &EditorSummary::set_background_dirty));
}
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &EditorSummary::set_colors));
+
+ set_colors();
+
_leftmost = max_samplepos;
_rightmost = 0;
}
/* calculate x scale */
if (_end != _start) {
_x_scale = static_cast<double> (get_width()) / (_end - _start);
- } else {
+ } else {
_x_scale = 1;
}
/* Playhead */
cairo_set_line_width (cr, 1);
- /* XXX: colour should be set from configuration file */
- cairo_set_source_rgba (cr, 1, 0, 0, 1);
+
+ double r,g,b,a; Gtkmm2ext::color_to_rgba(_phead_color, r,g,b,a);
+ cairo_set_source_rgb (cr, r,g,b); // playhead color
const double ph= playhead_sample_to_position (_editor->playhead_cursor->current_sample());
cairo_move_to (cr, ph, 0);
}
+void
+EditorSummary::set_colors ()
+{
+ _phead_color = UIConfiguration::instance().color ("play head");
+}
+
+
+
/** Render a region for the summary.
* @param r Region view.
* @param cr Cairo context.
{
gint x, y;
GtkAccelKey set_playhead_accel;
+
+ /* XXXX this is really ugly and should be using our own action maps and bindings */
+
if (gtk_accel_map_lookup_entry ("<Actions>/Editor/set-playhead", &set_playhead_accel)) {
if (key->keyval == set_playhead_accel.accel_key && (int) key->state == set_playhead_accel.accel_mods) {
if (_session) {
{
GtkAccelKey set_playhead_accel;
+
+ /* XXXX this is really ugly and should be using our own action maps and bindings */
+
if (gtk_accel_map_lookup_entry ("<Actions>/Editor/set-playhead", &set_playhead_accel)) {
if (key->keyval == set_playhead_accel.accel_key && (int) key->state == set_playhead_accel.accel_mods) {
return true;
if (ev->button == 3) { // right-click: show the reset menu action
using namespace Gtk::Menu_Helpers;
- Gtk::Menu* m = manage (new Gtk::Menu);
+ Gtk::Menu* m = ARDOUR_UI_UTILS::shared_popup_menu ();
MenuList& items = m->items ();
items.push_back(MenuElem(_("Reset Summary to Extents"),
sigc::mem_fun(*this, &EditorSummary::reset_to_extents)));