From b2367fe2e6bded2c36d1b5e4f0dc595586b4bd08 Mon Sep 17 00:00:00 2001 From: Eduard Bopp Date: Thu, 5 Feb 2015 16:52:53 +0100 Subject: Rename enum variants of MouseButton With enums that are namespaced by default, it seems reasonable to be less redundant in the variant naming here. --- src/cocoa/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/cocoa') diff --git a/src/cocoa/mod.rs b/src/cocoa/mod.rs index 2ff4ff9..1086a1b 100644 --- a/src/cocoa/mod.rs +++ b/src/cocoa/mod.rs @@ -29,7 +29,7 @@ use std::ascii::AsciiExt; use events::Event::{MouseInput, MouseMoved, ReceivedCharacter, KeyboardInput, MouseWheel}; use events::ElementState::{Pressed, Released}; -use events::MouseButton::{LeftMouseButton, RightMouseButton}; +use events::MouseButton; use events; pub use self::monitor::{MonitorID, get_available_monitors, get_primary_monitor}; @@ -433,10 +433,10 @@ impl Window { } match msg_send()(event, selector("type")) { - NSLeftMouseDown => { events.push_back(MouseInput(Pressed, LeftMouseButton)); }, - NSLeftMouseUp => { events.push_back(MouseInput(Released, LeftMouseButton)); }, - NSRightMouseDown => { events.push_back(MouseInput(Pressed, RightMouseButton)); }, - NSRightMouseUp => { events.push_back(MouseInput(Released, RightMouseButton)); }, + NSLeftMouseDown => { events.push_back(MouseInput(Pressed, MouseButton::Left)); }, + NSLeftMouseUp => { events.push_back(MouseInput(Released, MouseButton::Left)); }, + NSRightMouseDown => { events.push_back(MouseInput(Pressed, MouseButton::Right)); }, + NSRightMouseUp => { events.push_back(MouseInput(Released, MouseButton::Right)); }, NSMouseMoved => { let window_point: NSPoint = msg_send()(event, selector("locationInWindow")); // let window_point = event.locationInWindow(); -- cgit v1.2.3