diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-23 10:58:08 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-23 10:58:08 -0500 |
| commit | 17c1fd576057bdd2d6aea517d733fe8af6e6b2ba (patch) | |
| tree | 660f47e816a8599aabdb7ee47f3cde64c72c3f4d /MediaBrowser.UI.Controls/ExtendedButton.cs | |
| parent | 33ed929b526acbda696f00f5966917ebd6a9ded2 (diff) | |
moved ui to it's own repo
Diffstat (limited to 'MediaBrowser.UI.Controls/ExtendedButton.cs')
| -rw-r--r-- | MediaBrowser.UI.Controls/ExtendedButton.cs | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/MediaBrowser.UI.Controls/ExtendedButton.cs b/MediaBrowser.UI.Controls/ExtendedButton.cs deleted file mode 100644 index 1b8e9039d..000000000 --- a/MediaBrowser.UI.Controls/ExtendedButton.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace MediaBrowser.UI.Controls -{ - /// <summary> - /// This subclass simply autofocuses itself when the mouse moves over it - /// </summary> - public class ExtendedButton : Button - { - private Point? _lastMouseMovePoint; - - /// <summary> - /// Handles OnMouseMove to auto-select the item that's being moused over - /// </summary> - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - var window = this.GetWindow(); - - // If the cursor is currently hidden, don't bother reacting to it - if (Cursor == Cursors.None || window.Cursor == Cursors.None) - { - return; - } - - // Store the last position for comparison purposes - // Even if the mouse is not moving this event will fire as elements are showing and hiding - var pos = e.GetPosition(window); - - if (!_lastMouseMovePoint.HasValue) - { - _lastMouseMovePoint = pos; - return; - } - - if (pos == _lastMouseMovePoint) - { - return; - } - - _lastMouseMovePoint = pos; - - Focus(); - } - } -} |
