start of Blob-style for bar controller and use in panner GUI
git-svn-id: svn://localhost/ardour2/branches/3.0@8133 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6b29e87fe4
commit
503d1b5306
@ -32,7 +32,7 @@ static const int triangle_size = 5;
|
||||
PannerBar::PannerBar (Adjustment& adj, boost::shared_ptr<PBD::Controllable> c)
|
||||
: BarController (adj, c)
|
||||
{
|
||||
set_style (BarController::Line);
|
||||
set_style (BarController::Blob);
|
||||
}
|
||||
|
||||
PannerBar::~PannerBar ()
|
||||
|
@ -492,7 +492,7 @@ PannerUI::setup_pan ()
|
||||
_position_fader = new BarController (_position_adjustment, _panner->direction_control());
|
||||
_position_fader->set_size_request (-1, pan_bar_height/2);
|
||||
_position_fader->set_name ("PanSlider");
|
||||
_position_fader->set_style (BarController::Line);
|
||||
_position_fader->set_style (BarController::Blob);
|
||||
ARDOUR_UI::instance()->set_tip (_position_fader, _("Pan Position"));
|
||||
_position_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &PannerUI::position_adjusted));
|
||||
_panner->direction_control()->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::show_position, this), gui_context());
|
||||
|
@ -247,6 +247,7 @@ BarController::mouse_control (double x, GdkWindow* window, double scaling)
|
||||
|
||||
switch (_style) {
|
||||
case Line:
|
||||
case Blob:
|
||||
case LeftToRight:
|
||||
case CenterOut:
|
||||
fract = scaling * (delta / (darea.get_width() - 2));
|
||||
@ -302,6 +303,31 @@ BarController::expose (GdkEventExpose* /*event*/)
|
||||
win->draw_line (get_style()->get_fg_gc (get_state()), x1, 0, x1, h);
|
||||
break;
|
||||
|
||||
case Blob:
|
||||
w = darea.get_width() - 1;
|
||||
h = darea.get_height();
|
||||
x1 = (gint) floor (w * fract);
|
||||
x2 = min (w-2,h-2);
|
||||
|
||||
if (use_parent) {
|
||||
parent = get_parent();
|
||||
|
||||
if (parent) {
|
||||
win->draw_rectangle (parent->get_style()->get_fg_gc (parent->get_state()),
|
||||
true,
|
||||
0, 0, darea.get_width(), darea.get_height());
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
win->draw_rectangle (get_style()->get_bg_gc (get_state()),
|
||||
true,
|
||||
0, 0, darea.get_width() - ((darea.get_width()+1) % 2), darea.get_height());
|
||||
}
|
||||
|
||||
win->draw_arc (get_style()->get_fg_gc (get_state()), true, x1, ((h-2)/2)-1, x2, x2, 0, 360 * 64);
|
||||
break;
|
||||
|
||||
case CenterOut:
|
||||
w = darea.get_width();
|
||||
h = darea.get_height()-2;
|
||||
|
@ -37,6 +37,7 @@ class BarController : public Gtk::Frame
|
||||
LeftToRight,
|
||||
RightToLeft,
|
||||
Line,
|
||||
Blob,
|
||||
CenterOut,
|
||||
|
||||
TopToBottom,
|
||||
|
Loading…
Reference in New Issue
Block a user