more panner tweaking
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 21 Dec 2006 02:52:27 +0000 (02:52 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 21 Dec 2006 02:52:27 +0000 (02:52 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1239 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour2_ui.rc
gtk2_ardour/panner.cc
gtk2_ardour/panner.h
gtk2_ardour/panner_ui.cc
gtk2_ardour/panner_ui.h

index c5da7dd2bc6878a76108fcd8d88fa4bd4abe8458..074e75c0bca88c74d5f725b64d1ba10f24a5e4d3 100644 (file)
@@ -971,11 +971,11 @@ style "pan_slider"
 
        # used to draw the triangular indicators 
 
-       base[NORMAL] = { 0.93, 0.94, 0.71 }
-       base[ACTIVE] =  {0.93, 0.94, 0.71 }
+       base[NORMAL] = { 0.803, 0.792, 0.619 }
+       base[ACTIVE] =  { 0.803, 0.792, 0.619 }
        base[INSENSITIVE] = {0.32, 0.39, 0.45 } # matches default_base
-       base[SELECTED] = { 0.93, 0.94, 0.71 }
-       base[PRELIGHT] = { 0.93, 0.94, 0.71 }
+       base[SELECTED] = { 0.803, 0.792, 0.619 }
+       base[PRELIGHT] = { 0.803, 0.792, 0.619 }
 
 }
 
index acf06c4b07f8d0de235f0bb858b51e58a799108d..49bdf778e43a2253f560aed7a490b6a4e5e76004 100644 (file)
@@ -4,7 +4,7 @@
 
 using namespace std;
 
-static const int triangle_size = 9;
+static const int triangle_size = 7;
 
 static void
 null_label_callback (char* buf, unsigned int bufsize)
@@ -37,8 +37,8 @@ PannerBar::expose (GdkEventExpose* ev)
 
        GdkPoint points[3];
 
+       // left
        
-
        points[0].x = 0;
        points[0].y = 0;
 
@@ -50,16 +50,20 @@ PannerBar::expose (GdkEventExpose* ev)
 
        gdk_draw_polygon (win->gobj(), gc->gobj(), true, points, 3);
 
+       // center
+
        points[0].x = darea.get_width()/2 - (triangle_size - 2);
        points[0].y = 0;
 
        points[1].x = darea.get_width()/2 + (triangle_size - 2);
        points[1].y = 0;
        
-       points[2].x = darea.get_width()/2;
-       points[2].y = triangle_size - 2;
+       points[2].x = darea.get_width()/2 - 1;
+       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].y = 0;
@@ -111,3 +115,10 @@ PannerBar::button_release (GdkEventButton* ev)
 
        return BarController::button_release (ev);
 }
+
+void
+PannerBar::on_size_request (Gtk::Requisition* req)
+{
+       req->width = -1;
+       req->height = 50;
+}
index d06a4c21e3e888eb12f1179d7fb58389944f9e8f..580d8e9c67bb53fc36a348e2bc54547db46da609 100644 (file)
@@ -9,6 +9,8 @@ class PannerBar : public Gtkmm2ext::BarController
        PannerBar (Gtk::Adjustment& adj, PBD::Controllable&);
        ~PannerBar ();
 
+       void on_size_request (Gtk::Requisition*);
+
   protected:
        bool expose (GdkEventExpose*);
        bool button_press (GdkEventButton*);
index b12013e9eec2f7905fcfd573c84afbc32b12811f..46d69b7a798ecbc4ecbdadefa5436d6ae53abd9e 100644 (file)
@@ -45,6 +45,7 @@ using namespace Gtkmm2ext;
 using namespace Gtk;
 using namespace sigc;
 
+const int PannerUI::pan_bar_height = 30;
 
 PannerUI::PannerUI (boost::shared_ptr<IO> io, Session& s)
        : _io (io),
@@ -219,7 +220,7 @@ PannerUI::set_width (Width w)
                        panner->set_size_request (61, 61);
                }
                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"));
                break;
@@ -229,7 +230,7 @@ PannerUI::set_width (Width w)
                        panner->set_size_request (31, 61);
                }
                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"));
                break;
@@ -318,7 +319,6 @@ PannerUI::setup_pan ()
                        
                        bc->set_name ("PanSlider");
                        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->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);
                        switch (_width) {
                        case Wide:
-                               pan_bars.back()->set_size_request (61, 15);
+                               bc->set_size_request (61, pan_bar_height);
                                break;
                        case Narrow:
-                               pan_bars.back()->set_size_request (31, 15);
+                               bc->set_size_request (31, pan_bar_height);
                                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,
index b4547a4a0e5fff764161ebfbd06d430bc871eb37..79a8085488da10231c0a0322073588ca4e3da1fa 100644 (file)
@@ -78,6 +78,8 @@ class PannerUI : public Gtk::HBox
        bool ignore_toggle;
        bool in_pan_update;
 
+       static const int pan_bar_height;
+
        Panner2d*   panner;
 
        Gtk::VBox           pan_bar_packer;