pub struct ZoomControl { /* private fields */ }Expand description
Fit, 1:1, the current percentage and the buttons that zoom in and out, for a ZoomView.
It works from a toolbar of its own or inside a
FloatingToolbar.
use ravenrs_reactive::State;
use ravenrs_widgets::{ZoomControl, ZoomView};
let view = State::new(ZoomView::fit());
let control = ZoomControl::new(view.binding()).range(0.1, 8.0);Implementations§
Source§impl ZoomControl
impl ZoomControl
Sourcepub fn new(view: Binding<ZoomView>) -> ZoomControl
pub fn new(view: Binding<ZoomView>) -> ZoomControl
A control bound to view, with small buttons.
Sourcepub fn range(self, least: f32, most: f32) -> ZoomControl
pub fn range(self, least: f32, most: f32) -> ZoomControl
The least and the most its buttons reach, as a scale where 1 is 100%. Match it to
the range of the ZoomPanView that shares the view.
Sourcepub fn size(self, size: ButtonSize) -> ZoomControl
pub fn size(self, size: ButtonSize) -> ZoomControl
The size of its buttons.
Trait Implementations§
Source§impl Debug for ZoomControl
impl Debug for ZoomControl
Auto Trait Implementations§
impl !RefUnwindSafe for ZoomControl
impl !Send for ZoomControl
impl !Sync for ZoomControl
impl !UnwindSafe for ZoomControl
impl Freeze for ZoomControl
impl Unpin for ZoomControl
impl UnsafeUnpin for ZoomControl
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.