pub struct PagedDocumentView { /* private fields */ }Expand description
A bar with the page, the total and the zoom, over a column of pages of which only those
that show are built, so the pictures of the others need not exist. Pictures come from whoever
uses it, page by page: until one is ready, the page shows a placeholder of the right size.
The fit follows the width of the view. Page Up, Page Down, Home and End move between pages,
and +, - and 0 zoom.
use ravenrs_core::Size;
use ravenrs_reactive::State;
use ravenrs_widgets::{PagedDocumentView, Ui};
let page = State::new(0_usize);
let document = PagedDocumentView::new(120, |_| Size::new(595.0, 842.0), |_| None).page(page.binding());
let mut ui = Ui::new(document, ravenrs_style::Theme::raven_dark());
ui.update();Implementations§
Source§impl PagedDocumentView
impl PagedDocumentView
Sourcepub fn new(
count: usize,
page_size: impl Fn(usize) -> Size + 'static,
picture: impl Fn(usize) -> Option<ImageData> + 'static,
) -> PagedDocumentView
pub fn new( count: usize, page_size: impl Fn(usize) -> Size + 'static, picture: impl Fn(usize) -> Option<ImageData> + 'static, ) -> PagedDocumentView
A document of count pages, each of the size given by page_size at 100%, with the
picture given by picture when it shows. Asked only for what shows, on each build, so it
should hand over what is ready and start on what is not.
Sourcepub fn page(self, page: Binding<usize>) -> PagedDocumentView
pub fn page(self, page: Binding<usize>) -> PagedDocumentView
The page in view, from 0. It follows the scroll, and setting it goes there.
Sourcepub fn zoom(self, zoom: Binding<ZoomView>) -> PagedDocumentView
pub fn zoom(self, zoom: Binding<ZoomView>) -> PagedDocumentView
The zoom, to share with other controls. Its center and viewport are not used.
Sourcepub fn height(self, height: f32) -> PagedDocumentView
pub fn height(self, height: f32) -> PagedDocumentView
A fixed height. It takes the height its parent gives it by default.
Trait Implementations§
Source§impl Debug for PagedDocumentView
impl Debug for PagedDocumentView
Auto Trait Implementations§
impl !RefUnwindSafe for PagedDocumentView
impl !Send for PagedDocumentView
impl !Sync for PagedDocumentView
impl !UnwindSafe for PagedDocumentView
impl Freeze for PagedDocumentView
impl Unpin for PagedDocumentView
impl UnsafeUnpin for PagedDocumentView
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
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>
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
None keeps the content size.