mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-10 03:10:41 +00:00
Dialog::get_content now returns &AnyView
This commit is contained in:
parent
8aa901afb4
commit
06086fdeb0
@ -1,4 +1,3 @@
|
||||
#[macro_use]
|
||||
extern crate cursive;
|
||||
|
||||
use cursive::{Cursive, Printer};
|
||||
|
@ -1,4 +1,3 @@
|
||||
#[macro_use]
|
||||
extern crate cursive;
|
||||
|
||||
use cursive::{Cursive, Printer};
|
||||
|
@ -154,7 +154,7 @@ impl ScrollBase {
|
||||
self.start_line = min(
|
||||
div_up(
|
||||
(1 + self.content_height - self.view_height) * thumb_y,
|
||||
(self.view_height - thumb_height + 1),
|
||||
self.view_height - thumb_height + 1,
|
||||
),
|
||||
self.content_height - self.view_height,
|
||||
);
|
||||
|
@ -111,10 +111,15 @@ impl Dialog {
|
||||
/// let text_view: &TextView = dialog.get_content().as_any().downcast_ref::<TextView>().unwrap();
|
||||
/// assert_eq!(text_view.get_content().source(), "Hello!");
|
||||
/// ```
|
||||
pub fn get_content(&self) -> &View {
|
||||
pub fn get_content(&self) -> &AnyView {
|
||||
&*self.content.view
|
||||
}
|
||||
|
||||
/// Gets mutable access to the content.
|
||||
pub fn get_content_mut(&mut self) -> &mut AnyView {
|
||||
&mut *self.content.view
|
||||
}
|
||||
|
||||
/// Sets the content for this dialog.
|
||||
///
|
||||
/// Previous content will be dropped.
|
||||
|
Loading…
Reference in New Issue
Block a user