use 2 tables for time info box to get correct vertical alignment (independent on left+right sides)
git-svn-id: svn://localhost/ardour2/branches/3.0@9695 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
3e79689c64
commit
966b62516f
@ -41,7 +41,8 @@ using std::min;
|
|||||||
using std::max;
|
using std::max;
|
||||||
|
|
||||||
TimeInfoBox::TimeInfoBox ()
|
TimeInfoBox::TimeInfoBox ()
|
||||||
: Table (4, 4)
|
: left (2, 4)
|
||||||
|
, right (2, 4)
|
||||||
, syncing_selection (false)
|
, syncing_selection (false)
|
||||||
, syncing_punch (false)
|
, syncing_punch (false)
|
||||||
, punch_in_button (_("In"))
|
, punch_in_button (_("In"))
|
||||||
@ -73,53 +74,63 @@ TimeInfoBox::TimeInfoBox ()
|
|||||||
punch_title.set_text (_("Punch"));
|
punch_title.set_text (_("Punch"));
|
||||||
|
|
||||||
set_homogeneous (false);
|
set_homogeneous (false);
|
||||||
set_spacings (0);
|
set_spacing (6);
|
||||||
set_border_width (2);
|
set_border_width (2);
|
||||||
set_col_spacings (2);
|
|
||||||
|
|
||||||
/* a bit more spacing between the two "sides" */
|
pack_start (left, true, true);
|
||||||
set_col_spacing (1, 10);
|
pack_start (right, true, true);
|
||||||
|
|
||||||
|
left.set_homogeneous (false);
|
||||||
|
left.set_spacings (0);
|
||||||
|
left.set_border_width (2);
|
||||||
|
left.set_col_spacings (2);
|
||||||
|
|
||||||
|
right.set_homogeneous (false);
|
||||||
|
right.set_spacings (0);
|
||||||
|
right.set_border_width (2);
|
||||||
|
right.set_col_spacings (2);
|
||||||
|
|
||||||
|
|
||||||
Gtk::Label* l;
|
Gtk::Label* l;
|
||||||
|
|
||||||
selection_title.set_name ("TimeInfoSelectionTitle");
|
selection_title.set_name ("TimeInfoSelectionTitle");
|
||||||
attach (selection_title, 0, 2, 0, 1);
|
left.attach (selection_title, 0, 2, 0, 1);
|
||||||
l = manage (new Label);
|
l = manage (new Label);
|
||||||
l->set_text (_("Start"));
|
l->set_text (_("Start"));
|
||||||
l->set_alignment (1.0, 0.5);
|
l->set_alignment (1.0, 0.5);
|
||||||
l->set_name (X_("TimeInfoSelectionLabel"));
|
l->set_name (X_("TimeInfoSelectionLabel"));
|
||||||
attach (*l, 0, 1, 1, 2, FILL);
|
left.attach (*l, 0, 1, 1, 2, FILL);
|
||||||
attach (*selection_start, 1, 2, 1, 2);
|
left.attach (*selection_start, 1, 2, 1, 2);
|
||||||
|
|
||||||
l = manage (new Label);
|
l = manage (new Label);
|
||||||
l->set_text (_("End"));
|
l->set_text (_("End"));
|
||||||
l->set_alignment (1.0, 0.5);
|
l->set_alignment (1.0, 0.5);
|
||||||
l->set_name (X_("TimeInfoSelectionLabel"));
|
l->set_name (X_("TimeInfoSelectionLabel"));
|
||||||
attach (*l, 0, 1, 2, 3, FILL);
|
left.attach (*l, 0, 1, 2, 3, FILL);
|
||||||
attach (*selection_end, 1, 2, 2, 3);
|
left.attach (*selection_end, 1, 2, 2, 3);
|
||||||
|
|
||||||
l = manage (new Label);
|
l = manage (new Label);
|
||||||
l->set_text (_("Length"));
|
l->set_text (_("Length"));
|
||||||
l->set_alignment (1.0, 0.5);
|
l->set_alignment (1.0, 0.5);
|
||||||
l->set_name (X_("TimeInfoSelectionLabel"));
|
l->set_name (X_("TimeInfoSelectionLabel"));
|
||||||
attach (*l, 0, 1, 3, 4, FILL);
|
left.attach (*l, 0, 1, 3, 4, FILL);
|
||||||
attach (*selection_length, 1, 2, 3, 4);
|
left.attach (*selection_length, 1, 2, 3, 4);
|
||||||
|
|
||||||
punch_title.set_name ("TimeInfoSelectionTitle");
|
punch_title.set_name ("TimeInfoSelectionTitle");
|
||||||
attach (punch_title, 2, 4, 0, 1);
|
right.attach (punch_title, 2, 4, 0, 1);
|
||||||
l = manage (new Label);
|
l = manage (new Label);
|
||||||
l->set_alignment (1.0, 0.5);
|
l->set_alignment (1.0, 0.5);
|
||||||
l->set_text (_("In"));
|
l->set_text (_("In"));
|
||||||
l->set_name (X_("TimeInfoPunchLabel"));
|
l->set_name (X_("TimeInfoPunchLabel"));
|
||||||
attach (*l, 2, 3, 1, 2, FILL);
|
right.attach (*l, 2, 3, 1, 2, FILL);
|
||||||
attach (*punch_start, 3, 4, 1, 2);
|
right.attach (*punch_start, 3, 4, 1, 2);
|
||||||
|
|
||||||
l = manage (new Label);
|
l = manage (new Label);
|
||||||
l->set_alignment (1.0, 0.5);
|
l->set_alignment (1.0, 0.5);
|
||||||
l->set_text (_("Out"));
|
l->set_text (_("Out"));
|
||||||
l->set_name (X_("TimeInfoPunchLabel"));
|
l->set_name (X_("TimeInfoPunchLabel"));
|
||||||
attach (*l, 2, 3, 2, 3, FILL);
|
right.attach (*l, 2, 3, 2, 3, FILL);
|
||||||
attach (*punch_end, 3, 4, 2, 3);
|
right.attach (*punch_end, 3, 4, 2, 3);
|
||||||
|
|
||||||
punch_in_button.set_name ("TimeInfoPunchButton");
|
punch_in_button.set_name ("TimeInfoPunchButton");
|
||||||
punch_out_button.set_name ("TimeInfoPunchButton");
|
punch_out_button.set_name ("TimeInfoPunchButton");
|
||||||
@ -135,7 +146,7 @@ TimeInfoBox::TimeInfoBox ()
|
|||||||
Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start"));
|
Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start"));
|
||||||
Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end"));
|
Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end"));
|
||||||
|
|
||||||
attach (punch_button_box, 2, 4, 3, 4, FILL, FILL);
|
right.attach (punch_button_box, 2, 4, 3, 4, FILL, FILL);
|
||||||
|
|
||||||
show_all ();
|
show_all ();
|
||||||
|
|
||||||
@ -370,7 +381,7 @@ TimeInfoBox::on_expose_event (GdkEventExpose* ev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Table::on_expose_event (ev);
|
HBox::on_expose_event (ev);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace ARDOUR {
|
|||||||
|
|
||||||
class AudioClock;
|
class AudioClock;
|
||||||
|
|
||||||
class TimeInfoBox : public Gtk::Table, public ARDOUR::SessionHandlePtr
|
class TimeInfoBox : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TimeInfoBox ();
|
TimeInfoBox ();
|
||||||
@ -48,6 +48,9 @@ class TimeInfoBox : public Gtk::Table, public ARDOUR::SessionHandlePtr
|
|||||||
bool on_expose_event (GdkEventExpose*);
|
bool on_expose_event (GdkEventExpose*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Gtk::Table left;
|
||||||
|
Gtk::Table right;
|
||||||
|
|
||||||
AudioClock* selection_start;
|
AudioClock* selection_start;
|
||||||
AudioClock* selection_end;
|
AudioClock* selection_end;
|
||||||
AudioClock* selection_length;
|
AudioClock* selection_length;
|
||||||
|
Loading…
Reference in New Issue
Block a user