ArdourCanvas::ScrollGroup* hsg;
ArdourCanvas::ScrollGroup* hg;
- ArdourCanvas::ScrollGroup* vg;
+ ArdourCanvas::ScrollGroup* cg;
+
+ h_scroll_group = hg = new ArdourCanvas::ScrollGroup (_track_canvas->root(), ArdourCanvas::ScrollGroup::ScrollsHorizontally);
+ CANVAS_DEBUG_NAME (h_scroll_group, "canvas h scroll");
+ _track_canvas->add_scroller (*hg);
hv_scroll_group = hsg = new ArdourCanvas::ScrollGroup (_track_canvas->root(),
ArdourCanvas::ScrollGroup::ScrollSensitivity (ArdourCanvas::ScrollGroup::ScrollsVertically|
CANVAS_DEBUG_NAME (hv_scroll_group, "canvas hv scroll");
_track_canvas->add_scroller (*hsg);
- v_scroll_group = vg = new ArdourCanvas::ScrollGroup (_track_canvas->root(), ArdourCanvas::ScrollGroup::ScrollsVertically);
- CANVAS_DEBUG_NAME (v_scroll_group, "canvas v scroll");
- _track_canvas->add_scroller (*vg);
-
- h_scroll_group = hg = new ArdourCanvas::ScrollGroup (_track_canvas->root(), ArdourCanvas::ScrollGroup::ScrollsHorizontally);
- CANVAS_DEBUG_NAME (h_scroll_group, "canvas h scroll");
- _track_canvas->add_scroller (*hg);
+ cursor_scroll_group = cg = new ArdourCanvas::ScrollGroup (_track_canvas->root(), ArdourCanvas::ScrollGroup::ScrollsHorizontally);
+ CANVAS_DEBUG_NAME (cursor_scroll_group, "canvas cursor scroll");
+ _track_canvas->add_scroller (*cg);
_verbose_cursor = new VerboseCursor (this);
transport_punch_range_rect->hide();
/*a group to hold time (measure) lines */
- time_line_group = new ArdourCanvas::Container (hv_scroll_group);
+ time_line_group = new ArdourCanvas::Container (h_scroll_group);
CANVAS_DEBUG_NAME (time_line_group, "time line group");
_trackview_group = new ArdourCanvas::Container (hv_scroll_group);
logo_item->lower_to_bottom ();
}
-
_canvas_drop_zone = new ArdourCanvas::Rectangle (hv_scroll_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, 0.0));
/* this thing is transparent */
_canvas_drop_zone->set_fill (false);
playhead_cursor->set_color (ARDOUR_UI::config()->color ("play head"));
- meter_bar->set_fill_color (ARDOUR_UI::config()->color ("meter bar"));
+ meter_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("meter bar", "marker bar"));
meter_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
- tempo_bar->set_fill_color (ARDOUR_UI::config()->color ("tempo bar"));
+ tempo_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("tempo bar", "marker bar"));
tempo_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
- marker_bar->set_fill_color (ARDOUR_UI::config()->color ("marker bar"));
+ marker_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("marker bar", "marker bar"));
marker_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
- cd_marker_bar->set_fill_color (ARDOUR_UI::config()->color ("cd marker bar"));
+ cd_marker_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("cd marker bar", "marker bar"));
cd_marker_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
- range_marker_bar->set_fill_color (ARDOUR_UI::config()->color ("range marker bar"));
+ range_marker_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("range marker bar", "marker bar"));
range_marker_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
- transport_marker_bar->set_fill_color (ARDOUR_UI::config()->color ("transport marker bar"));
+ transport_marker_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("transport marker bar", "marker bar"));
transport_marker_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
cd_marker_bar_drag_rect->set_fill_color (ARDOUR_UI::config()->color ("range drag bar rect"));
{
Glib::RefPtr<Gdk::Window> win = _track_canvas->get_window();
- if (win && cursor) {
- win->set_cursor (*cursor);
+ if (win && !_cursors->is_invalid (cursor)) {
+ /* glibmm 2.4 doesn't allow null cursor pointer because it uses
+ a Gdk::Cursor& as the argument to Gdk::Window::set_cursor().
+ But a null pointer just means "use parent window cursor",
+ and so should be allowed. Gtkmm 3.x has fixed this API.
+
+ For now, drop down and use C API
+ */
+ gdk_window_set_cursor (win->gobj(), cursor ? cursor->gobj() : 0);
}
}
size_t
Editor::push_canvas_cursor (Gdk::Cursor* cursor)
{
- if (cursor) {
+ if (!_cursors->is_invalid (cursor)) {
_cursor_stack.push_back (cursor);
set_canvas_cursor (cursor);
}
Gdk::Cursor*
Editor::which_mode_cursor () const
{
- Gdk::Cursor* mode_cursor = 0;
+ Gdk::Cursor* mode_cursor = MouseCursors::invalid_cursor ();
switch (mouse_mode) {
case MouseRange:
Gdk::Cursor*
Editor::which_track_cursor () const
{
- Gdk::Cursor* cursor = 0;
+ Gdk::Cursor* cursor = MouseCursors::invalid_cursor();
switch (_join_object_range_state) {
case JOIN_OBJECT_RANGE_NONE:
{
Gdk::Cursor* cursor = which_mode_cursor ();
+ if (mouse_mode == MouseRange) {
+ switch (type) {
+ case StartSelectionTrimItem:
+ cursor = _cursors->left_side_trim;
+ break;
+ case EndSelectionTrimItem:
+ cursor = _cursors->right_side_trim;
+ break;
+ default:
+ break;
+ }
+ }
+
if ((mouse_mode == MouseObject || get_smart_mode ()) ||
mouse_mode == MouseContent) {
cursor = _cursors->fader;
break;
case GainLineItem:
- cursor = which_track_cursor ();
+ cursor = _cursors->cross_hair;
break;
case AutomationLineItem:
cursor = _cursors->cross_hair;
cursor = _cursors->cross_hair;
break;
case LeftFrameHandle:
- if ( effective_mouse_mode() == MouseObject ) // (smart mode): if the user is in the top half, override the trim cursor, since they are in the range zone
- cursor = which_trim_cursor (true); //alternatively, one could argue that we _should_ allow trims here, and disallow range selection
+ if ( effective_mouse_mode() == MouseObject ) // (smart mode): if the user is in the btm half, show the trim cursor
+ cursor = which_trim_cursor (true);
+ else
+ cursor = _cursors->selector; // (smart mode): in the top half, just show the selection (range) cursor
break;
case RightFrameHandle:
if ( effective_mouse_mode() == MouseObject ) //see above
cursor = which_trim_cursor (false);
+ else
+ cursor = _cursors->selector;
break;
case StartCrossFadeItem:
cursor = _cursors->fade_in;
Gdk::Cursor* cursor = which_canvas_cursor(type);
- if (cursor) {
+ if (!_cursors->is_invalid (cursor)) {
// Push a new enter context
const EnterContext ctx = { type, CursorContext::create(*this, cursor) };
_enter_stack.push_back(ctx);