mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
implement source view component as trait
This commit is contained in:
parent
f2da250376
commit
b995482e45
2 changed files with 36 additions and 31 deletions
|
|
@ -5,7 +5,7 @@ mod source;
|
|||
use super::{ItemAction, WindowAction};
|
||||
use adw::ClampScrollable;
|
||||
use gemini::Gemini;
|
||||
use gtk::{glib::Uri, prelude::Cast, ScrolledWindow, TextView};
|
||||
use gtk::{glib::Uri, ScrolledWindow, TextView};
|
||||
use plain::Plain;
|
||||
use source::Source;
|
||||
use std::rc::Rc;
|
||||
|
|
@ -64,10 +64,10 @@ impl Text {
|
|||
}
|
||||
|
||||
pub fn source(data: &str) -> Self {
|
||||
let source = Source::new(data);
|
||||
let source = sourceview::View::source(data);
|
||||
Self {
|
||||
scrolled_window: ScrolledWindow::builder().child(&source.text_view).build(),
|
||||
text_view: source.text_view.upcast::<TextView>(),
|
||||
scrolled_window: ScrolledWindow::builder().child(&source).build(),
|
||||
text_view: source.into_text_view(),
|
||||
meta: Meta { title: None },
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue