track-header fader tweaks:

* align height to button-height.
* align width to label text-entry
* increase min width
This commit is contained in:
Robin Gareus 2014-08-31 21:32:22 +02:00
parent 0b1ee476ed
commit 154621978a
4 changed files with 25 additions and 25 deletions

View File

@ -28,6 +28,7 @@
#include "ardour/automation_control.h"
#include "ardour/event_type_map.h"
#include "ardour/profile.h"
#include "ardour/route.h"
#include "ardour/session.h"
@ -170,18 +171,20 @@ AutomationTimeAxisView::AutomationTimeAxisView (
/* add the buttons */
controls_table.remove (name_hbox);
controls_table.attach (hide_button, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK);
controls_table.attach (name_label, 1, 3, 1, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 2, 0);
controls_table.attach (auto_button, 3, 4, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
controls_table.set_border_width (0);
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (hide_button, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
} else {
controls_table.attach (hide_button, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 1, 0);
}
controls_table.attach (name_label, 1, 2, 1, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 2, 0);
controls_table.attach (auto_button, 2, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
name_label.show ();
hide_button.show ();
if (_controller) {
_controller.get()->set_size_request(-1, 24);
/* add bar controller */
controls_table.attach (*_controller.get(), 1, 4, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (*_controller.get(), 1, 3, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0);
/* note that this handler connects *before* the default handler */
_controller->event_widget().signal_scroll_event().connect (mem_fun (*this, &AutomationTimeAxisView::controls_ebox_scroll), false);
}

View File

@ -105,7 +105,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCan
, playlist_action_menu (0)
, mode_menu (0)
, color_mode_menu (0)
, gm (sess, true, 75, 20)
, gm (sess, true, 75, 14)
, _ignore_set_layer_display (false)
{
number_label.set_name("route button");
@ -252,13 +252,13 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
if (ARDOUR::Profile->get_mixbus()) {
controls_button_size_group->add_widget(route_group_button);
controls_table.attach (route_group_button, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
controls_table.attach (gm.get_gain_slider(), 3, 5, 2, 4, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
controls_table.attach (route_group_button, 2, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
controls_table.attach (gm.get_gain_slider(), 3, 5, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0);
}
else if (!ARDOUR::Profile->get_trx()) {
controls_button_size_group->add_widget(route_group_button);
controls_table.attach (route_group_button, 4, 5, 3, 4, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
controls_table.attach (gm.get_gain_slider(), 0, 2, 2, 4, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
controls_table.attach (route_group_button, 4, 5, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
controls_table.attach (gm.get_gain_slider(), 0, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0);
}
ARDOUR_UI::instance()->set_tip(*solo_button,_("Solo"));
@ -275,21 +275,21 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
label_view ();
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (automation_button, 1, 2, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
controls_table.attach (automation_button, 1, 2, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
controls_button_size_group->add_widget(automation_button);
}
else if (!ARDOUR::Profile->get_trx()) {
controls_table.attach (automation_button, 3, 4, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
controls_table.attach (automation_button, 3, 4, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
controls_button_size_group->add_widget(automation_button);
}
if (is_track() && track()->mode() == ARDOUR::Normal) {
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (playlist_button, 0, 1, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
controls_table.attach (playlist_button, 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
controls_button_size_group->add_widget(playlist_button);
}
else if (!ARDOUR::Profile->get_trx()) {
controls_table.attach (playlist_button, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
controls_table.attach (playlist_button, 2, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
controls_button_size_group->add_widget(playlist_button);
}
}
@ -425,9 +425,9 @@ RouteTimeAxisView::update_track_number_visibility ()
}
if (show_label) {
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 1, 0);
} else {
controls_table.attach (number_label, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
controls_table.attach (number_label, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 1, 0);
}
const int tnw = std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_width_of_digit_0_to_9()
number_label.set_size_request(3 + tnw, -1);

View File

@ -75,7 +75,7 @@ Glib::RefPtr<Gtk::SizeGroup> TimeAxisView::controls_meters_size_group = SizeGrou
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
: AxisView (sess)
, controls_table (4, 4)
, controls_table (3, 3)
, controls_button_size_group (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_BOTH))
, _name_editing (false)
, height (0)
@ -131,11 +131,8 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
name_hbox.pack_end (name_label, true, true);
// set min. track-header width if fader is not visible
if (ARDOUR::Profile->get_mixbus() ) {
name_hbox.set_size_request(100, 0);
} else {
name_hbox.set_size_request(90, 0);
}
name_hbox.set_size_request(100, 0);
name_hbox.show ();
name_label.show ();
@ -1116,7 +1113,7 @@ TimeAxisView::compute_heights ()
{
// TODO this function should be re-evaluated when font-scaling changes (!)
Gtk::Window window (Gtk::WINDOW_TOPLEVEL);
Gtk::Table one_row_table (1, 8);
Gtk::Table one_row_table (1, 1);
ArdourButton* test_button = manage (new ArdourButton);
const int border_width = 2;
const int frame_height = 2;

View File

@ -57,7 +57,7 @@ BarController::BarController (Gtk::Adjustment& adj,
layout = darea.create_pango_layout("");
set (.5, .5, 1.0, 1.0);
set_border_width(2);
set_border_width(0);
initial_value = adjustment.get_value ();