Properly revert FormatSpec changes on "cancel"
[ardour.git] / gtk2_ardour / piano_roll_header.cc
index 8b2e49770db27346df015800eb1450f06032ad74..cdd956dddd70f8649709b209e7c61cd81c03a7ca 100644 (file)
@@ -27,6 +27,7 @@
 #include "midi_time_axis.h"
 #include "midi_streamview.h"
 #include "public_editor.h"
+#include "ui_config.h"
 
 using namespace std;
 using namespace Gtkmm2ext;
@@ -467,7 +468,7 @@ PianoRollHeader::on_motion_notify_event (GdkEventMotion* ev)
        if (_dragging) {
 
                if ( false /*editor().current_mouse_mode() == Editing::MouseRange*/ ) {   //ToDo:  fix this.  this mode is buggy, and of questionable utility anyway
-                       
+
                        /* select note range */
 
                        if (Keyboard::no_modifiers_active (ev->state)) {
@@ -480,9 +481,9 @@ PianoRollHeader::on_motion_notify_event (GdkEventMotion* ev)
                        if (_clicked_note != NO_MIDI_NOTE && _clicked_note != note) {
                                _active_notes[_clicked_note] = false;
                                send_note_off(_clicked_note);
-                               
+
                                _clicked_note = note;
-                               
+
                                if (!_active_notes[note]) {
                                        _active_notes[note] = true;
                                        send_note_on(note);
@@ -511,12 +512,12 @@ PianoRollHeader::on_button_press_event (GdkEventButton* ev)
        } else if (ev->button == 1 && note >= 0 && note < 128) {
                add_modal_grab();
                _dragging = true;
-               
+
                if (!_active_notes[note]) {
                        _active_notes[note] = true;
                        _clicked_note = note;
                        send_note_on(note);
-                       
+
                        invalidate_note_range(note, note);
                } else {
                        reset_clicked_note(note);
@@ -540,7 +541,7 @@ PianoRollHeader::on_button_release_event (GdkEventButton* ev)
                } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::RangeSelectModifier)) {
                        ExtendNoteSelection (note); // EMIT SIGNAL
                }
-               
+
        } else {
 
                if (_dragging) {
@@ -661,7 +662,7 @@ PianoRollHeader::invalidate_note_range(int lowest, int highest)
 void
 PianoRollHeader::on_size_request(Gtk::Requisition* r)
 {
-       r->width = 20;
+       r->width = std::max (20.f, rintf (20.f * UIConfiguration::instance().get_ui_scale()));
 }
 
 void