only show scroomer note names in draw/internal edit modes (if at all)

This commit is contained in:
Paul Davis 2023-09-13 11:53:18 -06:00
parent 2fa6500ec5
commit 5644c8587e
5 changed files with 40 additions and 6 deletions

View File

@ -428,6 +428,11 @@ Editor::mouse_mode_toggled (MouseMode m)
update_all_enter_cursors ();
MouseModeChanged (); /* EMIT SIGNAL */
if ((was_internal && !internal_editing()) ||
(!was_internal && internal_editing())) {
queue_redisplay_track_views ();
}
}
bool

View File

@ -141,8 +141,15 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session* sess, ArdourCanva
_midnam_channel_selector.disable_scrolling();
UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &MidiTimeAxisView::parameter_changed));
_editor.MouseModeChanged.connect_same_thread (mouse_mode_connection, sigc::mem_fun (*this, &MidiTimeAxisView::mouse_mode_changed));
}
void
MidiTimeAxisView::mouse_mode_changed ()
{
_piano_roll_header->queue_resize ();
}
void
MidiTimeAxisView::parameter_changed (string const & param)

View File

@ -208,6 +208,8 @@ private:
void create_velocity_automation_child (Evoral::Parameter const &, bool show);
void update_patch_selector ();
void mouse_mode_changed ();
PBD::ScopedConnection mouse_mode_connection;
};
#endif /* __ardour_midi_time_axis_h__ */

View File

@ -291,9 +291,7 @@ PianoRollHeader::on_expose_event (GdkEventExpose* ev)
cr->rectangle (0,0,_scroomer_size, get_height () );
cr->clip();
Editing::NoteNameDisplay nnd = UIConfiguration::instance().get_note_name_display();
if ((nnd == Editing::Always) || ((nnd == Editing::WithMIDNAM) && have_note_names)) {
if (show_scroomer()) {
/* Draw the actual text */
@ -802,12 +800,33 @@ PianoRollHeader::invalidate_note_range (int lowest, int highest)
queue_draw ();
}
void
PianoRollHeader::on_size_request (Gtk::Requisition* r)
bool
PianoRollHeader::show_scroomer () const
{
Editing::NoteNameDisplay nnd = UIConfiguration::instance().get_note_name_display();
if ((nnd == Editing::Always) || ((nnd == Editing::WithMIDNAM) && have_note_names)) {
if (nnd == Editing::Never) {
return false;
}
switch (editor().current_mouse_mode()) {
case Editing::MouseDraw:
case Editing::MouseContent:
if (nnd == Editing::WithMIDNAM) {
return have_note_names;
} else {
return true;
}
default:
break;
}
return false;
}
void
PianoRollHeader::on_size_request (Gtk::Requisition* r)
{
if (show_scroomer()) {
_scroomer_size = 60.f;
} else {
_scroomer_size = 20.f;

View File

@ -144,6 +144,7 @@ private:
double _old_av_note_height;
PublicEditor& editor() const;
bool show_scroomer () const;
};
#endif /* __ardour_piano_roll_header_h__ */