A possible method for correctly sizing the editor controls, and a couple buttons...
authorDoug McLain <doug@nostar.net>
Sat, 17 Dec 2005 13:39:27 +0000 (13:39 +0000)
committerDoug McLain <doug@nostar.net>
Sat, 17 Dec 2005 13:39:27 +0000 (13:39 +0000)
git-svn-id: svn://localhost/trunk/ardour2@195 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_time_axis.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_route_list.cc
gtk2_ardour/time_axis_view.cc
libs/gtkmm2ext/utils.cc

index 83fd5ee78f303fcc1a38b27532d6b5a83d39b0e0..c1ccc52fc9774df360f6372b297a0c45b8591678 100644 (file)
@@ -161,10 +161,10 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt
        mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press));
        mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release));
        rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
-       edit_group_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::edit_click));
+       edit_group_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::edit_click), false);
        playlist_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::playlist_click));
        automation_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::automation_click));
-       size_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::size_click));
+       size_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::size_click), false);
        visual_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::visual_click));
        hide_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::hide_click));
 
index c54dc888ae64413568a8dda9fca334f07df448d8..6b6e8b98bf30cd74f8779b7493efe40a3af1e856 100644 (file)
@@ -388,6 +388,7 @@ Editor::Editor (AudioEngine& eng)
        // edit_controls_hbox.pack_start (edit_controls_vbox, true, true);
        controls_layout.add (edit_controls_vbox);
        controls_layout.set_name ("EditControlsBase");
+       controls_layout.signal_size_request().connect (mem_fun(*this, &Editor::set_layout_width), false);
        
        controls_layout.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK);
        controls_layout.signal_button_release_event().connect (mem_fun(*this, &Editor::edit_controls_button_release));
@@ -476,12 +477,12 @@ Editor::Editor (AudioEngine& eng)
        edit_packer.set_homogeneous (false);
        edit_packer.set_name ("EditorWindow");
 
-       edit_packer.attach (edit_hscrollbar,         1, 2, 0, 1,    FILL|EXPAND,  FILL, 0, 0);
+       edit_packer.attach (edit_hscrollbar,         1, 2, 0, 1,    FILL|EXPAND,  FILL, 0, 0);
 
        edit_packer.attach (time_button_event_box,   0, 1, 1, 2,    FILL,        FILL, 0, 0);
        edit_packer.attach (time_canvas_event_box,   1, 2, 1, 2,    FILL|EXPAND, FILL, 0, 0);
 
-       edit_packer.attach (controls_layout,         0, 1, 2, 3,    FILL,        FILL, 0, 0);
+       edit_packer.attach (controls_layout,         0, 1, 2, 3,    FILL,        FILL|EXPAND, 0, 0);
        edit_packer.attach (track_canvas_event_box,  1, 2, 2, 3,    FILL|EXPAND, FILL|EXPAND, 0, 0);
        edit_packer.attach (edit_vscrollbar,         2, 3, 2, 3,    FILL,        FILL|EXPAND, 0, 0);
 
@@ -3923,3 +3924,12 @@ Editor::transport_punch_location()
                return 0;
        }
 }
+
+void
+Editor::set_layout_width(Gtk::Requisition *r)
+{
+       edit_controls_vbox.check_resize();
+       int w = edit_controls_vbox.get_width();
+       cerr << "set_layout_width() called w = " << w << endl;
+       controls_layout.set_size_request (w, -1);
+}
index f54ed007523f7e51457dc96467b976353401bbbf..a5f7a39b229939f15a34f8513a674bd5026b9ad5 100644 (file)
@@ -642,6 +642,7 @@ class Editor : public PublicEditor
        Gtk::Adjustment     horizontal_adjustment;
 
        Gtk::Layout         controls_layout;
+       void set_layout_width(Gtk::Requisition *);
 
        Gtk::HScrollbar     edit_hscrollbar;
        bool                edit_hscroll_dragging;
index b3da7e5bed816f9e2932ed1770fbf47db8182981..b7b36dfd3001babecfb16f809aaecc8bc5d5eb62 100644 (file)
@@ -227,8 +227,8 @@ Editor::route_list_reordered ()
        long order;
        int n;
        
-        for (n = 0, order = 0, i = rows.begin(); i != rows.end(); ++i, ++order) {
-               TimeAxisView *tv = (*i)[route_display_columns.tv];
+       for (n = 0, order = 0, i = rows.begin(); i != rows.end(); ++i, ++order) {
+               TimeAxisView *tv = (*i)[route_display_columns.tv];
                AudioTimeAxisView* at; 
                if (!ignore_route_list_reorder) {
                        
index b9ff987d531705f9d57f3969bcb4aab78bfe9733..8f9ba4c7f4151d36715f2627bc62bd80ca4cf235 100644 (file)
@@ -185,7 +185,7 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
 {
        gdouble ix1, ix2, iy1, iy2;
        effective_height = 0;
-
+       
        if (control_parent) {
                control_parent->reorder_child (controls_frame, nth);
        } else {
@@ -193,10 +193,9 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
                parent->pack_start (controls_frame, false, false);
                parent->reorder_child (controls_frame, nth);
        }
-
        controls_frame.show ();
        controls_ebox.show ();
-
+       
        /* the coordinates used here are in the system of the
           item's parent ...
        */
index 23b4c3b5d5432da56711d75a69a5300f6dc58da8..d52ab42ee7a3f03b0a234b9da7f28b930ce55689 100644 (file)
@@ -35,10 +35,10 @@ Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w, const gchar *
 
 {
        int height = 0;
-        int width = 0;
+       int width = 0;
 
        w.ensure_style ();
-        w.create_pango_layout(text)->get_pixel_size (width, height);
+       w.create_pango_layout(text)->get_pixel_size (width, height);
 
        height += vpadding;
        width += hpadding;