pub struct WebSettings {
pub zoom: f64,
pub desktop_mode: bool,
pub javascript: bool,
}Expand description
Per-view browsing settings: what WebView::zoom, WebView::desktop_mode and
WebView::javascript bind. The default is what a view does without them: 100%, the
engine’s choice of site layout, and page scripts on.
Fields§
§zoom: f64Page zoom factor, 1.0 for 100%, within WebSettings::ZOOM_RANGE. The backend keeps it
across navigations.
desktop_mode: boolAsk sites for the layout they serve a desktop browser.
javascript: boolScripts that pages load or contain run.
Implementations§
Source§impl WebSettings
impl WebSettings
Sourcepub const ZOOM_RANGE: RangeInclusive<f64>
pub const ZOOM_RANGE: RangeInclusive<f64>
The zoom factors every engine accepts: QtWebEngine and WebView2 both stop at 25% and 500%. Safari’s steps run from 50% to 300%.
Sourcepub fn clamp_zoom(zoom: f64) -> f64
pub fn clamp_zoom(zoom: f64) -> f64
zoom within WebSettings::ZOOM_RANGE; 1.0 for a value that is not a positive
number.
Trait Implementations§
Source§impl Clone for WebSettings
impl Clone for WebSettings
impl Copy for WebSettings
Source§impl Debug for WebSettings
impl Debug for WebSettings
Source§impl Default for WebSettings
impl Default for WebSettings
Source§impl PartialEq for WebSettings
impl PartialEq for WebSettings
impl StructuralPartialEq for WebSettings
Auto Trait Implementations§
impl Forget for WebSettings
impl Freeze for WebSettings
impl Move for WebSettings
impl RefUnwindSafe for WebSettings
impl Send for WebSettings
impl Sync for WebSettings
impl Unpin for WebSettings
impl UnsafeUnpin for WebSettings
impl UnwindSafe for WebSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more