mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Add control-focus notifications from bindable GUI widgets.
This commit is contained in:
parent
c4fcb12d12
commit
98a1a96f32
8 changed files with 44 additions and 2 deletions
|
|
@ -1144,6 +1144,11 @@ ArdourButton::on_enter_notify_event (GdkEventCrossing* ev)
|
|||
CairoWidget::set_dirty ();
|
||||
}
|
||||
|
||||
boost::shared_ptr<PBD::Controllable> c (binding_proxy.get_controllable ());
|
||||
if (c) {
|
||||
PBD::Controllable::GUIFocusChanged (boost::weak_ptr<PBD::Controllable> (c));
|
||||
}
|
||||
|
||||
return CairoWidget::on_enter_notify_event (ev);
|
||||
}
|
||||
|
||||
|
|
@ -1156,6 +1161,10 @@ ArdourButton::on_leave_notify_event (GdkEventCrossing* ev)
|
|||
CairoWidget::set_dirty ();
|
||||
}
|
||||
|
||||
if (binding_proxy.get_controllable()) {
|
||||
PBD::Controllable::GUIFocusChanged (boost::weak_ptr<PBD::Controllable> ());
|
||||
}
|
||||
|
||||
return CairoWidget::on_leave_notify_event (ev);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -539,6 +539,11 @@ ArdourKnob::on_enter_notify_event (GdkEventCrossing* ev)
|
|||
|
||||
set_dirty ();
|
||||
|
||||
boost::shared_ptr<PBD::Controllable> c (binding_proxy.get_controllable ());
|
||||
if (c) {
|
||||
PBD::Controllable::GUIFocusChanged (boost::weak_ptr<PBD::Controllable> (c));
|
||||
}
|
||||
|
||||
return CairoWidget::on_enter_notify_event (ev);
|
||||
}
|
||||
|
||||
|
|
@ -549,6 +554,10 @@ ArdourKnob::on_leave_notify_event (GdkEventCrossing* ev)
|
|||
|
||||
set_dirty ();
|
||||
|
||||
if (binding_proxy.get_controllable()) {
|
||||
PBD::Controllable::GUIFocusChanged (boost::weak_ptr<PBD::Controllable> ());
|
||||
}
|
||||
|
||||
return CairoWidget::on_leave_notify_event (ev);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
#include <gtkmm/window.h>
|
||||
#include <pangomm/layout.h>
|
||||
|
||||
#include "pbd/controllable.h"
|
||||
#include "pbd/compose.h"
|
||||
|
||||
#include "gtkmm2ext/gui_thread.h"
|
||||
|
|
|
|||
|
|
@ -55,6 +55,11 @@ protected:
|
|||
bool on_scroll_event (GdkEventScroll*);
|
||||
bool on_key_press_event (GdkEventKey*);
|
||||
|
||||
boost::weak_ptr<PBD::Controllable> proxy_controllable () const
|
||||
{
|
||||
return boost::weak_ptr<PBD::Controllable> (position_binder.get_controllable());
|
||||
}
|
||||
|
||||
private:
|
||||
PannerEditor* editor ();
|
||||
boost::shared_ptr<ARDOUR::PannerShell> _panner_shell;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
#include <gtkmm.h>
|
||||
#include "gtkmm2ext/keyboard.h"
|
||||
#include "gtkmm2ext/persistent_tooltip.h"
|
||||
|
||||
#include "pbd/controllable.h"
|
||||
|
||||
#include "panner_interface.h"
|
||||
#include "panner_editor.h"
|
||||
|
||||
|
|
@ -56,6 +59,10 @@ PannerInterface::on_enter_notify_event (GdkEventCrossing *)
|
|||
{
|
||||
grab_focus ();
|
||||
Keyboard::magic_widget_grab_focus ();
|
||||
|
||||
if (!proxy_controllable ().expired ()) {
|
||||
PBD::Controllable::GUIFocusChanged (proxy_controllable ());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -63,6 +70,9 @@ bool
|
|||
PannerInterface::on_leave_notify_event (GdkEventCrossing *)
|
||||
{
|
||||
Keyboard::magic_widget_drop_focus ();
|
||||
if (!proxy_controllable ().expired ()) {
|
||||
PBD::Controllable::GUIFocusChanged (boost::weak_ptr<PBD::Controllable> ());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,13 @@
|
|||
#include <gtkmm/drawingarea.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include "gtkmm2ext/persistent_tooltip.h"
|
||||
|
||||
#include "pbd/destructible.h"
|
||||
|
||||
namespace PBD {
|
||||
class Controllable;
|
||||
}
|
||||
|
||||
namespace ARDOUR {
|
||||
class Panner;
|
||||
}
|
||||
|
|
@ -63,6 +68,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void set_tooltip () = 0;
|
||||
virtual boost::weak_ptr<PBD::Controllable> proxy_controllable () const = 0;
|
||||
|
||||
void value_change ();
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <gtkmm/window.h>
|
||||
#include <pangomm/layout.h>
|
||||
|
||||
#include "pbd/controllable.h"
|
||||
#include "pbd/compose.h"
|
||||
|
||||
#include "gtkmm2ext/gui_thread.h"
|
||||
|
|
|
|||
|
|
@ -58,6 +58,11 @@ protected:
|
|||
bool on_scroll_event (GdkEventScroll*);
|
||||
bool on_key_press_event (GdkEventKey*);
|
||||
|
||||
boost::weak_ptr<PBD::Controllable> proxy_controllable () const
|
||||
{
|
||||
return boost::weak_ptr<PBD::Controllable> (position_binder.get_controllable());
|
||||
}
|
||||
|
||||
private:
|
||||
PannerEditor* editor ();
|
||||
boost::shared_ptr<ARDOUR::PannerShell> _panner_shell;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue