summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-11-19 02:36:30 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-11-19 02:36:30 +0000
commit82cd0093d6051545d9581d4b25a5c8779711e479 (patch)
treea7cad675f142916ab3169cca3e218be8f821d9fb /gtk2_ardour
parent05283a63398fd7a563480a76802e6b2c2ad2e404 (diff)
add a signal so that if the Big Clock is closed, the edit window can grab focus back (may not be correct - should really capture close/delete signal; tweak size of audio clocks so that there is less dead space at the RHS, helps scroll wheel events to always do something
git-svn-id: svn://localhost/ardour2/branches/3.0@10700 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.h1
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc9
-rw-r--r--gtk2_ardour/audio_clock.cc27
-rw-r--r--gtk2_ardour/audio_clock.h1
4 files changed, 28 insertions, 10 deletions
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 3eeab1c85f..acaf986839 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -355,6 +355,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void big_clock_realized ();
bool big_clock_resize_in_progress;
int big_clock_height;
+ void big_clock_catch_focus ();
void float_big_clock (Gtk::Window* parent);
bool main_window_state_event_handler (GdkEventWindowState*, bool window_was_editor);
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index 28e6e60fa7..6295400e32 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -631,6 +631,13 @@ ARDOUR_UI::use_menubar_as_top_menubar ()
}
void
+ARDOUR_UI::big_clock_catch_focus ()
+{
+ cerr << "catch BC focus\n";
+ PublicEditor::instance().reset_focus ();
+}
+
+void
ARDOUR_UI::setup_clock ()
{
ARDOUR_UI::Clock.connect (sigc::mem_fun (big_clock, &AudioClock::set));
@@ -647,6 +654,8 @@ ARDOUR_UI::setup_clock ()
big_clock_window->get()->signal_key_press_event().connect (sigc::bind (sigc::ptr_fun (relay_key_press), big_clock_window->get()), false);
big_clock_window->get()->signal_size_allocate().connect (sigc::mem_fun (*this, &ARDOUR_UI::big_clock_size_allocate));
+ big_clock->DropFocus.connect (sigc::mem_fun (*this, &ARDOUR_UI::big_clock_catch_focus));
+
manage_window (*big_clock_window->get());
}
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index 0158f00731..6e736d248e 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -341,7 +341,7 @@ AudioClock::on_size_request (Gtk::Requisition* req)
where we printf a fractional value (XXX or should)
*/
- tmp->set_text (" 88|88:88:88,888");
+ tmp->set_text (" 88888888888,|");
tmp->get_pixel_size (req->width, req->height);
@@ -487,13 +487,20 @@ AudioClock::end_edit (bool modify)
void
AudioClock::drop_focus ()
{
- /* move focus back to the default widget in the top level window */
-
Keyboard::magic_widget_drop_focus ();
- Widget* top = get_toplevel();
- if (top->is_toplevel ()) {
- Window* win = dynamic_cast<Window*> (top);
- win->grab_focus ();
+
+ DropFocus (); /* EMIT SIGNAL */
+
+ if (has_focus()) {
+
+ /* move focus back to the default widget in the top level window */
+
+ Widget* top = get_toplevel();
+
+ if (top->is_toplevel ()) {
+ Window* win = dynamic_cast<Window*> (top);
+ win->grab_focus ();
+ }
}
}
@@ -1209,7 +1216,7 @@ AudioClock::index_to_field (int index) const
return Timecode_Minutes;
} else if (index < 10) {
return Timecode_Seconds;
- } else if (index < 13) {
+ } else {
return Timecode_Frames;
}
break;
@@ -1218,7 +1225,7 @@ AudioClock::index_to_field (int index) const
return Bars;
} else if (index < 7) {
return Beats;
- } else if (index < 12) {
+ } else {
return Ticks;
}
break;
@@ -1229,7 +1236,7 @@ AudioClock::index_to_field (int index) const
return MS_Minutes;
} else if (index < 9) {
return MS_Seconds;
- } else if (index < 12) {
+ } else {
return MS_Milliseconds;
}
break;
diff --git a/gtk2_ardour/audio_clock.h b/gtk2_ardour/audio_clock.h
index f4681c279c..1acff95612 100644
--- a/gtk2_ardour/audio_clock.h
+++ b/gtk2_ardour/audio_clock.h
@@ -78,6 +78,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
sigc::signal<void> ValueChanged;
sigc::signal<void> mode_changed;
sigc::signal<void> ChangeAborted;
+ sigc::signal<void> DropFocus;
static sigc::signal<void> ModeChanged;
static std::vector<AudioClock*> clocks;