more changes flowing from a persistent MonitorSection object
[ardour.git] / gtk2_ardour / midi_scroomer.cc
index f3bafb75841c2f6750b4f41fe9efa655b043393b..6fad2cc1f1ce32aef2a14e6a359267ba335c7f33 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2008 Paul Davis 
+    Copyright (C) 2008 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "midi_scroomer.h"
-
+#include <iostream>
 #include <cairomm/context.h>
 
-#include <iostream>
+#include "midi_scroomer.h"
+#include "ui_config.h"
 
-using namespace Gtkmm2ext;
 using namespace Gtk;
 using namespace std;
 
 //std::map<int, Glib::RefPtr<Gdk::Pixmap> > MidiScroomer::piano_pixmaps;
 
 MidiScroomer::MidiScroomer(Adjustment& adj)
-       : Gtkmm2ext::Scroomer(adj)
+       : ArdourWidgets::Scroomer(adj)
 {
 
        adj.set_lower(0);
@@ -85,7 +84,7 @@ MidiScroomer::on_expose_event(GdkEventExpose* ev)
                        for (int note = lnote; note < hnote + 1; ++note) {
                                double y = height - note * note2y;
                                bool draw = false;
-                               
+
                                switch (note % 12) {
                                case 1:
                                case 6:
@@ -103,7 +102,7 @@ MidiScroomer::on_expose_event(GdkEventExpose* ev)
                                default:
                                        break;
                                }
-                               
+
                                if(draw) {
                                        cc->set_line_width(1.4 * note2y);
                                        cc->move_to(0, y);
@@ -164,15 +163,5 @@ MidiScroomer::get_colors(double color[], Component comp)
 void
 MidiScroomer::on_size_request(Gtk::Requisition* r)
 {
-       r->width = 12;
-       r->height = 100;
-       //r->width = 32;
-       //r->height = 512;
-}
-
-void
-MidiScroomer::on_size_allocate(Gtk::Allocation& a)
-{
-       Scroomer::on_size_allocate(a);
+       r->width = std::max (12.f, rintf (12.f * UIConfiguration::instance().get_ui_scale()));
 }
-