more panner tweaking
git-svn-id: svn://localhost/ardour2/trunk@1239 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4d6bfa3d47
commit
02f714b8c9
|
@ -971,11 +971,11 @@ style "pan_slider"
|
||||||
|
|
||||||
# used to draw the triangular indicators
|
# used to draw the triangular indicators
|
||||||
|
|
||||||
base[NORMAL] = { 0.93, 0.94, 0.71 }
|
base[NORMAL] = { 0.803, 0.792, 0.619 }
|
||||||
base[ACTIVE] = {0.93, 0.94, 0.71 }
|
base[ACTIVE] = { 0.803, 0.792, 0.619 }
|
||||||
base[INSENSITIVE] = {0.32, 0.39, 0.45 } # matches default_base
|
base[INSENSITIVE] = {0.32, 0.39, 0.45 } # matches default_base
|
||||||
base[SELECTED] = { 0.93, 0.94, 0.71 }
|
base[SELECTED] = { 0.803, 0.792, 0.619 }
|
||||||
base[PRELIGHT] = { 0.93, 0.94, 0.71 }
|
base[PRELIGHT] = { 0.803, 0.792, 0.619 }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
static const int triangle_size = 9;
|
static const int triangle_size = 7;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
null_label_callback (char* buf, unsigned int bufsize)
|
null_label_callback (char* buf, unsigned int bufsize)
|
||||||
|
@ -37,8 +37,8 @@ PannerBar::expose (GdkEventExpose* ev)
|
||||||
|
|
||||||
GdkPoint points[3];
|
GdkPoint points[3];
|
||||||
|
|
||||||
|
// left
|
||||||
|
|
||||||
|
|
||||||
points[0].x = 0;
|
points[0].x = 0;
|
||||||
points[0].y = 0;
|
points[0].y = 0;
|
||||||
|
|
||||||
|
@ -50,16 +50,20 @@ PannerBar::expose (GdkEventExpose* ev)
|
||||||
|
|
||||||
gdk_draw_polygon (win->gobj(), gc->gobj(), true, points, 3);
|
gdk_draw_polygon (win->gobj(), gc->gobj(), true, points, 3);
|
||||||
|
|
||||||
|
// center
|
||||||
|
|
||||||
points[0].x = darea.get_width()/2 - (triangle_size - 2);
|
points[0].x = darea.get_width()/2 - (triangle_size - 2);
|
||||||
points[0].y = 0;
|
points[0].y = 0;
|
||||||
|
|
||||||
points[1].x = darea.get_width()/2 + (triangle_size - 2);
|
points[1].x = darea.get_width()/2 + (triangle_size - 2);
|
||||||
points[1].y = 0;
|
points[1].y = 0;
|
||||||
|
|
||||||
points[2].x = darea.get_width()/2;
|
points[2].x = darea.get_width()/2 - 1;
|
||||||
points[2].y = triangle_size - 2;
|
points[2].y = triangle_size - 3;
|
||||||
|
|
||||||
gdk_draw_polygon (win->gobj(), gc->gobj(), true, points, 3);
|
gdk_draw_polygon (win->gobj(), gc->gobj(), true, points, 3);
|
||||||
|
|
||||||
|
// right
|
||||||
|
|
||||||
points[0].x = darea.get_width() - triangle_size;
|
points[0].x = darea.get_width() - triangle_size;
|
||||||
points[0].y = 0;
|
points[0].y = 0;
|
||||||
|
@ -111,3 +115,10 @@ PannerBar::button_release (GdkEventButton* ev)
|
||||||
|
|
||||||
return BarController::button_release (ev);
|
return BarController::button_release (ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PannerBar::on_size_request (Gtk::Requisition* req)
|
||||||
|
{
|
||||||
|
req->width = -1;
|
||||||
|
req->height = 50;
|
||||||
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@ class PannerBar : public Gtkmm2ext::BarController
|
||||||
PannerBar (Gtk::Adjustment& adj, PBD::Controllable&);
|
PannerBar (Gtk::Adjustment& adj, PBD::Controllable&);
|
||||||
~PannerBar ();
|
~PannerBar ();
|
||||||
|
|
||||||
|
void on_size_request (Gtk::Requisition*);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool expose (GdkEventExpose*);
|
bool expose (GdkEventExpose*);
|
||||||
bool button_press (GdkEventButton*);
|
bool button_press (GdkEventButton*);
|
||||||
|
|
|
@ -45,6 +45,7 @@ using namespace Gtkmm2ext;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
using namespace sigc;
|
using namespace sigc;
|
||||||
|
|
||||||
|
const int PannerUI::pan_bar_height = 30;
|
||||||
|
|
||||||
PannerUI::PannerUI (boost::shared_ptr<IO> io, Session& s)
|
PannerUI::PannerUI (boost::shared_ptr<IO> io, Session& s)
|
||||||
: _io (io),
|
: _io (io),
|
||||||
|
@ -219,7 +220,7 @@ PannerUI::set_width (Width w)
|
||||||
panner->set_size_request (61, 61);
|
panner->set_size_request (61, 61);
|
||||||
}
|
}
|
||||||
for (vector<PannerBar*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
|
for (vector<PannerBar*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
|
||||||
(*i)->set_size_request (61, 15);
|
(*i)->set_size_request (61, pan_bar_height);
|
||||||
}
|
}
|
||||||
panning_link_button.set_label (_("link"));
|
panning_link_button.set_label (_("link"));
|
||||||
break;
|
break;
|
||||||
|
@ -229,7 +230,7 @@ PannerUI::set_width (Width w)
|
||||||
panner->set_size_request (31, 61);
|
panner->set_size_request (31, 61);
|
||||||
}
|
}
|
||||||
for (vector<PannerBar*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
|
for (vector<PannerBar*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
|
||||||
(*i)->set_size_request (31, 15);
|
(*i)->set_size_request (31, pan_bar_height);
|
||||||
}
|
}
|
||||||
panning_link_button.set_label (_("L"));
|
panning_link_button.set_label (_("L"));
|
||||||
break;
|
break;
|
||||||
|
@ -318,7 +319,6 @@ PannerUI::setup_pan ()
|
||||||
|
|
||||||
bc->set_name ("PanSlider");
|
bc->set_name ("PanSlider");
|
||||||
bc->set_shadow_type (Gtk::SHADOW_NONE);
|
bc->set_shadow_type (Gtk::SHADOW_NONE);
|
||||||
bc->set_style (BarController::Line);
|
|
||||||
|
|
||||||
bc->StartGesture.connect (bind (mem_fun (*_io, &IO::start_pan_touch), (uint32_t) asz));
|
bc->StartGesture.connect (bind (mem_fun (*_io, &IO::start_pan_touch), (uint32_t) asz));
|
||||||
bc->StopGesture.connect (bind (mem_fun (*_io, &IO::end_pan_touch), (uint32_t) asz));
|
bc->StopGesture.connect (bind (mem_fun (*_io, &IO::end_pan_touch), (uint32_t) asz));
|
||||||
|
@ -333,14 +333,14 @@ PannerUI::setup_pan ()
|
||||||
pan_bars.push_back (bc);
|
pan_bars.push_back (bc);
|
||||||
switch (_width) {
|
switch (_width) {
|
||||||
case Wide:
|
case Wide:
|
||||||
pan_bars.back()->set_size_request (61, 15);
|
bc->set_size_request (61, pan_bar_height);
|
||||||
break;
|
break;
|
||||||
case Narrow:
|
case Narrow:
|
||||||
pan_bars.back()->set_size_request (31, 15);
|
bc->set_size_request (31, pan_bar_height);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pan_bar_packer.pack_start (*pan_bars.back(), true, true);
|
pan_bar_packer.pack_start (*bc, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now that we actually have the pan bars,
|
/* now that we actually have the pan bars,
|
||||||
|
|
|
@ -78,6 +78,8 @@ class PannerUI : public Gtk::HBox
|
||||||
bool ignore_toggle;
|
bool ignore_toggle;
|
||||||
bool in_pan_update;
|
bool in_pan_update;
|
||||||
|
|
||||||
|
static const int pan_bar_height;
|
||||||
|
|
||||||
Panner2d* panner;
|
Panner2d* panner;
|
||||||
|
|
||||||
Gtk::VBox pan_bar_packer;
|
Gtk::VBox pan_bar_packer;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user