pub struct TrackingAreaOptions(/* private fields */);
Expand description
Tracking area options builder for NSPanel
Allows combining multiple tracking area options using the builder pattern. Tracking areas enable mouse event tracking within a specific region of a view.
§Example
use tauri_nspanel::{TrackingAreaOptions, PanelBuilder};
// Track mouse movement and enter/exit events, active in any application state
let options = TrackingAreaOptions::new()
.active_always()
.mouse_entered_and_exited()
.mouse_moved();
// Use with panel macro
panel!(MyPanel {
with: {
tracking_area: {
options: options,
auto_resize: true
}
}
});
// Or use with PanelBuilder
PanelBuilder::new(&app, "my-panel")
.tracking_area(options, true)
.build();
Implementations§
Source§impl TrackingAreaOptions
impl TrackingAreaOptions
Sourcepub fn mouse_moved(self) -> Self
pub fn mouse_moved(self) -> Self
Track mouse moved events
Sourcepub fn mouse_entered_and_exited(self) -> Self
pub fn mouse_entered_and_exited(self) -> Self
Track mouse entered and exited events
Sourcepub fn active_always(self) -> Self
pub fn active_always(self) -> Self
Track when mouse is active in any application
Sourcepub fn active_in_active_app(self) -> Self
pub fn active_in_active_app(self) -> Self
Track when mouse is active in this application
Sourcepub fn active_in_key_window(self) -> Self
pub fn active_in_key_window(self) -> Self
Track when mouse is active in key window
Sourcepub fn active_when_first_responder(self) -> Self
pub fn active_when_first_responder(self) -> Self
Track when window is key
Sourcepub fn assume_inside(self) -> Self
pub fn assume_inside(self) -> Self
Assumes tracking area is active
Sourcepub fn in_visible_rect(self) -> Self
pub fn in_visible_rect(self) -> Self
Tracking area is in visibleRect coordinates
Sourcepub fn cursor_update(self) -> Self
pub fn cursor_update(self) -> Self
Enable cursor update events
Sourcepub fn from_raw(flags: NSTrackingAreaOptions) -> Self
pub fn from_raw(flags: NSTrackingAreaOptions) -> Self
Create from raw NSTrackingAreaOptions flags
Sourcepub fn value(&self) -> NSTrackingAreaOptions
pub fn value(&self) -> NSTrackingAreaOptions
Get the raw NSTrackingAreaOptions flags
Trait Implementations§
Source§impl Clone for TrackingAreaOptions
impl Clone for TrackingAreaOptions
Source§fn clone(&self) -> TrackingAreaOptions
fn clone(&self) -> TrackingAreaOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TrackingAreaOptions
impl Debug for TrackingAreaOptions
Source§impl Default for TrackingAreaOptions
impl Default for TrackingAreaOptions
Source§impl From<NSTrackingAreaOptions> for TrackingAreaOptions
impl From<NSTrackingAreaOptions> for TrackingAreaOptions
Source§fn from(value: NSTrackingAreaOptions) -> Self
fn from(value: NSTrackingAreaOptions) -> Self
Converts to this type from the input type.
Source§impl From<TrackingAreaOptions> for NSTrackingAreaOptions
impl From<TrackingAreaOptions> for NSTrackingAreaOptions
Source§fn from(options: TrackingAreaOptions) -> Self
fn from(options: TrackingAreaOptions) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TrackingAreaOptions
impl PartialEq for TrackingAreaOptions
impl Copy for TrackingAreaOptions
impl StructuralPartialEq for TrackingAreaOptions
Auto Trait Implementations§
impl Freeze for TrackingAreaOptions
impl RefUnwindSafe for TrackingAreaOptions
impl Send for TrackingAreaOptions
impl Sync for TrackingAreaOptions
impl Unpin for TrackingAreaOptions
impl UnwindSafe for TrackingAreaOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more