mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
various tweaks to get 80% Of the way to proper use of TimeAxisView::name_label and TimeAxisView::name_entry. Not done yet, since the entry sometimes loses focus and cannot be hidden.
git-svn-id: svn://localhost/ardour2/branches/3.0@13836 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
e40a8b384b
commit
f269d7c56e
5 changed files with 59 additions and 41 deletions
|
|
@ -154,8 +154,9 @@ AutomationTimeAxisView::AutomationTimeAxisView (
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for automation tracks, the label does not swap with an entry box. remove all that stuff */
|
/* for automation tracks, the label does not swap with an entry box. remove all that stuff */
|
||||||
if ( name_label.get_parent() )
|
if (name_label.get_parent()) {
|
||||||
name_hbox.remove(name_label);
|
hide_name_label ();
|
||||||
|
}
|
||||||
|
|
||||||
name_label.set_text (_name);
|
name_label.set_text (_name);
|
||||||
name_label.set_alignment (Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
|
name_label.set_alignment (Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
|
||||||
|
|
@ -421,14 +422,15 @@ AutomationTimeAxisView::set_height (uint32_t h)
|
||||||
first_call_to_set_height = false;
|
first_call_to_set_height = false;
|
||||||
|
|
||||||
if (h >= preset_height (HeightNormal)) {
|
if (h >= preset_height (HeightNormal)) {
|
||||||
name_label.show();
|
show_name_label ();
|
||||||
|
hide_name_entry ();
|
||||||
auto_button.show();
|
auto_button.show();
|
||||||
hide_button.show_all();
|
hide_button.show_all();
|
||||||
|
|
||||||
} else if (h >= preset_height (HeightSmall)) {
|
} else if (h >= preset_height (HeightSmall)) {
|
||||||
controls_table.hide_all ();
|
controls_table.hide_all ();
|
||||||
hide_name_entry ();
|
hide_name_entry ();
|
||||||
name_label.hide();
|
hide_name_label ();
|
||||||
auto_button.hide();
|
auto_button.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1286,6 +1286,8 @@ RouteTimeAxisView::playlist () const
|
||||||
void
|
void
|
||||||
RouteTimeAxisView::name_entry_changed ()
|
RouteTimeAxisView::name_entry_changed ()
|
||||||
{
|
{
|
||||||
|
TimeAxisView::name_entry_changed ();
|
||||||
|
|
||||||
string x = name_entry.get_text ();
|
string x = name_entry.get_text ();
|
||||||
|
|
||||||
if (x == _route->name()) {
|
if (x == _route->name()) {
|
||||||
|
|
@ -2168,14 +2170,6 @@ void
|
||||||
RouteTimeAxisView::update_rec_display ()
|
RouteTimeAxisView::update_rec_display ()
|
||||||
{
|
{
|
||||||
RouteUI::update_rec_display ();
|
RouteUI::update_rec_display ();
|
||||||
|
|
||||||
if (_route->record_enabled()) {
|
|
||||||
hide_name_entry ();
|
|
||||||
show_name_label ();
|
|
||||||
} else {
|
|
||||||
hide_name_label ();
|
|
||||||
show_name_entry ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -70,10 +70,22 @@ PBD::Signal1<void,TimeAxisView*> TimeAxisView::CatchDeletion;
|
||||||
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
|
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
|
||||||
: AxisView (sess)
|
: AxisView (sess)
|
||||||
, controls_table (2, 8)
|
, controls_table (2, 8)
|
||||||
|
, height (0)
|
||||||
|
, last_name_entry_key_press_event (0)
|
||||||
|
, display_menu (0)
|
||||||
|
, parent (rent)
|
||||||
|
, selection_group (0)
|
||||||
|
, _hidden (false)
|
||||||
|
, in_destructor (false)
|
||||||
|
, name_packing (NamePackingBits (0))
|
||||||
, _size_menu (0)
|
, _size_menu (0)
|
||||||
|
, _canvas_display (0)
|
||||||
, _y_position (0)
|
, _y_position (0)
|
||||||
, _editor (ed)
|
, _editor (ed)
|
||||||
|
, control_parent (0)
|
||||||
, _order (0)
|
, _order (0)
|
||||||
|
, _effective_height (0)
|
||||||
|
, _resize_drag_start (-1)
|
||||||
, _preresize_cursor (0)
|
, _preresize_cursor (0)
|
||||||
, _have_preresize_cursor (false)
|
, _have_preresize_cursor (false)
|
||||||
, _ghost_group (0)
|
, _ghost_group (0)
|
||||||
|
|
@ -94,17 +106,6 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
|
||||||
_ghost_group->lower_to_bottom();
|
_ghost_group->lower_to_bottom();
|
||||||
_ghost_group->show();
|
_ghost_group->show();
|
||||||
|
|
||||||
control_parent = 0;
|
|
||||||
display_menu = 0;
|
|
||||||
_hidden = false;
|
|
||||||
in_destructor = false;
|
|
||||||
height = 0;
|
|
||||||
_effective_height = 0;
|
|
||||||
parent = rent;
|
|
||||||
last_name_entry_key_press_event = 0;
|
|
||||||
name_packing = NamePackingBits (0);
|
|
||||||
_resize_drag_start = -1;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Create the standard LHS Controls
|
Create the standard LHS Controls
|
||||||
We create the top-level container and name add the name label here,
|
We create the top-level container and name add the name label here,
|
||||||
|
|
@ -357,6 +358,28 @@ TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev)
|
||||||
bool
|
bool
|
||||||
TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
|
TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
|
||||||
{
|
{
|
||||||
|
if (event->button == 1) {
|
||||||
|
if (event->type == GDK_2BUTTON_PRESS) {
|
||||||
|
/* see if it is inside the name label */
|
||||||
|
if (name_label.is_ancestor (controls_ebox)) {
|
||||||
|
int nlx;
|
||||||
|
int nly;
|
||||||
|
controls_ebox.translate_coordinates (name_label, event->x, event->y, nlx, nly);
|
||||||
|
Gtk::Allocation a = name_label.get_allocation ();
|
||||||
|
if (nlx > 0 && nlx < a.get_width() &&
|
||||||
|
nly > 0 && nly < a.get_height()) {
|
||||||
|
hide_name_label ();
|
||||||
|
show_name_entry ();
|
||||||
|
if (can_edit_name()) {
|
||||||
|
name_entry.grab_focus ();
|
||||||
|
name_entry.start_editing ((GdkEvent*) event);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (maybe_set_cursor (event->y) > 0) {
|
if (maybe_set_cursor (event->y) > 0) {
|
||||||
_resize_drag_start = event->y_root;
|
_resize_drag_start = event->y_root;
|
||||||
}
|
}
|
||||||
|
|
@ -532,6 +555,8 @@ TimeAxisView::set_height (uint32_t h)
|
||||||
/* resize the selection rect */
|
/* resize the selection rect */
|
||||||
show_selection (_editor.get_selection().time);
|
show_selection (_editor.get_selection().time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show_name_label ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -650,6 +675,8 @@ TimeAxisView::name_entry_focus_in (GdkEventFocus*)
|
||||||
bool
|
bool
|
||||||
TimeAxisView::name_entry_focus_out (GdkEventFocus*)
|
TimeAxisView::name_entry_focus_out (GdkEventFocus*)
|
||||||
{
|
{
|
||||||
|
cerr << "NEFO\n";
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
|
|
||||||
last_name_entry_key_press_event = 0;
|
last_name_entry_key_press_event = 0;
|
||||||
|
|
@ -680,6 +707,9 @@ TimeAxisView::name_entry_activated ()
|
||||||
void
|
void
|
||||||
TimeAxisView::name_entry_changed ()
|
TimeAxisView::name_entry_changed ()
|
||||||
{
|
{
|
||||||
|
cerr << "swithcing back to name labnel\n";
|
||||||
|
hide_name_entry ();
|
||||||
|
show_name_label ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -696,12 +726,7 @@ TimeAxisView::name_entry_button_press (GdkEventButton *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->button == 1) {
|
if (ev->button == 1) {
|
||||||
if (ev->type == GDK_2BUTTON_PRESS) {
|
if (ev->type != GDK_2BUTTON_PRESS) {
|
||||||
if (can_edit_name()) {
|
|
||||||
name_entry.grab_focus ();
|
|
||||||
name_entry.start_editing ((GdkEvent*) ev);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
conditionally_add_to_selection ();
|
conditionally_add_to_selection ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1135,7 +1160,7 @@ TimeAxisView::compute_heights ()
|
||||||
void
|
void
|
||||||
TimeAxisView::show_name_label ()
|
TimeAxisView::show_name_label ()
|
||||||
{
|
{
|
||||||
if (!(name_packing & NameLabelPacked)) {
|
if (!(name_packing & NameLabelPacked) && name_label.get_parent() == 0) {
|
||||||
name_hbox.pack_start (name_label, true, true);
|
name_hbox.pack_start (name_label, true, true);
|
||||||
name_packing = NamePackingBits (name_packing | NameLabelPacked);
|
name_packing = NamePackingBits (name_packing | NameLabelPacked);
|
||||||
name_hbox.show ();
|
name_hbox.show ();
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,6 @@ class TimeAxisView : public virtual AxisView
|
||||||
virtual void selection_click (GdkEventButton*);
|
virtual void selection_click (GdkEventButton*);
|
||||||
|
|
||||||
bool _hidden;
|
bool _hidden;
|
||||||
bool _has_state;
|
|
||||||
bool in_destructor;
|
bool in_destructor;
|
||||||
NamePackingBits name_packing;
|
NamePackingBits name_packing;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,17 +148,13 @@ VisualTimeAxis::set_height(uint32_t h)
|
||||||
{
|
{
|
||||||
TimeAxisView::set_height(h);
|
TimeAxisView::set_height(h);
|
||||||
|
|
||||||
|
show_name_label ();
|
||||||
|
|
||||||
if (h >= hNormal) {
|
if (h >= hNormal) {
|
||||||
hide_name_label ();
|
|
||||||
show_name_entry ();
|
|
||||||
other_button_hbox.show_all() ;
|
other_button_hbox.show_all() ;
|
||||||
} else if (h >= hSmaller) {
|
} else if (h >= hSmaller) {
|
||||||
hide_name_label ();
|
|
||||||
show_name_entry ();
|
|
||||||
other_button_hbox.hide_all() ;
|
other_button_hbox.hide_all() ;
|
||||||
} else if (h >= hSmall) {
|
} else if (h >= hSmall) {
|
||||||
hide_name_entry ();
|
|
||||||
show_name_label ();
|
|
||||||
other_button_hbox.hide_all() ;
|
other_button_hbox.hide_all() ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -341,7 +337,7 @@ VisualTimeAxis::label_view()
|
||||||
{
|
{
|
||||||
name_label.set_text (time_axis_name);
|
name_label.set_text (time_axis_name);
|
||||||
name_entry.set_text (time_axis_name);
|
name_entry.set_text (time_axis_name);
|
||||||
ARDOUR_UI::instance()->set_tip(name_entry, time_axis_name) ;
|
ARDOUR_UI::instance()->set_tip (name_entry, Glib::Markup::escape_text (time_axis_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -351,6 +347,8 @@ VisualTimeAxis::label_view()
|
||||||
void
|
void
|
||||||
VisualTimeAxis::name_entry_changed()
|
VisualTimeAxis::name_entry_changed()
|
||||||
{
|
{
|
||||||
|
TimeAxisView::name_entry_changed ();
|
||||||
|
|
||||||
string x = name_entry.get_text ();
|
string x = name_entry.get_text ();
|
||||||
|
|
||||||
if (x == time_axis_name) {
|
if (x == time_axis_name) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue