mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
implement copy link text, selected text, add link to the bookmarks (context menu) items; group menu items
This commit is contained in:
parent
c95cb6e756
commit
bb08b7cb9a
7 changed files with 295 additions and 77 deletions
|
|
@ -4,6 +4,8 @@ mod nex;
|
|||
mod plain;
|
||||
mod source;
|
||||
|
||||
use crate::profile::Profile;
|
||||
|
||||
use super::{ItemAction, WindowAction};
|
||||
use adw::ClampScrollable;
|
||||
use gemini::Gemini;
|
||||
|
|
@ -27,10 +29,11 @@ pub struct Text {
|
|||
impl Text {
|
||||
pub fn gemini(
|
||||
actions: (&Rc<WindowAction>, &Rc<ItemAction>),
|
||||
profile: &Rc<Profile>,
|
||||
base: &Uri,
|
||||
gemtext: &str,
|
||||
) -> Result<Self, (String, Option<Self>)> {
|
||||
match Gemini::build(actions, base, gemtext) {
|
||||
match Gemini::build(actions, profile, base, gemtext) {
|
||||
Ok(widget) => Ok(Self {
|
||||
scrolled_window: reader(&widget.text_view),
|
||||
text_view: widget.text_view,
|
||||
|
|
@ -55,10 +58,11 @@ impl Text {
|
|||
|
||||
pub fn markdown(
|
||||
actions: (&Rc<WindowAction>, &Rc<ItemAction>),
|
||||
profile: &Rc<Profile>,
|
||||
base: &Uri,
|
||||
gemtext: &str,
|
||||
) -> Self {
|
||||
let markdown = Markdown::build(actions, base, gemtext);
|
||||
let markdown = Markdown::build(actions, profile, base, gemtext);
|
||||
Self {
|
||||
scrolled_window: reader(&markdown.text_view),
|
||||
text_view: markdown.text_view,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue