Implement common Std traits on many types (#3796)
This commit is contained in:
parent
9dff801f93
commit
1168cd4113
28 changed files with 167 additions and 103 deletions
|
|
@ -27,7 +27,7 @@ use super::ActiveEventLoop;
|
|||
use crate::cursor::{BadImage, Cursor, CursorImage, CustomCursor as RootCustomCursor};
|
||||
use crate::platform::web::CustomCursorError;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
pub(crate) enum CustomCursorSource {
|
||||
Image(CursorImage),
|
||||
Url { url: String, hotspot_x: u16, hotspot_y: u16 },
|
||||
|
|
|
|||
|
|
@ -711,7 +711,7 @@ impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub(crate) struct OwnedDisplayHandle;
|
||||
|
||||
impl OwnedDisplayHandle {
|
||||
|
|
|
|||
|
|
@ -457,6 +457,18 @@ pub struct PlatformSpecificWindowAttributes {
|
|||
pub(crate) append: bool,
|
||||
}
|
||||
|
||||
impl PartialEq for PlatformSpecificWindowAttributes {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
(match (&self.canvas, &other.canvas) {
|
||||
(Some(this), Some(other)) => Arc::ptr_eq(this, other),
|
||||
(None, None) => true,
|
||||
_ => false,
|
||||
}) && self.prevent_default.eq(&other.prevent_default)
|
||||
&& self.focusable.eq(&other.focusable)
|
||||
&& self.append.eq(&other.append)
|
||||
}
|
||||
}
|
||||
|
||||
impl PlatformSpecificWindowAttributes {
|
||||
pub(crate) fn set_canvas(&mut self, canvas: Option<backend::RawCanvasType>) {
|
||||
let Some(canvas) = canvas else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue