pianoroll header: parametize kbd width and use when rendering
This commit is contained in:
@@ -98,10 +98,10 @@ PianoRollHeader::size_request (double& w, double& h) const
|
||||
if (show_scroomer()) {
|
||||
_scroomer_size = 60.f * UIConfiguration::instance().get_ui_scale();
|
||||
} else {
|
||||
_scroomer_size = 20.f * UIConfiguration::instance().get_ui_scale();
|
||||
_scroomer_size = kbd_width * UIConfiguration::instance().get_ui_scale();
|
||||
}
|
||||
|
||||
w = _scroomer_size + 20.;
|
||||
w = _scroomer_size + (kbd_width * UIConfiguration::instance().get_ui_scale());
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -241,7 +241,6 @@ PianoRollHeaderBase::render (ArdourCanvas::Rect const & self, ArdourCanvas::Rect
|
||||
origin_y -= 1;
|
||||
}
|
||||
|
||||
|
||||
cr->translate (origin_x, origin_y);
|
||||
|
||||
// Render the MIDNAM text or its equivalent. First, set up a clip
|
||||
@@ -351,13 +350,14 @@ PianoRollHeaderBase::render (ArdourCanvas::Rect const & self, ArdourCanvas::Rect
|
||||
|
||||
}
|
||||
|
||||
|
||||
Gtkmm2ext::set_source_rgba (cr, bg);
|
||||
|
||||
double x = _scroomer_size;;
|
||||
assert (_scroomer_size = width() - kbd_width);
|
||||
|
||||
double x = _scroomer_size;
|
||||
double y = positions[n];
|
||||
|
||||
cr->rectangle (x, y, width() - 1., heights[n]);
|
||||
cr->rectangle (x, y, kbd_width, heights[n]);
|
||||
cr->fill ();
|
||||
|
||||
if ((oct_rel == 4 || oct_rel == 11) && y > 0) {
|
||||
@@ -369,7 +369,7 @@ PianoRollHeaderBase::render (ArdourCanvas::Rect const & self, ArdourCanvas::Rect
|
||||
which are rects
|
||||
*/
|
||||
cr->move_to (x, y + 0.5);
|
||||
cr->line_to (x + width(), y + 0.5);
|
||||
cr->line_to (x + kbd_width, y + 0.5);
|
||||
cr->stroke ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ class PianoRollHeaderBase : virtual public sigc::trackable {
|
||||
double _saved_bottom_val;
|
||||
mutable bool _mini_map_display;
|
||||
bool entered;
|
||||
static const int kbd_width = 20;
|
||||
|
||||
// void on_size_request(Gtk::Requisition*);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user