_cursors = new MouseCursors;
_cursors->set_cursor_set (ARDOUR_UI::config()->get_icon_set());
+ cerr << "Set cursor set to " << ARDOUR_UI::config()->get_icon_set() << endl;
ArdourCanvas::GtkCanvas* time_pad = manage (new ArdourCanvas::GtkCanvas ());
Editor::ui_parameter_changed (string parameter)
{
if (parameter == "icon-set") {
+ while (!_cursor_stack.empty()) {
+ _cursor_stack.pop();
+ }
_cursors->set_cursor_set (ARDOUR_UI::config()->get_icon_set());
}
}
#include <list>
#include <map>
#include <set>
+#include <stack>
#include <string>
#include <sys/time.h>
#include <cmath>
Gdk::Cursor* get_canvas_cursor () const { return current_canvas_cursor; }
void set_canvas_cursor (Gdk::Cursor*, bool save=false);
+
+ void push_canvas_cursor (Gdk::Cursor*);
+ void pop_canvas_cursor ();
+
void set_current_trimmable (boost::shared_ptr<ARDOUR::Trimmable>);
void set_current_movable (boost::shared_ptr<ARDOUR::Movable>);
Gtk::VBox global_vpacker;
Gtk::VBox vpacker;
+ std::stack<Gdk::Cursor*> _cursor_stack;
Gdk::Cursor* current_canvas_cursor;
Gdk::Cursor* which_grabber_cursor ();
void set_canvas_cursor ();
}
}
+void
+Editor::push_canvas_cursor (Gdk::Cursor* cursor)
+{
+ if (cursor) {
+ _cursor_stack.push (cursor);
+ set_canvas_cursor (cursor, false);
+ }
+}
+
+void
+Editor::pop_canvas_cursor ()
+{
+ if (!_cursor_stack.empty()) {
+ Gdk::Cursor* cursor = _cursor_stack.top ();
+ _cursor_stack.pop ();
+ set_canvas_cursor (cursor, false);
+ }
+}
+
bool
Editor::track_canvas_key_press (GdkEventKey*)
{
if (cursor == 0) {
_item->grab ();
-
} else {
/* CAIROCANVAS need a variant here that passes *cursor */
_item->grab ();
-
+ _editor->push_canvas_cursor (cursor);
}
if (_editor->session() && _editor->session()->transport_rolling()) {
finished (event, _move_threshold_passed);
_editor->verbose_cursor()->hide ();
+ _editor->pop_canvas_cursor ();
return _move_threshold_passed;
}
framepos_t const pf = adjusted_current_frame (event);
+ cerr << "Button state = " << hex << event->button.state << dec << endl;
+
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
/* Move the contents of the region around without changing the region bounds */
_operation = ContentsTrim;
if (pf < (region_start + region_length/2)) {
/* closer to front */
_operation = StartTrim;
- Drag::start_grab (event, _editor->cursors()->left_side_trim);
+
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier)) {
+ cerr << "start anchored leftdrag\n";
+ Drag::start_grab (event, _editor->cursors()->anchored_left_side_trim);
+ } else {
+ Drag::start_grab (event, _editor->cursors()->left_side_trim);
+ }
} else {
/* closer to end */
_operation = EndTrim;
- Drag::start_grab (event, _editor->cursors()->right_side_trim);
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier)) {
+ Drag::start_grab (event, _editor->cursors()->anchored_right_side_trim);
+ cerr << "start anchored right drag\n";
+ } else {
+ Drag::start_grab (event, _editor->cursors()->right_side_trim);
+ }
}
}
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
frameoffset_t frame_delta = 0;
+ cerr << "trim drag @ " << this << " motion\n";
+
if (tv && tv->is_track()) {
speed = tv->track()->speed();
}
: cross_hair (0)
, trimmer (0)
, right_side_trim (0)
+ , anchored_right_side_trim (0)
, left_side_trim (0)
+ , anchored_left_side_trim (0)
, right_side_trim_left_only (0)
, left_side_trim_right_only (0)
, fade_in (0)
delete cross_hair; cross_hair = 0;
delete trimmer; trimmer = 0;
delete right_side_trim; right_side_trim = 0;
+ delete anchored_right_side_trim; anchored_right_side_trim = 0;
delete left_side_trim; left_side_trim = 0;
+ delete anchored_left_side_trim; anchored_left_side_trim = 0;
delete right_side_trim_left_only; right_side_trim_left_only = 0;
delete left_side_trim_right_only; left_side_trim_right_only = 0;
delete fade_in; fade_in = 0;
left_side_trim = new Cursor (Display::get_default(), p, 5, 11);
}
+ {
+ RefPtr<Pixbuf> p (::get_icon ("anchored_trim_left_cursor", _cursor_set));
+ anchored_left_side_trim = new Cursor (Display::get_default(), p, 5, 11);
+ }
+
{
RefPtr<Pixbuf> p (::get_icon ("trim_right_cursor", _cursor_set));
right_side_trim = new Cursor (Display::get_default(), p, 23, 11);
}
+ {
+ RefPtr<Pixbuf> p (::get_icon ("anchored_trim_right_cursor", _cursor_set));
+ anchored_right_side_trim = new Cursor (Display::get_default(), p, 23, 11);
+ }
+
{
RefPtr<Pixbuf> p (::get_icon ("trim_left_cursor_right_only", _cursor_set));
left_side_trim_right_only = new Cursor (Display::get_default(), p, 5, 11);
Gdk::Cursor* cross_hair;
Gdk::Cursor* trimmer;
Gdk::Cursor* right_side_trim;
+ Gdk::Cursor* anchored_right_side_trim;
Gdk::Cursor* left_side_trim;
+ Gdk::Cursor* anchored_left_side_trim;
Gdk::Cursor* right_side_trim_left_only;
Gdk::Cursor* left_side_trim_right_only;
Gdk::Cursor* fade_in;
name += X_(".png");
Searchpath spath(ARDOUR::ardour_data_search_path());
-
+
if (!icon_set.empty() && icon_set != _("default")) {
- string subdir = Glib::build_filename ("icons", icon_set);
- spath.add_subdirectory_to_paths (subdir);
+
+ /* add "icons/icon_set" but .. not allowed to add both of these at once */
+ spath.add_subdirectory_to_paths ("icons");
+ spath.add_subdirectory_to_paths (icon_set);
find_file_in_search_path (spath, name, data_file_path);
}