From dfbbc13d91a77a2052c8ad02c559e08d86bb7ebf Mon Sep 17 00:00:00 2001 From: Matthew Collins Date: Sat, 24 Feb 2018 12:52:45 +0000 Subject: Add a way to move notifications --- src/utils.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/utils.rs') diff --git a/src/utils.rs b/src/utils.rs index 2ad34f1..aa19d46 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -7,6 +7,13 @@ pub struct Utils { pub(crate) _client: Arc, } +pub enum NotificationPosition { + TopLeft, + TopRight, + BottomLeft, + BottomRight, +} + impl Utils { /// Returns the app ID of the current process pub fn app_id(&self) -> AppId { @@ -26,4 +33,18 @@ impl Utils { lang.to_string_lossy() } } + + /// Sets the position on the screen where popups from the steam overlay + /// should appear and display themselves in. + pub fn set_overlay_notification_position(&self, position: NotificationPosition) { + unsafe { + let position = match position { + NotificationPosition::TopLeft => sys::NotificationPosition::TopLeft, + NotificationPosition::TopRight => sys::NotificationPosition::TopRight, + NotificationPosition::BottomLeft => sys::NotificationPosition::BottomLeft, + NotificationPosition::BottomRight => sys::NotificationPosition::BottomRight, + }; + sys::SteamAPI_ISteamUtils_SetOverlayNotificationPosition(self.utils, position); + } + } } \ No newline at end of file -- cgit v1.2.3