First appearance of MIDI edit tool bar. Toggles when delete held, but otherwise...
[ardour.git] / gtk2_ardour / time_axis_view_item.cc
index 289686c7ce9e09987d38164ee6764fc4fafd07a9..f4316efd879ec785692a84661a3bf6f18f9635d3 100644 (file)
@@ -45,7 +45,7 @@ using namespace ARDOUR;
 //------------------------------------------------------------------------------
 /** Initialize const static memeber data */
 
-Pango::FontDescription TimeAxisViewItem::NAME_FONT;
+Pango::FontDescription* TimeAxisViewItem::NAME_FONT = 0;
 bool TimeAxisViewItem::have_name_font = false;
 const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
 const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6 ;
@@ -88,10 +88,10 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
                int width;
                int height;
 
-               layout->set_font_description (NAME_FONT);
+               layout->set_font_description (*NAME_FONT);
                Gtkmm2ext::get_ink_pixel_size (layout, width, height);
 
-               NAME_Y_OFFSET = height + 6;
+               NAME_Y_OFFSET = height + 5;
                NAME_HIGHLIGHT_SIZE = height + 6;
                NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 2;
 
@@ -128,7 +128,7 @@ void
 TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_color, nframes_t start, nframes_t duration, Visibility vis)
 {
        item_name = it_name ;
-       name_text_width = ::pixel_width (it_name, NAME_FONT);
+       name_text_width = ::pixel_width (it_name, *NAME_FONT);
        last_name_text_width = 0;
        samples_per_unit = spu ;
        should_show_selection = true;
@@ -152,6 +152,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
        vestigial_frame->property_y1() = (double) 1.0;
        vestigial_frame->property_x2() = 2.0;
        vestigial_frame->property_y2() = (double) trackview.height;
+       vestigial_frame->property_outline_what() = 0xF;
        vestigial_frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_VestigialFrame.get();
        vestigial_frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_VestigialFrame.get();
        vestigial_frame->hide ();
@@ -162,6 +163,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
                frame->property_y1() = (double) 1.0;
                frame->property_x2() = (double) trackview.editor.frame_to_pixel(duration);
                frame->property_y2() = (double) trackview.height;
+               frame->property_outline_what() = 0xF;
                frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
                frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
 
@@ -214,7 +216,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
                   then NAME_Y_OFFSET to position the text in the vertical center of the highlight
                */
                name_text->property_y() = (double) trackview.height - 1.0 - TimeAxisViewItem::NAME_Y_OFFSET;
-               name_text->property_font_desc() = NAME_FONT;
+               name_text->property_font_desc() = *NAME_FONT;
                name_text->property_anchor() = Gtk::ANCHOR_NW;
 
                name_text->set_data ("timeaxisviewitem", this);
@@ -493,7 +495,7 @@ TimeAxisViewItem::set_item_name(std::string new_name, void* src)
        if (new_name != item_name) {
                std::string temp_name = item_name ;
                item_name = new_name ;
-               name_text_width = ::pixel_width (new_name, NAME_FONT);
+               name_text_width = ::pixel_width (new_name, *NAME_FONT);
                NameChanged (item_name, temp_name, src) ; /* EMIT_SIGNAL */
        }
 }
@@ -563,7 +565,7 @@ TimeAxisViewItem::set_name_text(const ustring& new_name)
 {
        if (name_text) {
                name_text->property_text() = new_name;
-               name_text_width = pixel_width (new_name, NAME_FONT);
+               name_text_width = pixel_width (new_name, *NAME_FONT);
                name_text_size_cache.clear ();
        }
 }
@@ -683,7 +685,7 @@ TimeAxisViewItem::compute_colors(Gdk::Color& base_color)
        r = base_color.get_red()/256 ;
        g = base_color.get_green()/256 ;
        b = base_color.get_blue()/256 ;
-       fill_color = RGBA_TO_UINT(r,g,b,255) ;
+       fill_color = RGBA_TO_UINT(r,g,b,160) ;
 
        /*  for minor colors:
                if the overall saturation is strong, make the minor colors light.