pub struct ScreenProfile {
pub width: u32,
pub height: u32,
pub avail_width: u32,
pub avail_height: u32,
pub dpr: f64,
pub color_depth: u8,
pub orientation: String,
}Expand description
Screen configuration.
§Example
use stygian_browser::profile::ScreenProfile;
let s = ScreenProfile::fhd_desktop();
assert_eq!(s.width, 1920);
assert_eq!(s.height, 1080);Fields§
§width: u32Screen width in CSS pixels.
height: u32Screen height in CSS pixels.
avail_width: u32Available width (typically same as width).
avail_height: u32Available height (taskbar deducted — typically height - 40).
dpr: f64Device pixel ratio (1.0, 1.25, 1.5, 2.0, etc.).
color_depth: u8Colour depth in bits (24 or 32).
orientation: StringScreen orientation type string.
Implementations§
Source§impl ScreenProfile
impl ScreenProfile
Sourcepub fn fhd_desktop() -> Self
pub fn fhd_desktop() -> Self
1920×1080 FHD desktop at DPR 1.0.
Sourcepub fn qhd_desktop() -> Self
pub fn qhd_desktop() -> Self
2560×1440 QHD desktop at DPR 1.0.
Sourcepub fn macbook_pro_14() -> Self
pub fn macbook_pro_14() -> Self
2560×1600 MacBook Pro 14“ at DPR 2.0.
Trait Implementations§
Source§impl Clone for ScreenProfile
impl Clone for ScreenProfile
Source§fn clone(&self) -> ScreenProfile
fn clone(&self) -> ScreenProfile
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 ScreenProfile
impl Debug for ScreenProfile
Source§impl<'de> Deserialize<'de> for ScreenProfile
impl<'de> Deserialize<'de> for ScreenProfile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ScreenProfile
impl RefUnwindSafe for ScreenProfile
impl Send for ScreenProfile
impl Sync for ScreenProfile
impl Unpin for ScreenProfile
impl UnsafeUnpin for ScreenProfile
impl UnwindSafe for ScreenProfile
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